@bigbinary/neeto-github-frontend 1.0.26 → 1.0.28

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useRef } from 'react';
2
- import classNames from 'classnames';
2
+ import classnames from 'classnames';
3
3
  import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
4
4
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
5
5
  import { Trans, useTranslation } from 'react-i18next';
@@ -8,9 +8,9 @@ import { useQuery } from 'react-query';
8
8
  import axios from 'axios';
9
9
  import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
10
10
  import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
11
- import { Settings, Plus, Building, User, CannedResponses, Lock } from '@bigbinary/neeto-icons';
12
- import { Button, Typography, Pane } from '@bigbinary/neetoui';
13
11
  import { Github } from '@bigbinary/neeto-icons/misc';
12
+ import { Typography, Button, Avatar, Pane } from '@bigbinary/neetoui';
13
+ import { Settings, Plus, Building, Lock } from '@bigbinary/neeto-icons';
14
14
  import { isPresent, findBy, noop } from '@bigbinary/neeto-cist';
15
15
  import Search from '@bigbinary/neeto-molecules/Search';
16
16
  import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
@@ -97,38 +97,45 @@ var useFetchGithubRepositories = function useFetchGithubRepositories(_ref) {
97
97
  }));
98
98
  };
99
99
 
100
+ var Header = withT(function (_ref) {
101
+ var t = _ref.t;
102
+ return /*#__PURE__*/React.createElement("div", {
103
+ className: "neeto-ui-text-gray-800 mb-1 flex w-full flex-row items-center space-x-2 font-sans text-lg font-medium leading-6 antialiased"
104
+ }, /*#__PURE__*/React.createElement(Github, {
105
+ size: 16
106
+ }), /*#__PURE__*/React.createElement(Typography, {
107
+ style: "h4"
108
+ }, t("neetoGithub.github")));
109
+ });
110
+
100
111
  var Configure = withT(function (_ref) {
101
112
  var t = _ref.t,
102
113
  isConnected = _ref.isConnected,
103
114
  installationUrl = _ref.installationUrl;
104
115
  return /*#__PURE__*/React.createElement("div", {
105
- className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
116
+ className: "neeto-ui-text-gray-900 flex-shrink-0 font-sans text-sm font-normal leading-6 antialiased"
106
117
  }, /*#__PURE__*/React.createElement(Button, {
107
- className: "mt-1 text-indigo-600 xl:mt-3",
108
118
  href: installationUrl,
109
119
  icon: isConnected ? Settings : Plus,
110
120
  iconPosition: "left",
111
121
  iconSize: 20,
112
122
  size: "small",
113
- style: "text"
123
+ style: "link"
114
124
  }, isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")));
115
125
  });
116
126
 
117
- var Header = withT(function (_ref) {
118
- var t = _ref.t;
119
- return /*#__PURE__*/React.createElement("div", {
120
- className: "neeto-ui-text-gray-800 mb-1 flex w-full flex-row items-center space-x-2 font-sans text-lg font-medium leading-6 antialiased"
121
- }, /*#__PURE__*/React.createElement(Github, {
122
- size: 16
123
- }), /*#__PURE__*/React.createElement(Typography, {
124
- style: "h4"
125
- }, t("neetoGithub.github")));
126
- });
127
-
128
127
  var List$1 = withT(function (_ref) {
129
128
  var t = _ref.t,
130
- accounts = _ref.accounts;
131
- return accounts.map(function (_ref2) {
129
+ accounts = _ref.accounts,
130
+ isConnected = _ref.isConnected,
131
+ installationUrl = _ref.installationUrl,
132
+ isPane = _ref.isPane;
133
+ return /*#__PURE__*/React.createElement("div", {
134
+ className: classnames("neeto-ui-border-gray-300 flex justify-between gap-3 border-b pb-4 pt-2", {
135
+ "flex-col md:flex-row": isPane,
136
+ "flex-col": !isPane
137
+ })
138
+ }, accounts.map(function (_ref2) {
132
139
  var id = _ref2.id,
133
140
  name = _ref2.name,
134
141
  avatarUrl = _ref2.avatarUrl,
@@ -136,41 +143,40 @@ var List$1 = withT(function (_ref) {
136
143
  profileUrl = _ref2.profileUrl,
137
144
  count = _ref2.count;
138
145
  return /*#__PURE__*/React.createElement("div", {
139
- className: "neeto-ui-border-gray-300 flex w-full items-center space-x-2 border-b border-l-0 border-r-0 border-t-0 border-solid p-2",
146
+ className: "flex w-full items-center space-x-2",
140
147
  key: id
148
+ }, /*#__PURE__*/React.createElement("div", {
149
+ className: "flex items-center gap-1"
141
150
  }, type === "Organization" ? /*#__PURE__*/React.createElement(Building, {
142
151
  className: "neeto-ui-text-gray-600",
143
- size: 16
144
- }) : /*#__PURE__*/React.createElement(User, {
145
- className: "neeto-ui-text-gray-600",
146
- size: 16
152
+ size: 24
153
+ }) : /*#__PURE__*/React.createElement(Avatar, {
154
+ size: "small",
155
+ user: {
156
+ imageUrl: avatarUrl
157
+ }
147
158
  }), /*#__PURE__*/React.createElement(Typography, {
148
- className: "neeto-ui-text-gray-900",
159
+ className: "neeto-ui-text-gray-800",
149
160
  style: "body2"
150
- }, "@", name), /*#__PURE__*/React.createElement("img", {
151
- alt: name,
152
- className: "neeto-ui-rounded-full h-4 w-4",
153
- src: avatarUrl
154
- }), /*#__PURE__*/React.createElement(Button, {
155
- className: "text-indigo-600",
156
- icon: CannedResponses,
157
- iconPosition: "left",
158
- iconSize: 16,
159
- size: "small",
160
- style: "text",
161
+ }, /*#__PURE__*/React.createElement(Button, {
162
+ className: "neeto-ui-text-gray-800",
163
+ label: "@".concat(name),
164
+ style: "link",
161
165
  onClick: function onClick() {
162
166
  return window.open(profileUrl, "_blank");
163
167
  }
168
+ }))), /*#__PURE__*/React.createElement("span", {
169
+ className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
164
170
  }), /*#__PURE__*/React.createElement(Typography, {
165
- className: "neeto-ui-text-gray-900 mx-2 text-lg",
166
- component: "span",
167
- style: "h2"
168
- }, "\u2022"), /*#__PURE__*/React.createElement(Typography, {
171
+ className: "neeto-ui-text-black",
169
172
  style: "body2"
170
173
  }, t("neetoGithub.countOf.repos", {
171
174
  count: count
172
175
  })));
173
- });
176
+ }), /*#__PURE__*/React.createElement(Configure, {
177
+ installationUrl: installationUrl,
178
+ isConnected: isConnected
179
+ }));
174
180
  });
175
181
 
176
182
  var Accounts = function Accounts(_ref) {
@@ -180,18 +186,17 @@ var Accounts = function Accounts(_ref) {
180
186
  onConnect = _ref.onConnect,
181
187
  installationUrl = _ref.installationUrl;
182
188
  return /*#__PURE__*/React.createElement("div", {
183
- className: classNames("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
184
- "2xl:max-w-sm 2xl:px-8": isPane,
185
- "xl:max-w-sm xl:px-8": !isPane
189
+ className: classnames("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
190
+ "order-1": isPane,
191
+ "md:order-2 md:max-w-72 lg:max-w-sm lg:px-6": !isPane
186
192
  })
187
193
  }, /*#__PURE__*/React.createElement("div", {
188
194
  className: "mb-2"
189
195
  }, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(List$1, {
190
196
  accounts: accounts,
191
- isConnected: isConnected
192
- }), /*#__PURE__*/React.createElement(Configure, {
193
197
  installationUrl: installationUrl,
194
198
  isConnected: isConnected,
199
+ isPane: isPane,
195
200
  onConnect: onConnect
196
201
  })));
197
202
  };
@@ -298,25 +303,26 @@ var RepositoryTile = function RepositoryTile(_ref) {
298
303
  isPrivate = repository.isPrivate,
299
304
  updatedAt = repository.updatedAt;
300
305
  return /*#__PURE__*/React.createElement("div", {
301
- className: "neeto-ui-border-gray-300 flex items-center justify-between border-b border-solid py-3 pl-5 pr-3 last:border-b-0",
306
+ className: "neeto-ui-border-gray-300 flex flex-col justify-between gap-3 border-b border-solid py-3 pl-3 pr-3 last:border-b-0 md:flex-row md:items-center md:pl-5",
302
307
  key: id
303
308
  }, /*#__PURE__*/React.createElement("div", {
304
309
  className: "width-calc flex items-center space-x-2"
305
310
  }, /*#__PURE__*/React.createElement(Github, {
311
+ className: "flex-shrink-0",
306
312
  size: 16
307
313
  }), /*#__PURE__*/React.createElement(Typography, {
308
314
  style: "body2"
309
315
  }, fullName), isPrivate && /*#__PURE__*/React.createElement(Lock, {
316
+ className: "flex-shrink-0",
310
317
  size: 16
311
318
  }), /*#__PURE__*/React.createElement("div", {
312
- className: "hidden md:inline-block"
313
- }, /*#__PURE__*/React.createElement(Typography, {
314
- className: "neeto-ui-text-gray-900 mr-2 text-lg",
315
- component: "span",
316
- style: "h2"
317
- }, "\u2022"), /*#__PURE__*/React.createElement(DateFormat.FromNow, {
319
+ className: "hidden lg:inline-block"
320
+ }, /*#__PURE__*/React.createElement("span", {
321
+ className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
322
+ }), /*#__PURE__*/React.createElement(DateFormat.FromNow, {
318
323
  date: updatedAt
319
324
  }))), /*#__PURE__*/React.createElement(Button, {
325
+ className: "w-max",
320
326
  disabled: isConnecting,
321
327
  loading: isLoading,
322
328
  style: "primary",
@@ -340,9 +346,9 @@ var List = withT(function (_ref) {
340
346
  installationUrl = _ref.installationUrl,
341
347
  troubleshootUrl = _ref.troubleshootUrl;
342
348
  return /*#__PURE__*/React.createElement("div", {
343
- className: "h-full overflow-y-scroll px-6 pb-6"
349
+ className: "h-full overflow-y-scroll px-4 pb-4 md:px-6 md:pb-6"
344
350
  }, isPresent(repositories) ? /*#__PURE__*/React.createElement("div", {
345
- className: classNames("neeto-ui-border-gray-300 neeto-ui-rounded-md flex flex-col items-center justify-center border", {
351
+ className: classnames("neeto-ui-border-gray-300 neeto-ui-rounded-md flex flex-col items-center justify-center border", {
346
352
  "h-auto": isPresent(filteredRepositories),
347
353
  "h-full": !isPresent(filteredRepositories)
348
354
  })
@@ -410,7 +416,7 @@ var Private = function Private(_ref) {
410
416
  return /*#__PURE__*/React.createElement("div", {
411
417
  className: "connect-repo flex h-full flex-col"
412
418
  }, isConnected ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
413
- className: "space-y-3 p-6"
419
+ className: "space-y-3 p-4 md:p-6"
414
420
  }, /*#__PURE__*/React.createElement(Typography, {
415
421
  className: "flex-shrink-0 text-lg font-medium",
416
422
  style: "h2"
@@ -447,9 +453,13 @@ var Repositories = function Repositories(_ref) {
447
453
  repositories = _ref.repositories,
448
454
  onConnect = _ref.onConnect,
449
455
  installationUrl = _ref.installationUrl,
450
- troubleshootUrl = _ref.troubleshootUrl;
456
+ troubleshootUrl = _ref.troubleshootUrl,
457
+ isPane = _ref.isPane;
451
458
  return /*#__PURE__*/React.createElement("div", {
452
- className: "neeto-ui-rounded-md neeto-ui-border-gray-300 h-full w-full space-y-6 border border-solid"
459
+ className: classnames("neeto-ui-rounded-md neeto-ui-border-gray-300 h-full w-full space-y-6 border border-solid", {
460
+ "order-2": isPane,
461
+ "order-1": !isPane
462
+ })
453
463
  }, /*#__PURE__*/React.createElement(Private, {
454
464
  installationUrl: installationUrl,
455
465
  isConnected: isConnected,
@@ -500,23 +510,24 @@ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
500
510
  }));
501
511
  }
502
512
  return /*#__PURE__*/React.createElement("div", {
503
- className: classNames("flex min-h-0 w-full flex-grow flex-col-reverse", {
504
- "2xl:flex-row": isPane,
505
- "xl:flex-row": !isPane
513
+ className: classnames("flex min-h-0 w-full flex-grow flex-col", {
514
+ "flex-col": isPane,
515
+ "gap-3 md:flex-row md:gap-6": !isPane
506
516
  })
507
- }, /*#__PURE__*/React.createElement(Repositories, {
517
+ }, /*#__PURE__*/React.createElement(Accounts, {
518
+ accounts: accounts,
519
+ installationUrl: installationUrl,
520
+ isConnected: isConnected,
521
+ isPane: isPane,
522
+ onConnect: onConnect
523
+ }), /*#__PURE__*/React.createElement(Repositories, {
508
524
  installationUrl: installationUrl,
509
525
  isConnected: isConnected,
510
526
  isConnecting: isConnecting,
527
+ isPane: isPane,
511
528
  onConnect: onConnect,
512
529
  repositories: repositories,
513
530
  troubleshootUrl: troubleshootUrl
514
- }), /*#__PURE__*/React.createElement(Accounts, {
515
- accounts: accounts,
516
- installationUrl: installationUrl,
517
- isConnected: isConnected,
518
- isPane: isPane,
519
- onConnect: onConnect
520
531
  }));
521
532
  };
522
533
 
@@ -2833,7 +2844,7 @@ var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
2833
2844
 
2834
2845
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
2835
2846
 
2836
- var css = ".width-calc{width:calc(100% - 82px)}.neeto-github-modal-pane-wrapper{width:min(75%,1280px)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlcG9zaXRvcnktdGlsZS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3BhbmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUNFLHVCQ0NGLENDRkEsaUNBQ0UscUJES0YiLCJzb3VyY2VzQ29udGVudCI6WyIud2lkdGgtY2FsYyB7XG4gIHdpZHRoOiBjYWxjKDEwMCUgLSA4MnB4KTtcbn1cbiIsIi53aWR0aC1jYWxjIHtcbiAgd2lkdGg6IGNhbGMoMTAwJSAtIDgycHgpO1xufVxuXG4ubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oNzUlLCAxMjgwcHgpO1xufSIsIi5uZWV0by1naXRodWItbW9kYWwtcGFuZS13cmFwcGVyIHtcbiAgd2lkdGg6IG1pbig3NSUsIDEyODBweCk7XG59XG4iXX0= */";
2847
+ var css = ".width-calc{width:100%}@media (min-width:768px){.width-calc{width:calc(100% - 82px)}}.neeto-github-modal-pane-wrapper{width:min(100%,1280px)}@media (min-width:768px){.neeto-github-modal-pane-wrapper{width:min(90%,1280px)}}@media (min-width:1024px){.neeto-github-modal-pane-wrapper{width:min(60%,1280px)}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlcG9zaXRvcnktdGlsZS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3BhbmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUNFLFVDQ0YsQ0RDRSx5QkFIRixZQUlJLHVCQ0VGLENBQ0YsQ0NQQSxpQ0FDRSxzQkRVRixDQ1JFLHlCQUhGLGlDQUlJLHFCRFdGLENBQ0YsQ0NURSwwQkFQRixpQ0FRSSxxQkRZRixDQUNGIiwic291cmNlc0NvbnRlbnQiOlsiLndpZHRoLWNhbGMge1xuICB3aWR0aDogMTAwJTtcblxuICBAc2NyZWVuIG1kIHtcbiAgICB3aWR0aDogY2FsYygxMDAlIC0gODJweCk7XG4gIH1cbn1cbiIsIi53aWR0aC1jYWxjIHtcbiAgd2lkdGg6IDEwMCU7XG59XG5Ac2NyZWVuIG1kIHtcbiAgLndpZHRoLWNhbGMge1xuICAgIHdpZHRoOiBjYWxjKDEwMCUgLSA4MnB4KTtcbiAgfVxufVxuXG4ubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oMTAwJSwgMTI4MHB4KTtcbn1cbkBzY3JlZW4gbWQge1xuICAubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gICAgd2lkdGg6IG1pbig5MCUsIDEyODBweCk7XG4gIH1cbn1cbkBzY3JlZW4gbGcge1xuICAubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gICAgd2lkdGg6IG1pbig2MCUsIDEyODBweCk7XG4gIH1cbn0iLCIubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oMTAwJSwgMTI4MHB4KTtcblxuICBAc2NyZWVuIG1kIHtcbiAgICB3aWR0aDogbWluKDkwJSwgMTI4MHB4KTtcbiAgfVxuXG4gIEBzY3JlZW4gbGcge1xuICAgIHdpZHRoOiBtaW4oNjAlLCAxMjgwcHgpO1xuICB9XG59XG4iXX0= */";
2837
2848
  n(css,{});
2838
2849
 
2839
2850
  export { NeetoGithubNanoContainer, NeetoGithubNanoPane };