design-react-kit 5.1.0 → 5.2.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/CHANGELOG.md +14 -0
- package/dist/List/List.cjs +2 -0
- package/dist/List/List.cjs.map +1 -0
- package/dist/List/List.js +13 -0
- package/dist/List/List.js.map +1 -0
- package/dist/List/ListItem.cjs +2 -0
- package/dist/List/ListItem.cjs.map +1 -0
- package/dist/List/ListItem.js +24 -0
- package/dist/List/ListItem.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/types/List/List.d.ts +16 -0
- package/dist/types/List/ListItem.d.ts +27 -0
- package/dist/types/index.d.ts +6 -2
- package/package.json +3 -14
- package/src/List/List.tsx +40 -0
- package/src/List/ListItem.tsx +86 -0
- package/src/index.ts +6 -2
package/dist/index.js
CHANGED
|
@@ -48,10 +48,10 @@ export { HeaderBrand } from './Header/HeaderBrand';
|
|
|
48
48
|
export { HeaderContent } from './Header/HeaderContent';
|
|
49
49
|
export { HeaderLinkZone } from './Header/HeaderLinkZone';
|
|
50
50
|
export { HeaderRightZone } from './Header/HeaderRightZone';
|
|
51
|
+
export { Headers } from './Header/Headers';
|
|
51
52
|
export { HeaderSearch } from './Header/HeaderSearch';
|
|
52
53
|
export { HeaderSocialsZone } from './Header/HeaderSocialsZone';
|
|
53
54
|
export { HeaderToggler } from './Header/HeaderToggler';
|
|
54
|
-
export { Headers } from './Header/Headers';
|
|
55
55
|
export { Hero, HeroBackground, HeroBody, HeroButton, HeroCategory, HeroTitle } from './Hero/index';
|
|
56
56
|
export { Icon, clearIconCache, iconsList as icons, preloadIcons } from './Icon/Icon';
|
|
57
57
|
export { Input } from './Input/Input';
|
|
@@ -59,6 +59,8 @@ export { InputContainer } from './Input/InputContainer';
|
|
|
59
59
|
export { TextArea } from './Input/TextArea';
|
|
60
60
|
export { LinkList } from './LinkList/LinkList';
|
|
61
61
|
export { LinkListItem } from './LinkList/LinkListItem';
|
|
62
|
+
export { List } from './List/List';
|
|
63
|
+
export { ListItem } from './List/ListItem';
|
|
62
64
|
export { MegamenuFooter } from './Megamenu/MegamenuFooter';
|
|
63
65
|
export { MegamenuHighlightColumn } from './Megamenu/MegamenuHighlightColumn';
|
|
64
66
|
export { MegamenuItem } from './Megamenu/MegamenuItem';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,GAAG,EACH,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,UAAU,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,WAAW,EACX,aAAa,EACb,cAAc,IAAI,SAAS,EAC3B,cAAc,IAAI,SAAS,EAC3B,OAAO,EACP,WAAW,EACX,aAAa,EACb,GAAG,EACH,UAAU,EACV,OAAO,EACP,KAAK,EACL,OAAO,EACP,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,E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OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ElementType, FC, HTMLAttributes } from 'react';
|
|
2
|
+
export interface ListProps extends HTMLAttributes<HTMLUListElement> {
|
|
3
|
+
/** Classi aggiuntive da usare per il componente lista del List */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Classi aggiuntive da usare per il componente wrapper del List */
|
|
6
|
+
wrapperClassName?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Utilizzarlo in caso di utilizzo di componenti personalizzati per il wrapper della lista.
|
|
9
|
+
* Nota: viene ignorato quando usato in lista annidate.
|
|
10
|
+
* */
|
|
11
|
+
tag?: ElementType;
|
|
12
|
+
/** Quando attivo rimuove il componente contenitore della ListList. Utile per alcuni tipi di liste annidate. */
|
|
13
|
+
noWrapper?: boolean;
|
|
14
|
+
testId?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const List: FC<ListProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ElementType, FC, ReactNode } from 'react';
|
|
2
|
+
export interface ListItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
|
+
/** Indica se l'elemento è attivo o no */
|
|
4
|
+
active?: boolean;
|
|
5
|
+
/** Indica se l'elemento ha un avatar */
|
|
6
|
+
avatar?: ReactNode;
|
|
7
|
+
/** Indica se l'elemento ha una icona */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** Indica se l'elemento ha una immagine */
|
|
10
|
+
img?: ReactNode;
|
|
11
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
12
|
+
tag?: ElementType;
|
|
13
|
+
/** Classi aggiuntive da usare per il componente ListItem */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Classi aggiuntive da usare per l'elemento contenitore dell'item */
|
|
16
|
+
wrapperClassName?: string;
|
|
17
|
+
/** Indica il link a cui l'elemento deve puntare. */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** Indica il link route a cui l'elemento deve puntare. */
|
|
20
|
+
to?: string;
|
|
21
|
+
testId?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const ListItem: FC<ListItemProps> & {
|
|
24
|
+
MultipleAction: typeof MultipleAction;
|
|
25
|
+
};
|
|
26
|
+
declare const MultipleAction: FC<ListItemProps>;
|
|
27
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -48,10 +48,10 @@ export { HeaderBrand } from './Header/HeaderBrand';
|
|
|
48
48
|
export { HeaderContent } from './Header/HeaderContent';
|
|
49
49
|
export { HeaderLinkZone } from './Header/HeaderLinkZone';
|
|
50
50
|
export { HeaderRightZone } from './Header/HeaderRightZone';
|
|
51
|
+
export { Headers } from './Header/Headers';
|
|
51
52
|
export { HeaderSearch } from './Header/HeaderSearch';
|
|
52
53
|
export { HeaderSocialsZone } from './Header/HeaderSocialsZone';
|
|
53
54
|
export { HeaderToggler } from './Header/HeaderToggler';
|
|
54
|
-
export { Headers } from './Header/Headers';
|
|
55
55
|
export { Hero, HeroBackground, HeroBody, HeroButton, HeroCategory, HeroTitle } from './Hero/index';
|
|
56
56
|
export { Icon, clearIconCache, iconsList as icons, preloadIcons } from './Icon/Icon';
|
|
57
57
|
export { Input } from './Input/Input';
|
|
@@ -59,6 +59,8 @@ export { InputContainer } from './Input/InputContainer';
|
|
|
59
59
|
export { TextArea } from './Input/TextArea';
|
|
60
60
|
export { LinkList } from './LinkList/LinkList';
|
|
61
61
|
export { LinkListItem } from './LinkList/LinkListItem';
|
|
62
|
+
export { List } from './List/List';
|
|
63
|
+
export { ListItem } from './List/ListItem';
|
|
62
64
|
export { MegamenuFooter } from './Megamenu/MegamenuFooter';
|
|
63
65
|
export { MegamenuHighlightColumn } from './Megamenu/MegamenuHighlightColumn';
|
|
64
66
|
export { MegamenuItem } from './Megamenu/MegamenuItem';
|
|
@@ -137,10 +139,10 @@ export type { HeaderBrandProps } from './Header/HeaderBrand';
|
|
|
137
139
|
export type { HeaderContentProps } from './Header/HeaderContent';
|
|
138
140
|
export type { HeaderLinkZoneProps } from './Header/HeaderLinkZone';
|
|
139
141
|
export type { HeaderRightZoneProps } from './Header/HeaderRightZone';
|
|
142
|
+
export type { HeadersProps } from './Header/Headers';
|
|
140
143
|
export type { HeaderSearchProps } from './Header/HeaderSearch';
|
|
141
144
|
export type { HeaderSocialsZoneProps } from './Header/HeaderSocialsZone';
|
|
142
145
|
export type { HeaderTogglerProps } from './Header/HeaderToggler';
|
|
143
|
-
export type { HeadersProps } from './Header/Headers';
|
|
144
146
|
export type { HeroBackgroundProps, HeroBodyProps, HeroButtonProps, HeroCategoryProps, HeroProps, HeroTitleProps } from './Hero/index';
|
|
145
147
|
export type { IconName, IconProps } from './Icon/Icon';
|
|
146
148
|
export type { InputProps } from './Input/Input';
|
|
@@ -148,6 +150,8 @@ export type { InputContainerProps } from './Input/InputContainer';
|
|
|
148
150
|
export type { TextAreaProps } from './Input/TextArea';
|
|
149
151
|
export type { LinkListProps } from './LinkList/LinkList';
|
|
150
152
|
export type { LinkListItemProps } from './LinkList/LinkListItem';
|
|
153
|
+
export type { ListProps } from './List/List';
|
|
154
|
+
export type { ListItemProps } from './List/ListItem';
|
|
151
155
|
export type { MegamenuFooterProps } from './Megamenu/MegamenuFooter';
|
|
152
156
|
export type { MegamenuHCProps } from './Megamenu/MegamenuHighlightColumn';
|
|
153
157
|
export type { MegamenuItemProps } from './Megamenu/MegamenuItem';
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/italia/design-react-kit/issues"
|
|
26
26
|
},
|
|
27
|
-
"version": "5.
|
|
27
|
+
"version": "5.2.0",
|
|
28
28
|
"license": "BSD-3",
|
|
29
29
|
"type": "module",
|
|
30
30
|
"module": "./dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"url": "git+https://github.com/italia/design-react-kit.git"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"node": ">=
|
|
50
|
+
"node": ">=20"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"start": "NODE_OPTIONS=--max_old_space_size=16384 npm run storybook:serve",
|
|
@@ -76,15 +76,8 @@
|
|
|
76
76
|
"./{src,stories,test}/**/*.{js,ts,tsx,jsx,mdx}": "yarn lint:staged"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@babel/core": "^7.22.20",
|
|
80
|
-
"@babel/helper-remap-async-to-generator": "^7.18.9",
|
|
81
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
82
|
-
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
83
|
-
"@babel/preset-react": "^7.24.1",
|
|
84
|
-
"@chromatic-com/storybook": "^1.2.25",
|
|
85
79
|
"@commitlint/cli": "^18.4.3",
|
|
86
80
|
"@commitlint/config-conventional": "^18.4.3",
|
|
87
|
-
"@rollup/plugin-url": "^8.0.2",
|
|
88
81
|
"@storybook/addon-a11y": "^8.0.5",
|
|
89
82
|
"@storybook/addon-docs": "^8.0.5",
|
|
90
83
|
"@storybook/addon-essentials": "^8.0.5",
|
|
@@ -95,19 +88,15 @@
|
|
|
95
88
|
"@storybook/react": "^8.0.5",
|
|
96
89
|
"@storybook/react-vite": "^8.0.5",
|
|
97
90
|
"@storybook/test": "^8.0.5",
|
|
98
|
-
"@svgr/rollup": "^8.1.0",
|
|
99
91
|
"@testing-library/jest-dom": "^6.4.2",
|
|
100
92
|
"@testing-library/react": "^16",
|
|
101
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
102
93
|
"@types/is-number": "^7.0.3",
|
|
103
94
|
"@types/jest": "^29.5.12",
|
|
104
95
|
"@types/node": "^20.12.2",
|
|
105
96
|
"@types/react": "^18.2.75",
|
|
106
97
|
"@types/react-dom": "^18.2.24",
|
|
107
98
|
"@types/react-transition-group": "^4.4.10",
|
|
108
|
-
"
|
|
109
|
-
"babel-plugin-polyfill-corejs3": "^0.10.4",
|
|
110
|
-
"bootstrap-italia": "^2.8.8",
|
|
99
|
+
"bootstrap-italia": "^2.9.0",
|
|
111
100
|
"browserslist-config-design-italia": "^1.0.0",
|
|
112
101
|
"eslint": "^8.57.0",
|
|
113
102
|
"eslint-config-react-app": "^7.0.1",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React, { ElementType, FC, HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface ListProps extends HTMLAttributes<HTMLUListElement> {
|
|
5
|
+
/** Classi aggiuntive da usare per il componente lista del List */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Classi aggiuntive da usare per il componente wrapper del List */
|
|
8
|
+
wrapperClassName?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Utilizzarlo in caso di utilizzo di componenti personalizzati per il wrapper della lista.
|
|
11
|
+
* Nota: viene ignorato quando usato in lista annidate.
|
|
12
|
+
* */
|
|
13
|
+
tag?: ElementType;
|
|
14
|
+
/** Quando attivo rimuove il componente contenitore della ListList. Utile per alcuni tipi di liste annidate. */
|
|
15
|
+
noWrapper?: boolean;
|
|
16
|
+
testId?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const List: FC<ListProps> = ({
|
|
20
|
+
className,
|
|
21
|
+
wrapperClassName,
|
|
22
|
+
tag = 'div',
|
|
23
|
+
noWrapper,
|
|
24
|
+
testId,
|
|
25
|
+
...attributes
|
|
26
|
+
}) => {
|
|
27
|
+
const Tag = tag;
|
|
28
|
+
const wrapperClasses = classNames('it-list-wrapper', wrapperClassName);
|
|
29
|
+
const classes = classNames(className, 'it-list');
|
|
30
|
+
|
|
31
|
+
if (noWrapper) {
|
|
32
|
+
return <ul {...attributes} className={classes} data-testid={testId} />;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Tag className={wrapperClasses} data-testid={testId}>
|
|
37
|
+
<ul {...attributes} className={classes} />
|
|
38
|
+
</Tag>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React, { AnchorHTMLAttributes, ElementType, FC, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface ListItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
5
|
+
/** Indica se l'elemento è attivo o no */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
/** Indica se l'elemento ha un avatar */
|
|
8
|
+
avatar?: ReactNode;
|
|
9
|
+
/** Indica se l'elemento ha una icona */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Indica se l'elemento ha una immagine */
|
|
12
|
+
img?: ReactNode;
|
|
13
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
14
|
+
tag?: ElementType;
|
|
15
|
+
/** Classi aggiuntive da usare per il componente ListItem */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Classi aggiuntive da usare per l'elemento contenitore dell'item */
|
|
18
|
+
wrapperClassName?: string;
|
|
19
|
+
/** Indica il link a cui l'elemento deve puntare. */
|
|
20
|
+
href?: string;
|
|
21
|
+
/** Indica il link route a cui l'elemento deve puntare. */
|
|
22
|
+
to?: string;
|
|
23
|
+
testId?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const ListItem: FC<ListItemProps> & {
|
|
27
|
+
MultipleAction: typeof MultipleAction;
|
|
28
|
+
} = ({
|
|
29
|
+
className,
|
|
30
|
+
active,
|
|
31
|
+
avatar,
|
|
32
|
+
icon,
|
|
33
|
+
img,
|
|
34
|
+
href,
|
|
35
|
+
tag = 'div',
|
|
36
|
+
to,
|
|
37
|
+
wrapperClassName,
|
|
38
|
+
testId,
|
|
39
|
+
children,
|
|
40
|
+
...attributes
|
|
41
|
+
}) => {
|
|
42
|
+
let Tag = tag;
|
|
43
|
+
const classes = classNames(
|
|
44
|
+
className,
|
|
45
|
+
{ active },
|
|
46
|
+
'list-item'
|
|
47
|
+
),
|
|
48
|
+
classesItem = classNames(className, {
|
|
49
|
+
'it-rounded-icon': icon,
|
|
50
|
+
'avatar size-lg': avatar,
|
|
51
|
+
'it-thumb': img
|
|
52
|
+
}),
|
|
53
|
+
leftItem = icon || avatar || img;
|
|
54
|
+
|
|
55
|
+
if (href) {
|
|
56
|
+
return (
|
|
57
|
+
<li className={wrapperClassName} data-testid={testId}>
|
|
58
|
+
<Tag>
|
|
59
|
+
<a href={href || '#'} {...attributes} className={classes}>
|
|
60
|
+
{children}
|
|
61
|
+
</a>
|
|
62
|
+
</Tag>
|
|
63
|
+
</li>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<li className={wrapperClassName} data-testid={testId}>
|
|
69
|
+
<Tag
|
|
70
|
+
{...attributes}
|
|
71
|
+
className={classes}
|
|
72
|
+
href={href}
|
|
73
|
+
to={to}
|
|
74
|
+
>
|
|
75
|
+
{leftItem && <div className={classesItem}>{leftItem}</div>}
|
|
76
|
+
<div className="it-right-zone">{children}</div>
|
|
77
|
+
</Tag>
|
|
78
|
+
</li>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const MultipleAction: FC<ListItemProps> = ({ children }) => {
|
|
83
|
+
return <span className='it-multiple'>{children}</span>
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
ListItem.MultipleAction = MultipleAction;
|
package/src/index.ts
CHANGED
|
@@ -96,10 +96,10 @@ export { HeaderBrand } from './Header/HeaderBrand';
|
|
|
96
96
|
export { HeaderContent } from './Header/HeaderContent';
|
|
97
97
|
export { HeaderLinkZone } from './Header/HeaderLinkZone';
|
|
98
98
|
export { HeaderRightZone } from './Header/HeaderRightZone';
|
|
99
|
+
export { Headers } from './Header/Headers';
|
|
99
100
|
export { HeaderSearch } from './Header/HeaderSearch';
|
|
100
101
|
export { HeaderSocialsZone } from './Header/HeaderSocialsZone';
|
|
101
102
|
export { HeaderToggler } from './Header/HeaderToggler';
|
|
102
|
-
export { Headers } from './Header/Headers';
|
|
103
103
|
export { Hero, HeroBackground, HeroBody, HeroButton, HeroCategory, HeroTitle } from './Hero/index';
|
|
104
104
|
export { Icon, clearIconCache, iconsList as icons, preloadIcons } from './Icon/Icon';
|
|
105
105
|
export { Input } from './Input/Input';
|
|
@@ -107,6 +107,8 @@ export { InputContainer } from './Input/InputContainer';
|
|
|
107
107
|
export { TextArea } from './Input/TextArea';
|
|
108
108
|
export { LinkList } from './LinkList/LinkList';
|
|
109
109
|
export { LinkListItem } from './LinkList/LinkListItem';
|
|
110
|
+
export { List } from './List/List';
|
|
111
|
+
export { ListItem } from './List/ListItem';
|
|
110
112
|
export { MegamenuFooter } from './Megamenu/MegamenuFooter';
|
|
111
113
|
export { MegamenuHighlightColumn } from './Megamenu/MegamenuHighlightColumn';
|
|
112
114
|
export { MegamenuItem } from './Megamenu/MegamenuItem';
|
|
@@ -193,10 +195,10 @@ export type { HeaderBrandProps } from './Header/HeaderBrand';
|
|
|
193
195
|
export type { HeaderContentProps } from './Header/HeaderContent';
|
|
194
196
|
export type { HeaderLinkZoneProps } from './Header/HeaderLinkZone';
|
|
195
197
|
export type { HeaderRightZoneProps } from './Header/HeaderRightZone';
|
|
198
|
+
export type { HeadersProps } from './Header/Headers';
|
|
196
199
|
export type { HeaderSearchProps } from './Header/HeaderSearch';
|
|
197
200
|
export type { HeaderSocialsZoneProps } from './Header/HeaderSocialsZone';
|
|
198
201
|
export type { HeaderTogglerProps } from './Header/HeaderToggler';
|
|
199
|
-
export type { HeadersProps } from './Header/Headers';
|
|
200
202
|
export type {
|
|
201
203
|
HeroBackgroundProps,
|
|
202
204
|
HeroBodyProps,
|
|
@@ -211,6 +213,8 @@ export type { InputContainerProps } from './Input/InputContainer';
|
|
|
211
213
|
export type { TextAreaProps } from './Input/TextArea';
|
|
212
214
|
export type { LinkListProps } from './LinkList/LinkList';
|
|
213
215
|
export type { LinkListItemProps } from './LinkList/LinkListItem';
|
|
216
|
+
export type { ListProps } from './List/List';
|
|
217
|
+
export type { ListItemProps } from './List/ListItem';
|
|
214
218
|
export type { MegamenuFooterProps } from './Megamenu/MegamenuFooter';
|
|
215
219
|
export type { MegamenuHCProps } from './Megamenu/MegamenuHighlightColumn';
|
|
216
220
|
export type { MegamenuItemProps } from './Megamenu/MegamenuItem';
|