@digigov/react-core 0.21.1 → 0.22.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 (61) hide show
  1. package/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
  2. package/AccessibilityIcon/index.d.ts +15 -0
  3. package/AccessibilityIcon/index.js +52 -0
  4. package/AccessibilityIcon/index.test.d.ts +1 -0
  5. package/AccessibilityIcon/index.test.js +137 -0
  6. package/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
  7. package/AccessibilityTextIcon/index.d.ts +15 -0
  8. package/AccessibilityTextIcon/index.js +34 -0
  9. package/AccessibilityTextIcon/index.test.d.ts +1 -0
  10. package/AccessibilityTextIcon/index.test.js +129 -0
  11. package/CHANGELOG.md +14 -1
  12. package/DetailsSummary/index.d.ts +2 -1
  13. package/DetailsSummary/index.js +4 -3
  14. package/FieldContainer/index.js +10 -3
  15. package/Nav/index.d.ts +16 -1
  16. package/Nav/index.js +8 -2
  17. package/SectionBreak/index.d.ts +1 -1
  18. package/SectionBreak/index.js +4 -2
  19. package/SvgIcon/index.d.ts +1 -1
  20. package/es/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
  21. package/es/AccessibilityIcon/index.js +36 -0
  22. package/es/AccessibilityIcon/index.test.js +131 -0
  23. package/es/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
  24. package/es/AccessibilityTextIcon/index.js +21 -0
  25. package/es/AccessibilityTextIcon/index.test.js +123 -0
  26. package/es/DetailsSummary/index.js +4 -3
  27. package/es/FieldContainer/index.js +8 -3
  28. package/es/Nav/index.js +8 -2
  29. package/es/SectionBreak/index.js +4 -2
  30. package/es/index.js +2 -0
  31. package/es/registry.js +4 -0
  32. package/esm/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
  33. package/esm/AccessibilityIcon/index.js +36 -0
  34. package/esm/AccessibilityIcon/index.test.js +131 -0
  35. package/esm/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
  36. package/esm/AccessibilityTextIcon/index.js +21 -0
  37. package/esm/AccessibilityTextIcon/index.test.js +123 -0
  38. package/esm/DetailsSummary/index.js +4 -3
  39. package/esm/FieldContainer/index.js +8 -3
  40. package/esm/Nav/index.js +8 -2
  41. package/esm/SectionBreak/index.js +4 -2
  42. package/esm/index.js +3 -1
  43. package/esm/registry.js +4 -0
  44. package/index.d.ts +2 -0
  45. package/index.js +26 -0
  46. package/package.json +2 -2
  47. package/registry.d.ts +2 -0
  48. package/registry.js +6 -0
  49. package/src/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
  50. package/src/AccessibilityIcon/index.test.tsx +53 -0
  51. package/src/AccessibilityIcon/index.tsx +41 -0
  52. package/src/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
  53. package/src/AccessibilityTextIcon/index.test.tsx +50 -0
  54. package/src/AccessibilityTextIcon/index.tsx +28 -0
  55. package/src/DetailsSummary/index.tsx +8 -2
  56. package/src/FieldContainer/index.tsx +2 -1
  57. package/src/Nav/index.tsx +29 -2
  58. package/src/SectionBreak/index.tsx +5 -2
  59. package/src/SvgIcon/index.tsx +1 -1
  60. package/src/index.ts +2 -0
  61. package/src/registry.js +4 -0
package/src/Nav/index.tsx CHANGED
@@ -14,13 +14,37 @@ export interface NavProps extends BaseProps<'nav'> {
14
14
  * layout is horizontal by default.
15
15
  */
16
16
  layout?: 'vertical' | 'horizontal';
17
+ /**
18
+ * hidden is optional.
19
+ * hidden prop hides the nav element when it is called from a navItem.
20
+ */
21
+ hidden?: boolean;
22
+ /**
23
+ * fixed is optional.
24
+ * fixed prop allows element to be positioned relative to the viewport
25
+ */
26
+ fixed?: boolean;
27
+ /**
28
+ * border is optional.
29
+ * border prop contains border-bottom styling.
30
+ */
31
+ border?: boolean;
17
32
  }
18
33
  /**
19
34
  * Nav is mainly used under the Header.
20
35
  * This is a wrapper for the NavList component.
21
36
  */
22
37
  export const Nav = React.forwardRef<HTMLElement, NavProps>(function Nav(
23
- { className, open = false, layout = 'horizontal', children, ...props },
38
+ {
39
+ className,
40
+ open = false,
41
+ layout = 'horizontal',
42
+ hidden = false,
43
+ fixed = true,
44
+ border = true,
45
+ children,
46
+ ...props
47
+ },
24
48
  ref
25
49
  ) {
26
50
  return (
@@ -29,8 +53,11 @@ export const Nav = React.forwardRef<HTMLElement, NavProps>(function Nav(
29
53
  ref={ref}
30
54
  className={clsx(className, {
31
55
  'govgr-horizontal-nav': true,
32
- 'govgr-nav-horizontal--border': layout === 'horizontal',
56
+ 'govgr-horizontal-nav--order': layout === 'horizontal',
57
+ 'govgr-nav-horizontal--fixed': fixed,
58
+ 'govgr-nav-horizontal--border': border,
33
59
  'govgr-horizontal-nav--open': open,
60
+ 'govgr-horizontal-nav--hidden': hidden,
34
61
  })}
35
62
  {...props}
36
63
  >
@@ -12,13 +12,16 @@ export interface SectionBreakProps extends BaseProps<'hr'> {
12
12
  /**
13
13
  * size is optional and it is about the different size margins.
14
14
  */
15
- size?: 'xl' | 'l' | 'm';
15
+ size?: 'xl' | 'l' | 'm' | 's';
16
16
  }
17
17
  /**
18
18
  * SectionBreak is used to create a thematic break between sections of content.
19
19
  */
20
20
  export const SectionBreak = React.forwardRef<HTMLHRElement, SectionBreakProps>(
21
- function SectionBreak({ visible, size, className, ...props }, ref) {
21
+ function SectionBreak(
22
+ { visible = true, size = 's', className, ...props },
23
+ ref
24
+ ) {
22
25
  return (
23
26
  <Base
24
27
  as="hr"
@@ -7,7 +7,7 @@ export interface SvgIconProps extends BaseProps<'svg'> {
7
7
  * size prop declares the size of the svg icon.
8
8
  * size is optional. The default value is 'm'.
9
9
  */
10
- size?: 's' | 'm' | 'l' | 'xl';
10
+ size?: 's' | 'm' | 'l' | 'xl' | 'xxl';
11
11
 
12
12
  /**
13
13
  * variant property styles svg icon with Gov.gr palette's basic colors.
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from '@digigov/react-core/AccessibilityIcon';
2
+ export * from '@digigov/react-core/AccessibilityTextIcon';
1
3
  export * from '@digigov/react-core/Accordion';
2
4
  export * from '@digigov/react-core/AccordionControls';
3
5
  export * from '@digigov/react-core/AccordionSection';
package/src/registry.js CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ import * as _digigov_react_core_AccessibilityIcon from '@digigov/react-core/AccessibilityIcon';
3
+ import * as _digigov_react_core_AccessibilityTextIcon from '@digigov/react-core/AccessibilityTextIcon';
2
4
  import * as _digigov_react_core_Accordion from '@digigov/react-core/Accordion';
3
5
  import * as _digigov_react_core_AccordionControls from '@digigov/react-core/AccordionControls';
4
6
  import * as _digigov_react_core_AccordionSection from '@digigov/react-core/AccordionSection';
@@ -176,6 +178,8 @@ function lazyImport(pkgImport) {
176
178
  )
177
179
  }
178
180
  export default {
181
+ '@digigov/react-core/AccessibilityIcon': lazyImport(_digigov_react_core_AccessibilityIcon),
182
+ '@digigov/react-core/AccessibilityTextIcon': lazyImport(_digigov_react_core_AccessibilityTextIcon),
179
183
  '@digigov/react-core/Accordion': lazyImport(_digigov_react_core_Accordion),
180
184
  '@digigov/react-core/AccordionControls': lazyImport(_digigov_react_core_AccordionControls),
181
185
  '@digigov/react-core/AccordionSection': lazyImport(_digigov_react_core_AccordionSection),