@digigov/react-core 0.21.1 → 0.22.0
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/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
- package/AccessibilityIcon/index.d.ts +15 -0
- package/AccessibilityIcon/index.js +52 -0
- package/AccessibilityIcon/index.test.d.ts +1 -0
- package/AccessibilityIcon/index.test.js +137 -0
- package/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
- package/AccessibilityTextIcon/index.d.ts +15 -0
- package/AccessibilityTextIcon/index.js +34 -0
- package/AccessibilityTextIcon/index.test.d.ts +1 -0
- package/AccessibilityTextIcon/index.test.js +129 -0
- package/CHANGELOG.md +14 -1
- package/DetailsSummary/index.d.ts +2 -1
- package/DetailsSummary/index.js +4 -3
- package/FieldContainer/index.js +10 -3
- package/Nav/index.d.ts +16 -1
- package/Nav/index.js +8 -2
- package/SectionBreak/index.d.ts +1 -1
- package/SectionBreak/index.js +4 -2
- package/SvgIcon/index.d.ts +1 -1
- package/es/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
- package/es/AccessibilityIcon/index.js +36 -0
- package/es/AccessibilityIcon/index.test.js +131 -0
- package/es/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
- package/es/AccessibilityTextIcon/index.js +21 -0
- package/es/AccessibilityTextIcon/index.test.js +123 -0
- package/es/DetailsSummary/index.js +4 -3
- package/es/FieldContainer/index.js +8 -3
- package/es/Nav/index.js +8 -2
- package/es/SectionBreak/index.js +4 -2
- package/es/index.js +2 -0
- package/es/registry.js +4 -0
- package/esm/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
- package/esm/AccessibilityIcon/index.js +36 -0
- package/esm/AccessibilityIcon/index.test.js +131 -0
- package/esm/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
- package/esm/AccessibilityTextIcon/index.js +21 -0
- package/esm/AccessibilityTextIcon/index.test.js +123 -0
- package/esm/DetailsSummary/index.js +4 -3
- package/esm/FieldContainer/index.js +8 -3
- package/esm/Nav/index.js +8 -2
- package/esm/SectionBreak/index.js +4 -2
- package/esm/index.js +3 -1
- package/esm/registry.js +4 -0
- package/index.d.ts +2 -0
- package/index.js +26 -0
- package/package.json +2 -2
- package/registry.d.ts +2 -0
- package/registry.js +6 -0
- package/src/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
- package/src/AccessibilityIcon/index.test.tsx +53 -0
- package/src/AccessibilityIcon/index.tsx +41 -0
- package/src/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
- package/src/AccessibilityTextIcon/index.test.tsx +50 -0
- package/src/AccessibilityTextIcon/index.tsx +28 -0
- package/src/DetailsSummary/index.tsx +8 -2
- package/src/FieldContainer/index.tsx +2 -1
- package/src/Nav/index.tsx +29 -2
- package/src/SectionBreak/index.tsx +5 -2
- package/src/SvgIcon/index.tsx +1 -1
- package/src/index.ts +2 -0
- 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
|
-
{
|
|
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
|
|
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(
|
|
21
|
+
function SectionBreak(
|
|
22
|
+
{ visible = true, size = 's', className, ...props },
|
|
23
|
+
ref
|
|
24
|
+
) {
|
|
22
25
|
return (
|
|
23
26
|
<Base
|
|
24
27
|
as="hr"
|
package/src/SvgIcon/index.tsx
CHANGED
|
@@ -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),
|