@teambit/design.buttons.button-link 0.0.17 → 0.0.19
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/button-link.tsx +1 -1
- package/dist/button-link.composition.js +3 -3
- package/dist/button-link.composition.js.map +1 -1
- package/dist/button-link.js +3 -4
- package/dist/button-link.js.map +1 -1
- package/dist/button-link.spec.js +3 -3
- package/dist/button-link.spec.js.map +1 -1
- package/package.json +7 -14
package/button-link.tsx
CHANGED
|
@@ -12,7 +12,7 @@ export type ButtonLinkProps = {
|
|
|
12
12
|
} & IconButtonProps;
|
|
13
13
|
|
|
14
14
|
export function ButtonLink({ linkProps, ...rest }: ButtonLinkProps) {
|
|
15
|
-
const { className, ...linkRest } = linkProps;
|
|
15
|
+
const { className, ...linkRest } = linkProps ?? {};
|
|
16
16
|
return (
|
|
17
17
|
<Link {...linkRest} className={classNames(styles.link, className)}>
|
|
18
18
|
<IconButton {...rest} />
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Icon } from '@teambit/design.elements.icon';
|
|
3
3
|
import { ButtonLink } from './button-link';
|
|
4
4
|
export const ButtonLinkWithImage = () => {
|
|
5
|
-
return (
|
|
5
|
+
return (_jsx(ButtonLink, { linkProps: { external: true, href: 'https://bit.cloud/teambit' }, icon: _jsx("img", { src: "https://static.bit.cloud/bit-icons/setting.svg" }), children: "Settings" }));
|
|
6
6
|
};
|
|
7
7
|
export const ButtonLinkWithIcon = () => {
|
|
8
|
-
return (
|
|
8
|
+
return (_jsx(ButtonLink, { linkProps: { external: true, href: 'https://bit.cloud/teambit' }, icon: _jsx(Icon, { of: "settings" }), children: "Settings" }));
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=button-link.composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-link.composition.js","sourceRoot":"","sources":["../button-link.composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-link.composition.js","sourceRoot":"","sources":["../button-link.composition.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,OAAO,CACL,KAAC,UAAU,IACT,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,EAChE,IAAI,EAAE,cAAK,GAAG,EAAC,gDAAgD,GAAG,yBAGvD,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CACL,KAAC,UAAU,IAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,EAAE,IAAI,EAAE,KAAC,IAAI,IAAC,EAAE,EAAC,UAAU,GAAG,yBAE7F,CACd,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/button-link.js
CHANGED
|
@@ -9,15 +9,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { Link } from '@teambit/base-react.navigation.link';
|
|
15
15
|
import { IconButton } from '@teambit/design.ui.icon-button';
|
|
16
16
|
import styles from './button-link.module.scss';
|
|
17
17
|
export function ButtonLink(_a) {
|
|
18
18
|
var { linkProps } = _a, rest = __rest(_a, ["linkProps"]);
|
|
19
|
-
const { className } =
|
|
20
|
-
return (
|
|
21
|
-
React.createElement(IconButton, Object.assign({}, rest))));
|
|
19
|
+
const _b = linkProps !== null && linkProps !== void 0 ? linkProps : {}, { className } = _b, linkRest = __rest(_b, ["className"]);
|
|
20
|
+
return (_jsx(Link, Object.assign({}, linkRest, { className: classNames(styles.link, className), children: _jsx(IconButton, Object.assign({}, rest)) })));
|
|
22
21
|
}
|
|
23
22
|
//# sourceMappingURL=button-link.js.map
|
package/dist/button-link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-link.js","sourceRoot":"","sources":["../button-link.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-link.js","sourceRoot":"","sources":["../button-link.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAa,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAmB,MAAM,gCAAgC,CAAC;AAC7E,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAS/C,MAAM,UAAU,UAAU,CAAC,EAAuC;QAAvC,EAAE,SAAS,OAA4B,EAAvB,IAAI,cAApB,aAAsB,CAAF;IAC7C,MAAM,KAA6B,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EAA5C,EAAE,SAAS,OAAiC,EAA5B,QAAQ,cAAxB,aAA0B,CAAkB,CAAC;IACnD,OAAO,CACL,KAAC,IAAI,oBAAK,QAAQ,IAAE,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,YAC/D,KAAC,UAAU,oBAAK,IAAI,EAAI,IACnB,CACR,CAAC;AACJ,CAAC"}
|
package/dist/button-link.spec.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { ButtonLinkWithImage } from './button-link.composition';
|
|
4
4
|
it('should render with the correct text', () => {
|
|
5
|
-
const { getByText } = render(
|
|
5
|
+
const { getByText } = render(_jsx(ButtonLinkWithImage, {}));
|
|
6
6
|
const rendered = getByText('Settings');
|
|
7
7
|
expect(rendered).toBeTruthy();
|
|
8
8
|
});
|
|
9
9
|
it('should render with image tag', () => {
|
|
10
|
-
const { container } = render(
|
|
10
|
+
const { container } = render(_jsx(ButtonLinkWithImage, {}));
|
|
11
11
|
expect(container.getElementsByTagName('img').length).toBe(1);
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=button-link.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-link.spec.js","sourceRoot":"","sources":["../button-link.spec.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-link.spec.js","sourceRoot":"","sources":["../button-link.spec.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;IAC7C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,KAAC,mBAAmB,KAAG,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IAEvC,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,CAAC;AAChC,CAAC,CAAC,CAAC;AACH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;IACtC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,KAAC,mBAAmB,KAAG,CAAC,CAAC;IAEtD,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/design.buttons.button-link",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/design/buttons/button-link",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.design",
|
|
8
8
|
"name": "buttons/button-link",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.19"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"classnames": "2.3.1",
|
|
13
|
-
"
|
|
14
|
-
"@teambit/design.ui.icon-button": "1.1.28",
|
|
15
|
-
"@teambit/base-react.navigation.link": "2.0.27"
|
|
13
|
+
"@teambit/design.ui.icon-button": "1.1.30"
|
|
16
14
|
},
|
|
17
15
|
"devDependencies": {
|
|
18
|
-
"@types/react": "^17.0.8",
|
|
19
|
-
"@types/node": "12.20.4",
|
|
20
|
-
"@types/react-dom": "^17.0.5",
|
|
21
|
-
"@types/jest": "^26.0.0",
|
|
22
|
-
"@babel/runtime": "7.20.0",
|
|
23
|
-
"@types/testing-library__jest-dom": "5.9.5",
|
|
24
16
|
"@teambit/design.elements.icon": "1.0.24",
|
|
25
|
-
"@teambit/
|
|
17
|
+
"@teambit/cloud.envs.cloud-react": "0.1.12"
|
|
26
18
|
},
|
|
27
19
|
"peerDependencies": {
|
|
28
|
-
"
|
|
29
|
-
"react": "^
|
|
20
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
21
|
+
"@testing-library/react": "^14.0.0",
|
|
22
|
+
"@teambit/base-react.navigation.link": "^2.0.33"
|
|
30
23
|
},
|
|
31
24
|
"license": "SEE LICENSE IN UNLICENSED",
|
|
32
25
|
"optionalDependencies": {},
|