design-react-kit 5.0.0-4 → 5.0.0-6
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/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +82 -60
- package/dist/esm/index.js.map +1 -1
- package/dist/types/GoBack/GoBack.d.ts +17 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +82 -58
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/GoBack/GoBack.tsx +39 -0
- package/src/Megamenu/Megamenu.tsx +1 -1
- package/src/index.tsx +2 -0
- /package/dist/types/{Megamenu → Collapse}/Collapse.d.ts +0 -0
- /package/src/{Megamenu → Collapse}/Collapse.tsx +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { ReactChild } from 'react';
|
|
2
|
+
import { Icon } from '../Icon/Icon';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { Button } from '../Button/Button';
|
|
5
|
+
|
|
6
|
+
export interface GoBackProps {
|
|
7
|
+
/**
|
|
8
|
+
* Optional classnames to pass to the element
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Render the link variant of the go back button
|
|
13
|
+
*/
|
|
14
|
+
link?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Render the up variant of the go back button
|
|
17
|
+
*/
|
|
18
|
+
up?: boolean;
|
|
19
|
+
children: ReactChild;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const goBack = () => {
|
|
23
|
+
window.history.back();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const GoBack = ({ className, link = false, up = false, children }: GoBackProps) => {
|
|
27
|
+
const Tag = link ? 'a' : Button;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Tag className={classNames(className, 'go-back')} color='primary' onClick={goBack}>
|
|
31
|
+
<Icon
|
|
32
|
+
className={children ? 'me-2' : ''}
|
|
33
|
+
color={link ? 'primary' : 'white'}
|
|
34
|
+
icon={up ? 'it-arrow-up' : 'it-arrow-left'}
|
|
35
|
+
/>
|
|
36
|
+
{children}
|
|
37
|
+
</Tag>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC, useState } from 'react';
|
|
2
2
|
import { Navbar, NavbarBrand, NavbarProps, NavbarToggler } from 'reactstrap';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { Collapse } from '
|
|
4
|
+
import { Collapse } from '../Collapse/Collapse';
|
|
5
5
|
import { Icon } from '../Icon/Icon';
|
|
6
6
|
import { Nav } from '../Nav/Nav';
|
|
7
7
|
|
package/src/index.tsx
CHANGED
|
@@ -87,6 +87,7 @@ export { CardTagsHeader } from './Card/CardTagsHeader';
|
|
|
87
87
|
export { CardSignature } from './Card/CardSignature';
|
|
88
88
|
export { CardFooterCTA } from './Card/CardFooterCTA';
|
|
89
89
|
export { CardReadMore } from './Card/CardReadMore';
|
|
90
|
+
export { Collapse } from './Collapse/Collapse';
|
|
90
91
|
export { GridItem, GridItemText, GridItemTextWrapper, GridList, GridRow } from './Grid/index';
|
|
91
92
|
export { Header } from './Header/Header';
|
|
92
93
|
export { Headers } from './Header/Headers';
|
|
@@ -102,6 +103,7 @@ export { Icon, iconsList as icons, preloadIcons, clearIconCache } from './Icon/I
|
|
|
102
103
|
export { Input } from './Input/Input';
|
|
103
104
|
export { InputContainer } from './Input/InputContainer';
|
|
104
105
|
export { TextArea } from './Input/TextArea';
|
|
106
|
+
export { GoBack } from './GoBack/GoBack';
|
|
105
107
|
export { LinkList } from './LinkList/LinkList';
|
|
106
108
|
export { LinkListItem } from './LinkList/LinkListItem';
|
|
107
109
|
export { Megamenu } from './Megamenu/Megamenu';
|
|
File without changes
|
|
File without changes
|