@teambit/design.buttons.button-link 0.0.15 → 0.0.17

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 CHANGED
@@ -12,9 +12,9 @@ export type ButtonLinkProps = {
12
12
  } & IconButtonProps;
13
13
 
14
14
  export function ButtonLink({ linkProps, ...rest }: ButtonLinkProps) {
15
- const linkClassName = linkProps?.className;
15
+ const { className, ...linkRest } = linkProps;
16
16
  return (
17
- <Link {...linkProps} className={classNames(styles.link, linkClassName)}>
17
+ <Link {...linkRest} className={classNames(styles.link, className)}>
18
18
  <IconButton {...rest} />
19
19
  </Link>
20
20
  );
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
- export declare const ButtonLinkWithImage: () => JSX.Element;
3
- export declare const ButtonLinkWithIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const ButtonLinkWithImage: () => React.JSX.Element;
3
+ export declare const ButtonLinkWithIcon: () => React.JSX.Element;
@@ -1,18 +1,10 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
1
+ import React from 'react';
2
+ import { Icon } from '@teambit/design.elements.icon';
3
+ import { ButtonLink } from './button-link';
4
+ export const ButtonLinkWithImage = () => {
5
+ return (React.createElement(ButtonLink, { linkProps: { external: true, href: 'https://bit.cloud/teambit' }, icon: React.createElement("img", { src: "https://static.bit.cloud/bit-icons/setting.svg" }) }, "Settings"));
4
6
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ButtonLinkWithIcon = exports.ButtonLinkWithImage = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const design_elements_icon_1 = require("@teambit/design.elements.icon");
9
- const button_link_1 = require("./button-link");
10
- const ButtonLinkWithImage = () => {
11
- return (react_1.default.createElement(button_link_1.ButtonLink, { linkProps: { external: true, href: 'https://bit.cloud/teambit' }, icon: react_1.default.createElement("img", { src: "https://static.bit.cloud/bit-icons/setting.svg" }) }, "Settings"));
7
+ export const ButtonLinkWithIcon = () => {
8
+ return (React.createElement(ButtonLink, { linkProps: { external: true, href: 'https://bit.cloud/teambit' }, icon: React.createElement(Icon, { of: "settings" }) }, "Settings"));
12
9
  };
13
- exports.ButtonLinkWithImage = ButtonLinkWithImage;
14
- const ButtonLinkWithIcon = () => {
15
- return (react_1.default.createElement(button_link_1.ButtonLink, { linkProps: { external: true, href: 'https://bit.cloud/teambit' }, icon: react_1.default.createElement(design_elements_icon_1.Icon, { of: "settings" }) }, "Settings"));
16
- };
17
- exports.ButtonLinkWithIcon = ButtonLinkWithIcon;
18
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":";;;;;;AAAA,kDAA0B;AAC1B,wEAAqD;AACrD,+CAA2C;AAEpC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,OAAO,CACL,8BAAC,wBAAU,IACT,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,EAChE,IAAI,EAAE,uCAAK,GAAG,EAAC,gDAAgD,GAAG,eAGvD,CACd,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,mBAAmB,uBAS9B;AAEK,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CACL,8BAAC,wBAAU,IAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,EAAE,IAAI,EAAE,8BAAC,2BAAI,IAAC,EAAE,EAAC,UAAU,GAAG,eAE7F,CACd,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B"}
1
+ {"version":3,"file":"button-link.composition.js","sourceRoot":"","sources":["../button-link.composition.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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,oBAAC,UAAU,IACT,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,EAChE,IAAI,EAAE,6BAAK,GAAG,EAAC,gDAAgD,GAAG,eAGvD,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CACL,oBAAC,UAAU,IAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,EAAE,IAAI,EAAE,oBAAC,IAAI,IAAC,EAAE,EAAC,UAAU,GAAG,eAE7F,CACd,CAAC;AACJ,CAAC,CAAC"}
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { LinkProps } from '@teambit/base-react.navigation.link';
3
3
  import { IconButtonProps } from '@teambit/design.ui.icon-button';
4
- export declare type ButtonLinkProps = {
4
+ export type ButtonLinkProps = {
5
5
  /**
6
6
  * link props.
7
7
  */
8
8
  linkProps?: LinkProps;
9
9
  } & IconButtonProps;
10
- export declare function ButtonLink({ linkProps, ...rest }: ButtonLinkProps): JSX.Element;
10
+ export declare function ButtonLink({ linkProps, ...rest }: ButtonLinkProps): React.JSX.Element;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __rest = (this && this.__rest) || function (s, e) {
3
2
  var t = {};
4
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -10,21 +9,15 @@ var __rest = (this && this.__rest) || function (s, e) {
10
9
  }
11
10
  return t;
12
11
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ButtonLink = void 0;
18
- const react_1 = __importDefault(require("react"));
19
- const classnames_1 = __importDefault(require("classnames"));
20
- const base_react_navigation_link_1 = require("@teambit/base-react.navigation.link");
21
- const design_ui_icon_button_1 = require("@teambit/design.ui.icon-button");
22
- const button_link_module_scss_1 = __importDefault(require("./button-link.module.scss"));
23
- function ButtonLink(_a) {
12
+ import React from 'react';
13
+ import classNames from 'classnames';
14
+ import { Link } from '@teambit/base-react.navigation.link';
15
+ import { IconButton } from '@teambit/design.ui.icon-button';
16
+ import styles from './button-link.module.scss';
17
+ export function ButtonLink(_a) {
24
18
  var { linkProps } = _a, rest = __rest(_a, ["linkProps"]);
25
- const linkClassName = linkProps === null || linkProps === void 0 ? void 0 : linkProps.className;
26
- return (react_1.default.createElement(base_react_navigation_link_1.Link, Object.assign({}, linkProps, { className: (0, classnames_1.default)(button_link_module_scss_1.default.link, linkClassName) }),
27
- react_1.default.createElement(design_ui_icon_button_1.IconButton, Object.assign({}, rest))));
19
+ const { className } = linkProps, linkRest = __rest(linkProps, ["className"]);
20
+ return (React.createElement(Link, Object.assign({}, linkRest, { className: classNames(styles.link, className) }),
21
+ React.createElement(IconButton, Object.assign({}, rest))));
28
22
  }
29
- exports.ButtonLink = ButtonLink;
30
23
  //# sourceMappingURL=button-link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-link.js","sourceRoot":"","sources":["../button-link.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAAoC;AACpC,oFAAsE;AACtE,0EAA6E;AAC7E,wFAA+C;AAS/C,SAAgB,UAAU,CAAC,EAAuC;QAAvC,EAAE,SAAS,OAA4B,EAAvB,IAAI,cAApB,aAAsB,CAAF;IAC7C,MAAM,aAAa,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,CAAC;IAC3C,OAAO,CACL,8BAAC,iCAAI,oBAAK,SAAS,IAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,iCAAM,CAAC,IAAI,EAAE,aAAa,CAAC;QACpE,8BAAC,kCAAU,oBAAK,IAAI,EAAI,CACnB,CACR,CAAC;AACJ,CAAC;AAPD,gCAOC"}
1
+ {"version":3,"file":"button-link.js","sourceRoot":"","sources":["../button-link.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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,EAAE,SAAS,KAAkB,SAAS,EAAtB,QAAQ,UAAK,SAAS,EAAtC,aAA0B,CAAY,CAAC;IAC7C,OAAO,CACL,oBAAC,IAAI,oBAAK,QAAQ,IAAE,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;QAC/D,oBAAC,UAAU,oBAAK,IAAI,EAAI,CACnB,CACR,CAAC;AACJ,CAAC"}
@@ -1,18 +1,13 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const react_2 = require("@testing-library/react");
8
- const button_link_composition_1 = require("./button-link.composition");
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import { ButtonLinkWithImage } from './button-link.composition';
9
4
  it('should render with the correct text', () => {
10
- const { getByText } = (0, react_2.render)(react_1.default.createElement(button_link_composition_1.ButtonLinkWithImage, null));
5
+ const { getByText } = render(React.createElement(ButtonLinkWithImage, null));
11
6
  const rendered = getByText('Settings');
12
7
  expect(rendered).toBeTruthy();
13
8
  });
14
9
  it('should render with image tag', () => {
15
- const { container } = (0, react_2.render)(react_1.default.createElement(button_link_composition_1.ButtonLinkWithImage, null));
10
+ const { container } = render(React.createElement(ButtonLinkWithImage, null));
16
11
  expect(container.getElementsByTagName('img').length).toBe(1);
17
12
  });
18
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":";;;;;AAAA,kDAA0B;AAC1B,kDAAgD;AAChD,uEAAgE;AAEhE,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;IAC7C,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,cAAM,EAAC,8BAAC,6CAAmB,OAAG,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,IAAA,cAAM,EAAC,8BAAC,6CAAmB,OAAG,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"}
1
+ {"version":3,"file":"button-link.spec.js","sourceRoot":"","sources":["../button-link.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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,oBAAC,mBAAmB,OAAG,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,oBAAC,mBAAmB,OAAG,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/dist/index.js CHANGED
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ButtonLink = void 0;
4
- var button_link_1 = require("./button-link");
5
- Object.defineProperty(exports, "ButtonLink", { enumerable: true, get: function () { return button_link_1.ButtonLink; } });
1
+ export { ButtonLink } from './button-link';
6
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAAlC,yGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,33 +1,35 @@
1
1
  {
2
2
  "name": "@teambit/design.buttons.button-link",
3
- "version": "0.0.15",
4
- "homepage": "https://bit.dev/teambit/design/buttons/button-link",
3
+ "version": "0.0.17",
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.15"
9
+ "version": "0.0.17"
10
10
  },
11
11
  "dependencies": {
12
12
  "classnames": "2.3.1",
13
13
  "core-js": "^3.0.0",
14
- "@teambit/base-react.navigation.link": "2.0.27",
15
- "@teambit/design.ui.icon-button": "1.1.17"
14
+ "@teambit/design.ui.icon-button": "1.1.28",
15
+ "@teambit/base-react.navigation.link": "2.0.27"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/react": "^17.0.8",
19
- "@testing-library/react": "11.2.2",
20
- "@types/testing-library__jest-dom": "5.9.5",
21
- "@babel/runtime": "7.20.0",
22
- "@types/jest": "^26.0.0",
23
- "@types/react-dom": "^17.0.5",
24
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",
25
24
  "@teambit/design.elements.icon": "1.0.24",
26
- "@teambit/design.envs.react": "2.0.10"
25
+ "@teambit/community.envs.community-react": "2.1.14"
27
26
  },
28
27
  "peerDependencies": {
28
+ "@testing-library/react": "^12.1.5",
29
29
  "react": "^16.8.0 || ^17.0.0"
30
30
  },
31
- "license": "SEE LICENSE IN LICENSE",
31
+ "license": "SEE LICENSE IN UNLICENSED",
32
+ "optionalDependencies": {},
33
+ "peerDependenciesMeta": {},
32
34
  "private": false
33
- }
35
+ }
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": [
4
- "es2019",
5
- "DOM",
6
- "ES6",
7
- "DOM.Iterable"
8
- ],
9
- "target": "es2015",
10
- "module": "CommonJS",
11
- "jsx": "react",
12
- "allowJs": true,
13
- "composite": true,
14
- "declaration": true,
15
- "sourceMap": true,
16
- "skipLibCheck": true,
17
- "experimentalDecorators": true,
18
- "outDir": "dist",
19
- "moduleResolution": "node",
20
- "esModuleInterop": true,
21
- "rootDir": ".",
22
- "resolveJsonModule": true
23
- },
24
- "exclude": [
25
- "dist",
26
- "package.json"
27
- ],
28
- "include": [
29
- "**/*",
30
- "**/*.json"
31
- ]
32
- }
@@ -1,7 +0,0 @@
1
- import * as compositions_0 from '/Users/yoshuakuttler/Library/Caches/Bit/capsules/9ef7c8a91102326f83259a520cf828d4bf50a645/teambit.design_buttons_button-link@0.0.15/dist/button-link.composition.js';
2
- import * as overview_0 from '/Users/yoshuakuttler/Library/Caches/Bit/capsules/9ef7c8a91102326f83259a520cf828d4bf50a645/teambit.design_buttons_button-link@0.0.15/dist/button-link.docs.mdx';
3
-
4
- export const compositions = [compositions_0];
5
- export const overview = [overview_0];
6
-
7
- export const compositions_metadata = {"compositions":[{"displayName":"Button link with image","identifier":"ButtonLinkWithImage"},{"displayName":"Button link with icon","identifier":"ButtonLinkWithIcon"}]};
package/tsconfig.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": [
4
- "es2019",
5
- "DOM",
6
- "ES6",
7
- "DOM.Iterable"
8
- ],
9
- "target": "es2015",
10
- "module": "CommonJS",
11
- "jsx": "react",
12
- "allowJs": true,
13
- "composite": true,
14
- "declaration": true,
15
- "sourceMap": true,
16
- "skipLibCheck": true,
17
- "experimentalDecorators": true,
18
- "outDir": "dist",
19
- "moduleResolution": "node",
20
- "esModuleInterop": true,
21
- "rootDir": ".",
22
- "resolveJsonModule": true
23
- },
24
- "exclude": [
25
- "dist",
26
- "package.json"
27
- ],
28
- "include": [
29
- "**/*",
30
- "**/*.json"
31
- ]
32
- }
package/types/asset.d.ts DELETED
@@ -1,29 +0,0 @@
1
- declare module '*.png' {
2
- const value: any;
3
- export = value;
4
- }
5
- declare module '*.svg' {
6
- import type { FunctionComponent, SVGProps } from 'react';
7
-
8
- export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
9
- const src: string;
10
- export default src;
11
- }
12
-
13
- // @TODO Gilad
14
- declare module '*.jpg' {
15
- const value: any;
16
- export = value;
17
- }
18
- declare module '*.jpeg' {
19
- const value: any;
20
- export = value;
21
- }
22
- declare module '*.gif' {
23
- const value: any;
24
- export = value;
25
- }
26
- declare module '*.bmp' {
27
- const value: any;
28
- export = value;
29
- }
package/types/style.d.ts DELETED
@@ -1,42 +0,0 @@
1
- declare module '*.module.css' {
2
- const classes: { readonly [key: string]: string };
3
- export default classes;
4
- }
5
- declare module '*.module.scss' {
6
- const classes: { readonly [key: string]: string };
7
- export default classes;
8
- }
9
- declare module '*.module.sass' {
10
- const classes: { readonly [key: string]: string };
11
- export default classes;
12
- }
13
-
14
- declare module '*.module.less' {
15
- const classes: { readonly [key: string]: string };
16
- export default classes;
17
- }
18
-
19
- declare module '*.less' {
20
- const classes: { readonly [key: string]: string };
21
- export default classes;
22
- }
23
-
24
- declare module '*.css' {
25
- const classes: { readonly [key: string]: string };
26
- export default classes;
27
- }
28
-
29
- declare module '*.sass' {
30
- const classes: { readonly [key: string]: string };
31
- export default classes;
32
- }
33
-
34
- declare module '*.scss' {
35
- const classes: { readonly [key: string]: string };
36
- export default classes;
37
- }
38
-
39
- declare module '*.mdx' {
40
- const component: any;
41
- export default component;
42
- }