@digigov/react-core 0.24.0 → 0.25.1

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 (113) hide show
  1. package/AccessibilityIcon/index.d.ts +0 -6
  2. package/AccessibilityTextIcon/index.d.ts +0 -6
  3. package/AccordionSection/index.d.ts +0 -9
  4. package/AccordionSectionSummary/index.d.ts +1 -2
  5. package/AccordionSectionSummary/index.js +2 -5
  6. package/ArrowIcon/index.d.ts +0 -5
  7. package/BackLink/index.d.ts +0 -4
  8. package/Base/index.d.ts +1 -2
  9. package/BurgerIcon/index.d.ts +0 -6
  10. package/Button/index.d.ts +0 -4
  11. package/CHANGELOG.md +14 -1
  12. package/CallToAction/index.d.ts +0 -1
  13. package/CaretIcon/index.d.ts +0 -1
  14. package/CheckIcon/index.d.ts +0 -6
  15. package/CheckboxConditional/index.js +5 -5
  16. package/CheckboxItem/index.d.ts +0 -13
  17. package/CheckboxItem/index.js +5 -4
  18. package/CloseIcon/index.d.ts +0 -6
  19. package/DateInputItem/index.d.ts +0 -4
  20. package/FileUpload/index.d.ts +0 -8
  21. package/FooterImage/index.d.ts +0 -4
  22. package/FooterLink/index.d.ts +0 -4
  23. package/FooterLink/index.js +2 -4
  24. package/FooterList/index.d.ts +1 -1
  25. package/GlobeIcon/index.d.ts +0 -6
  26. package/Grid/index.d.ts +1 -2
  27. package/HeaderLogo/index.d.ts +0 -4
  28. package/HeaderSecondaryLogo/index.d.ts +0 -4
  29. package/HeaderTitle/index.d.ts +0 -4
  30. package/HeaderTitle/index.js +1 -1
  31. package/HellenicRepublicLogo/index.d.ts +0 -5
  32. package/Hidden/index.d.ts +0 -1
  33. package/MoreVertIcon/index.d.ts +0 -6
  34. package/NavListItemLink/index.d.ts +0 -5
  35. package/NotificationBannerLink/index.d.ts +0 -4
  36. package/NotificationBannerLink/index.js +3 -3
  37. package/PhaseBannerHeaderContainer/index.d.ts +1 -3
  38. package/RadioConditional/index.js +5 -5
  39. package/RadioItem/index.d.ts +0 -13
  40. package/RadioItem/index.js +4 -2
  41. package/SelectContainer/index.d.ts +0 -4
  42. package/SelectOption/index.d.ts +0 -8
  43. package/SingleCharacterInputItem/index.d.ts +0 -5
  44. package/SkipLink/index.d.ts +0 -1
  45. package/Table/index.d.ts +7 -1
  46. package/Table/index.js +4 -2
  47. package/TabsListItem/index.d.ts +0 -4
  48. package/TextArea/index.d.ts +0 -8
  49. package/TextInput/index.d.ts +0 -4
  50. package/UncheckIcon/index.d.ts +0 -6
  51. package/es/AccordionSectionSummary/index.js +2 -5
  52. package/es/CheckboxConditional/index.js +3 -5
  53. package/es/CheckboxItem/index.js +4 -4
  54. package/es/FooterLink/index.js +2 -4
  55. package/es/HeaderTitle/index.js +1 -1
  56. package/es/NotificationBannerLink/index.js +3 -3
  57. package/es/RadioConditional/index.js +3 -5
  58. package/es/RadioItem/index.js +3 -2
  59. package/es/Table/index.js +4 -2
  60. package/esm/AccordionSectionSummary/index.js +2 -5
  61. package/esm/CheckboxConditional/index.js +3 -5
  62. package/esm/CheckboxItem/index.js +4 -4
  63. package/esm/FooterLink/index.js +2 -4
  64. package/esm/HeaderTitle/index.js +1 -1
  65. package/esm/NotificationBannerLink/index.js +3 -3
  66. package/esm/RadioConditional/index.js +3 -5
  67. package/esm/RadioItem/index.js +3 -2
  68. package/esm/Table/index.js +4 -2
  69. package/esm/index.js +1 -1
  70. package/package.json +2 -2
  71. package/src/AccessibilityIcon/index.tsx +2 -9
  72. package/src/AccessibilityTextIcon/index.tsx +1 -8
  73. package/src/AccordionSection/index.tsx +1 -7
  74. package/src/AccordionSectionSummary/index.tsx +2 -8
  75. package/src/ArrowIcon/index.tsx +0 -5
  76. package/src/BackLink/index.tsx +2 -7
  77. package/src/Base/index.tsx +1 -1
  78. package/src/BurgerIcon/index.tsx +0 -6
  79. package/src/Button/index.tsx +1 -6
  80. package/src/CallToAction/index.tsx +5 -4
  81. package/src/CaretIcon/index.tsx +0 -1
  82. package/src/CheckIcon/index.tsx +2 -8
  83. package/src/CheckboxConditional/index.tsx +5 -13
  84. package/src/CheckboxItem/index.tsx +6 -20
  85. package/src/CloseIcon/index.tsx +2 -8
  86. package/src/DateInputItem/index.tsx +0 -4
  87. package/src/Fieldset/index.tsx +1 -2
  88. package/src/FileUpload/index.tsx +7 -12
  89. package/src/FooterImage/index.tsx +1 -6
  90. package/src/FooterLink/index.tsx +2 -8
  91. package/src/FooterList/index.tsx +1 -1
  92. package/src/GlobeIcon/index.tsx +0 -6
  93. package/src/Grid/index.tsx +1 -2
  94. package/src/HeaderLogo/index.tsx +0 -4
  95. package/src/HeaderSecondaryLogo/index.tsx +0 -6
  96. package/src/HeaderTitle/index.tsx +2 -7
  97. package/src/HellenicRepublicLogo/index.tsx +24 -29
  98. package/src/Hidden/index.tsx +0 -1
  99. package/src/MoreVertIcon/index.tsx +1 -8
  100. package/src/NavListItemLink/index.tsx +0 -5
  101. package/src/NotificationBannerLink/index.tsx +2 -7
  102. package/src/PhaseBannerHeaderContainer/index.tsx +1 -4
  103. package/src/RadioConditional/index.tsx +5 -13
  104. package/src/RadioItem/index.tsx +5 -19
  105. package/src/SelectContainer/index.tsx +1 -6
  106. package/src/SelectOption/index.tsx +1 -11
  107. package/src/SingleCharacterInputItem/index.tsx +0 -5
  108. package/src/SkipLink/index.tsx +1 -3
  109. package/src/Table/index.tsx +10 -0
  110. package/src/TabsListItem/index.tsx +0 -5
  111. package/src/TextArea/index.tsx +0 -10
  112. package/src/TextInput/index.tsx +0 -5
  113. package/src/UncheckIcon/index.tsx +1 -8
@@ -7,11 +7,6 @@ import logoElInverted from '@digigov/react-core/HellenicRepublicLogo/logo-invert
7
7
  import logoEnInverted from '@digigov/react-core/HellenicRepublicLogo/logo-inverted-en';
8
8
 
9
9
  export interface HellenicRepublicLogoProps extends BaseProps<'img'> {
10
- /**
11
- * src is optional.
12
- * By default, the src is the official logo of the Hellenic Republic uploaded to the government.gov.gr site.
13
- */
14
- src?: string;
15
10
  /**
16
11
  * lang is optional.
17
12
  * Use this to define the language version of the logo. Default is el.
@@ -30,30 +25,30 @@ export const HellenicRepublicLogo = React.forwardRef<
30
25
  const logoInverted = lang === 'en' ? logoEnInverted : logoElInverted;
31
26
  return (
32
27
  <>
33
- <Base
34
- as="img"
35
- src={logo}
36
- ref={ref}
37
- className={clsx(className, {
38
- 'govgr-footer__government-logo': true,
39
- })}
40
- {...props}
41
- alt="Hellenic Republic Logo"
42
- >
43
- {children}
44
- </Base>
45
- <Base
46
- as="img"
47
- src={logoInverted}
48
- ref={ref}
49
- className={clsx(className, {
50
- 'govgr-footer__government-logo-inverted': true,
51
- })}
52
- {...props}
53
- alt="Hellenic Republic Logo"
54
- >
55
- {children}
56
- </Base>
28
+ <Base
29
+ as="img"
30
+ src={logo}
31
+ ref={ref}
32
+ className={clsx(className, {
33
+ 'govgr-footer__government-logo': true,
34
+ })}
35
+ {...props}
36
+ alt="Hellenic Republic Logo"
37
+ >
38
+ {children}
39
+ </Base>
40
+ <Base
41
+ as="img"
42
+ src={logoInverted}
43
+ ref={ref}
44
+ className={clsx(className, {
45
+ 'govgr-footer__government-logo-inverted': true,
46
+ })}
47
+ {...props}
48
+ alt="Hellenic Republic Logo"
49
+ >
50
+ {children}
51
+ </Base>
57
52
  </>
58
53
  );
59
54
  });
@@ -3,7 +3,6 @@ import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
5
  export interface HiddenProps extends BaseProps<'div'> {
6
- ref?: React.Ref<HTMLDivElement>;
7
6
  lgUp?: boolean;
8
7
  mdUp?: boolean;
9
8
  smUp?: boolean;
@@ -1,14 +1,7 @@
1
1
  import React from 'react';
2
2
  import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
3
3
  import clsx from 'clsx';
4
- export interface MoreVertIconProps extends SvgIconProps {
5
- /**
6
- * ref is optional.
7
- * ref prop declares the reference of the svg icon component.
8
- * It can be used to to access the DOM element and the React element.
9
- */
10
- ref?: React.Ref<SVGSVGElement>;
11
- }
4
+ export interface MoreVertIconProps extends SvgIconProps {}
12
5
  /**
13
6
  * Use MoreVertIcon component when you need to show more options.
14
7
  */
@@ -10,11 +10,6 @@ export interface NavListItemLinkProps extends BaseProps<'a'> {
10
10
  *
11
11
  */
12
12
  active?: boolean;
13
- /**
14
- * href prop is used to navigate to current url page.
15
- * href is optional.
16
- */
17
- href?: string;
18
13
  }
19
14
  /**
20
15
  * NavListItemLink is an <a> element. It should be inside the NavListItem component.
@@ -2,12 +2,7 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
- export interface NotificationBannerLinkProps extends BaseProps<'a'> {
6
- /**
7
- * href is optional.
8
- */
9
- href?: string;
10
- }
5
+ export interface NotificationBannerLinkProps extends BaseProps<'a'> {}
11
6
  /**
12
7
  * Details for the NotificationBannerLink.
13
8
  * NotificationBannerLink allow users to click their way from page to page.
@@ -17,7 +12,7 @@ export const NotificationBannerLink = React.forwardRef<
17
12
  HTMLAnchorElement,
18
13
  NotificationBannerLinkProps
19
14
  >(function NotificationBannerLink(
20
- { href = '#', className, children, ...props },
15
+ { className, href = '#', children, ...props },
21
16
  ref
22
17
  ) {
23
18
  return (
@@ -2,10 +2,7 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
- export interface PhaseBannerHeaderContainerProps extends BaseProps<'div'> {
6
- tag?: string;
7
- text?: string;
8
- }
5
+ export interface PhaseBannerHeaderContainerProps extends BaseProps<'div'> {}
9
6
 
10
7
  export const PhaseBannerHeaderContainer = React.forwardRef<
11
8
  HTMLDivElement,
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
+ import LabelContainer from '@digigov/react-core/LabelContainer';
4
+ import FieldContainer from '@digigov/react-core/FieldContainer';
3
5
  import clsx from 'clsx';
4
6
 
5
7
  export interface RadioConditionalProps extends BaseProps<'div'> {}
@@ -21,19 +23,9 @@ export const RadioConditional = React.forwardRef<
21
23
  })}
22
24
  {...props}
23
25
  >
24
- <div
25
- className={clsx({
26
- 'govgr-field': true,
27
- })}
28
- >
29
- <label
30
- className={clsx({
31
- 'govgr-label': true,
32
- })}
33
- >
34
- {children}
35
- </label>
36
- </div>
26
+ <FieldContainer>
27
+ <LabelContainer>{children}</LabelContainer>
28
+ </FieldContainer>
37
29
  </Base>
38
30
  );
39
31
  });
@@ -1,23 +1,9 @@
1
1
  import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
+ import LabelContainer from '@digigov/react-core/LabelContainer';
3
4
  import clsx from 'clsx';
4
5
 
5
- export interface RadioItemProps extends BaseProps<'input'> {
6
- /**
7
- *Name property is optional and it contains a single value which describes the name of the <input> element.
8
- */
9
- name?: string;
10
-
11
- /**
12
- * Value property is optional and it specifies the value of an <input> element.
13
- */
14
- value?: string;
15
- /**
16
- * disabled prop disables the radio input.
17
- * disabled property is optional and it is false by default.
18
- */
19
- disabled?: boolean;
20
- }
6
+ export interface RadioItemProps extends BaseProps<'input'> {}
21
7
  /**
22
8
  * RadioItem component is used for display radio buttons.
23
9
  * RadioItem component must be included inside Radio component, as a children component.
@@ -33,9 +19,9 @@ export const RadioItem = React.forwardRef<HTMLInputElement, RadioItemProps>(
33
19
  'govgr-radios__item': true,
34
20
  })}
35
21
  >
36
- <label
22
+ <LabelContainer
37
23
  className={clsx({
38
- 'govgr-label govgr-radios__label': true,
24
+ 'govgr-radios__label': true,
39
25
  'govgr-radios__label--disabled': disabled === true,
40
26
  })}
41
27
  >
@@ -52,7 +38,7 @@ export const RadioItem = React.forwardRef<HTMLInputElement, RadioItemProps>(
52
38
  disabled={disabled}
53
39
  {...props}
54
40
  />
55
- </label>
41
+ </LabelContainer>
56
42
  </div>
57
43
  );
58
44
  }
@@ -2,12 +2,7 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
- export interface SelectContainerProps extends BaseProps<'select'> {
6
- /**
7
- * name is optional but strongly recommended.
8
- */
9
- name?: string;
10
- }
5
+ export interface SelectContainerProps extends BaseProps<'select'> {}
11
6
  /**
12
7
  * The SelectContainer component allows users to choose an option from a long list.
13
8
  * It is used as a parent component to wrap SelectOption component.
@@ -2,17 +2,7 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
- export interface SelectOptionProps extends BaseProps<'option'> {
6
- /**
7
- * value is optional.
8
- */
9
- value?: string;
10
-
11
- /**
12
- * selected is optional.
13
- */
14
- selected?: boolean;
15
- }
5
+ export interface SelectOptionProps extends BaseProps<'option'> {}
16
6
  /**
17
7
  * SelectOption component is used for display options value.
18
8
  * SelectOption component must be included inside Select component as children component
@@ -3,11 +3,6 @@ import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
5
  export interface SingleCharacterInputItemProps extends BaseProps<'input'> {
6
- /**
7
- * Name property is optional
8
- * Name prop contains a single value which describes the name of the <input> element.
9
- */
10
- name?: string;
11
6
  /**
12
7
  * error is optional. The default value is false.
13
8
  * Use this prop when there is an error at the input.
@@ -2,9 +2,7 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
- export interface LinkProps extends BaseProps<'a'> {
6
- href?: string;
7
- }
5
+ export interface LinkProps extends BaseProps<'a'> {}
8
6
  /**
9
7
  * Use the skip link component to help keyboard-only users skip to the main content on a page.
10
8
  */
@@ -28,6 +28,12 @@ export interface TableProps extends BaseProps<'table'> {
28
28
  * Default value is false.
29
29
  */
30
30
  verticalBorders?: boolean;
31
+ /**
32
+ * stacked is optional.
33
+ * The stacked prop gives responsiveness to the table. If used, make sure to add "data-label" to TableDataCell components.
34
+ * Default value is never.
35
+ */
36
+ stacked?: 'always' | 's' | 'm' | 'never';
31
37
  }
32
38
  /**
33
39
  * Table component is used to wrap the sub components of a table
@@ -39,6 +45,7 @@ export const Table = React.forwardRef<HTMLTableElement, TableProps>(
39
45
  zebra = false,
40
46
  dense = false,
41
47
  verticalBorders = false,
48
+ stacked= 'never',
42
49
  className,
43
50
  children,
44
51
  ...props
@@ -51,6 +58,9 @@ export const Table = React.forwardRef<HTMLTableElement, TableProps>(
51
58
  ref={ref}
52
59
  className={clsx(className, {
53
60
  'govgr-table': true,
61
+ 'govgr-table--stacked-always': stacked === 'always',
62
+ 'govgr-table--stacked-s': stacked === 's',
63
+ 'govgr-table--stacked-m': stacked == 'm',
54
64
  'govgr-table--dark': variant === 'dark',
55
65
  'govgr-table--light': variant === 'light',
56
66
  'govgr-table--zebra': zebra === true,
@@ -9,11 +9,6 @@ export interface TabsListItemProps extends BaseProps<'a'> {
9
9
  * This declares that this tab is selected.
10
10
  */
11
11
  selected?: boolean;
12
-
13
- /**
14
- * href is optional.
15
- */
16
- href?: string;
17
12
  }
18
13
  /**
19
14
  * TabsListItem should be inside the TabsList.
@@ -3,16 +3,6 @@ import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
5
  export interface TextAreaProps extends BaseProps<'textarea'> {
6
- /**
7
- * name is optional but strongly recommended.
8
- */
9
- name?: string;
10
-
11
- /**
12
- * row is optional. The default value is 6.
13
- */
14
- rows?: 4 | 5 | 6 | 7 | 8;
15
-
16
6
  /**
17
7
  * error is optional. The default value is false.
18
8
  * Use this prop when there is an error at the input.
@@ -3,11 +3,6 @@ import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
5
  export interface TextInputProps extends BaseProps<'input'> {
6
- /**
7
- * name is optional but strongly recommended.
8
- */
9
- name?: string;
10
-
11
6
  /**
12
7
  * characterWidth is optional.
13
8
  */
@@ -1,14 +1,7 @@
1
1
  import React from 'react';
2
2
  import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
3
3
  import clsx from 'clsx';
4
- export interface UncheckIconProps extends SvgIconProps {
5
- /**
6
- * ref is optional.
7
- * ref prop declares the reference of the svg icon component.
8
- * It can be used to to access the DOM element and the React element.
9
- */
10
- ref?: React.Ref<SVGSVGElement>;
11
- }
4
+ export interface UncheckIconProps extends SvgIconProps {}
12
5
  /**
13
6
  * Use UnUncheckIcon component when you need a uncheck/decline icon.
14
7
  */