superdesk-ui-framework 3.0.1-beta.23 → 3.0.1-beta.25

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.
Files changed (63) hide show
  1. package/app/styles/components/_sd-comment-box.scss +8 -4
  2. package/app/styles/components/_sd-editor-popup.scss +4 -4
  3. package/app-typescript/components/Label.tsx +13 -1
  4. package/app-typescript/components/Lists/ContentList.tsx +31 -26
  5. package/dist/examples.bundle.js +18 -4
  6. package/dist/superdesk-ui.bundle.css +12 -8
  7. package/dist/superdesk-ui.bundle.js +17 -3
  8. package/package.json +1 -1
  9. package/react/components/Label.d.ts +1 -0
  10. package/react/components/Label.js +12 -2
  11. package/react/components/Lists/ContentList.d.ts +1 -0
  12. package/react/components/Lists/ContentList.js +5 -1
  13. package/.vscode/settings.json +0 -5
  14. package/app-typescript/dist/components/Alert.d.ts +0 -16
  15. package/app-typescript/dist/components/Autocomplete.d.ts +0 -48
  16. package/app-typescript/dist/components/Avatar.d.ts +0 -33
  17. package/app-typescript/dist/components/Badge.d.ts +0 -13
  18. package/app-typescript/dist/components/Button.d.ts +0 -23
  19. package/app-typescript/dist/components/ButtonGroup.d.ts +0 -12
  20. package/app-typescript/dist/components/CheckButtonGroup.d.ts +0 -11
  21. package/app-typescript/dist/components/CheckGroup.d.ts +0 -9
  22. package/app-typescript/dist/components/Checkbox.d.ts +0 -19
  23. package/app-typescript/dist/components/CheckboxButton.d.ts +0 -19
  24. package/app-typescript/dist/components/DatePicker.d.ts +0 -37
  25. package/app-typescript/dist/components/Divider.d.ts +0 -9
  26. package/app-typescript/dist/components/DonutChart.d.ts +0 -12
  27. package/app-typescript/dist/components/Dropdown.d.ts +0 -28
  28. package/app-typescript/dist/components/DropdownFirst.d.ts +0 -42
  29. package/app-typescript/dist/components/EmptyState.d.ts +0 -11
  30. package/app-typescript/dist/components/FormLabel.d.ts +0 -9
  31. package/app-typescript/dist/components/Genie.d.ts +0 -13
  32. package/app-typescript/dist/components/GridItem.d.ts +0 -69
  33. package/app-typescript/dist/components/GridList.d.ts +0 -14
  34. package/app-typescript/dist/components/HeadingText.d.ts +0 -10
  35. package/app-typescript/dist/components/HelloWorld.d.ts +0 -8
  36. package/app-typescript/dist/components/Icon.d.ts +0 -12
  37. package/app-typescript/dist/components/IconButton.d.ts +0 -12
  38. package/app-typescript/dist/components/IconLabel.d.ts +0 -11
  39. package/app-typescript/dist/components/Input.d.ts +0 -24
  40. package/app-typescript/dist/components/Label.d.ts +0 -15
  41. package/app-typescript/dist/components/LeftMenu.d.ts +0 -26
  42. package/app-typescript/dist/components/Loader.d.ts +0 -8
  43. package/app-typescript/dist/components/NavButton.d.ts +0 -15
  44. package/app-typescript/dist/components/Popover.d.ts +0 -13
  45. package/app-typescript/dist/components/PropsList.d.ts +0 -15
  46. package/app-typescript/dist/components/Radio.d.ts +0 -19
  47. package/app-typescript/dist/components/RadioButton.d.ts +0 -20
  48. package/app-typescript/dist/components/Select.d.ts +0 -29
  49. package/app-typescript/dist/components/SelectWithTemplate.d.ts +0 -32
  50. package/app-typescript/dist/components/SlidingToolbar.d.ts +0 -8
  51. package/app-typescript/dist/components/StrechBar.d.ts +0 -4
  52. package/app-typescript/dist/components/SubNav.d.ts +0 -10
  53. package/app-typescript/dist/components/Switch.d.ts +0 -12
  54. package/app-typescript/dist/components/TabCustom.d.ts +0 -25
  55. package/app-typescript/dist/components/TabList.d.ts +0 -22
  56. package/app-typescript/dist/components/Tag.d.ts +0 -9
  57. package/app-typescript/dist/components/TagInput.d.ts +0 -7
  58. package/app-typescript/dist/components/TagInputTest.d.ts +0 -18
  59. package/app-typescript/dist/components/TimePicker.d.ts +0 -11
  60. package/app-typescript/dist/components/Tooltip.d.ts +0 -11
  61. package/app-typescript/dist/components/_Positioner.d.ts +0 -27
  62. package/app-typescript/dist/index.d.ts +0 -56
  63. package/yarn-error.log +0 -111
@@ -1,11 +1,11 @@
1
1
  .comment-box__reply-item {
2
- border-bottom: 1px solid rgba(123,123,123,0.2);
2
+ border-bottom: 1px solid var(--sd-colour-line--light);
3
3
  }
4
4
 
5
5
  .comment-box__input {
6
6
  padding: 0.4rem;
7
- border-radius: $border-radius__base--x-small;
8
- border: 1px solid rgba(123,123,123,0.4);
7
+ border-radius: $border-radius__base--small;
8
+ border: 1px solid var(--sd-colour-line--light);
9
9
  height: 2.8rem;
10
10
  resize: none;
11
11
  }
@@ -13,7 +13,10 @@
13
13
  display: none;
14
14
  padding-top: 1rem;
15
15
  &--active {
16
- display: block;
16
+ display: flex;
17
+ justify-content: flex-end;
18
+ align-items: center;
19
+ gap: var(--gap--small);
17
20
  }
18
21
  }
19
22
  .comment-box__button-toolbar {
@@ -22,6 +25,7 @@
22
25
  flex-direction: row;
23
26
  align-items: center;
24
27
  justify-content: flex-start;
28
+ gap: var(--gap--small);
25
29
  &--right {
26
30
  justify-content: flex-end;
27
31
  }
@@ -17,11 +17,11 @@ $editor-popup-padding: 1.6rem;
17
17
 
18
18
  .editor-popup__main {
19
19
  display: flex;
20
- color: $sd-text;
20
+ color: var(--color-text);
21
21
  width: 32rem;
22
22
  max-height: 100%;
23
23
  &.editor-popup__main--floating {
24
- background-color: $white;
24
+ background-color: var(--color-dropdown-menu-Bg);
25
25
  z-index: 2;
26
26
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 3px 1px -2px rgba(0, 0, 0, 0.1);
27
27
  }
@@ -84,6 +84,6 @@ $editor-popup-padding: 1.6rem;
84
84
  }
85
85
 
86
86
  .editor-popup__secondary-content {
87
- background-color: rgba(123,123,123,0.1);
88
- border-top: 1px solid rgba(123,123,123,0.2);
87
+ background-color: hsla(214, 13%, 48%, 0.05);
88
+ border-top: 1px solid var(--sd-colour-line--light);
89
89
  }
@@ -66,7 +66,10 @@ export class Label extends React.PureComponent<IProps> {
66
66
  );
67
67
  } else {
68
68
  return (
69
- <span className={classes} style={{backgroundColor: this.props.hexColor}}>
69
+ <span className={classes}
70
+ style={this.props.hexColor
71
+ ? {backgroundColor: this.props.hexColor, color: getTextColor(this.props.hexColor)}
72
+ : undefined}>
70
73
  {this.props.text}
71
74
  </span>
72
75
  );
@@ -74,3 +77,12 @@ export class Label extends React.PureComponent<IProps> {
74
77
  }
75
78
  }
76
79
  }
80
+
81
+ export function getTextColor(backgroundColor: string): 'black' | 'white' {
82
+ const r = parseInt(backgroundColor.substr(1, 2), 16);
83
+ const g = parseInt(backgroundColor.substr(3, 2), 16);
84
+ const b = parseInt(backgroundColor.substr(5, 2), 16);
85
+ const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
86
+
87
+ return (yiq >= 128) ? 'black' : 'white';
88
+ }
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
  interface IPropsItem {
5
5
  action?: React.ReactNode;
6
6
  locked?: boolean;
7
- itemColum: Array<{itemRow: Array<{content: any}>, border?: boolean, fullwidth?: boolean}>;
7
+ itemColum: Array<{ itemRow: Array<{ content: any }>, border?: boolean, fullwidth?: boolean }>;
8
8
  activated?: boolean;
9
9
  selected?: boolean;
10
10
  archived?: boolean;
@@ -40,42 +40,47 @@ class ContentListItem extends React.PureComponent<IPropsItem> {
40
40
  }, this.delay);
41
41
  }
42
42
 
43
+ onActionMenuClick = (event: React.MouseEvent<HTMLElement>) => {
44
+ event.preventDefault();
45
+ event.stopPropagation();
46
+ }
47
+
43
48
  render() {
44
49
  let classes = classNames('sd-list-item sd-shadow--z1', {
45
50
  'sd-list-item--activated': this.props.activated,
46
51
  'sd-list-item--selected': this.props.selected,
47
52
  'fetched': this.props.archived,
48
53
  'actioning': this.props.loading,
49
- });
54
+ });
50
55
 
51
56
  return (
52
- <div
57
+ <div
53
58
  role='listitem'
54
59
  className={classes}
55
60
  onClick={this.onSingleClick}
56
61
  onDoubleClick={this.onDoubleClick}>
57
- {this.props.locked
62
+ {this.props.locked
58
63
  ? <div className="sd-list-item__border sd-list-item__border--locked"></div>
59
64
  : <div className="sd-list-item__border"></div>}
60
- {this.props.itemColum.map((item, index) => {
61
- return <div
65
+ {this.props.itemColum.map((item, index) => {
66
+ return <div
62
67
  className={`sd-list-item__column ${item.fullwidth && 'sd-list-item__column--grow'} ${!item.border && 'sd-list-item__column--no-border'}`}
63
68
  key={index}>
64
69
  {item.itemRow.map((e, i) => {
65
70
  return (
66
71
  item.itemRow.length <= 1
67
- ? <React.Fragment key={i}>{e.content}</React.Fragment>
68
- : <div className="sd-list-item__row" key={i}>
69
- {e.content}
70
- </div>
72
+ ? <React.Fragment key={i}>{e.content}</React.Fragment>
73
+ : <div className="sd-list-item__row" key={i}>
74
+ {e.content}
75
+ </div>
71
76
  );
72
77
  })}
73
- </div>;
74
- })}
75
- <div className="sd-list-item__action-menu">
76
- {this.props.action}
77
- </div>
78
+ </div>;
79
+ })}
80
+ <div className="sd-list-item__action-menu" onClick={this.onActionMenuClick}>
81
+ {this.props.action}
78
82
  </div>
83
+ </div>
79
84
  );
80
85
  }
81
86
  }
@@ -95,7 +100,7 @@ interface IProps {
95
100
  }
96
101
 
97
102
  interface IItemArray {
98
- itemRow: Array<{content: React.ReactNode}>;
103
+ itemRow: Array<{ content: React.ReactNode }>;
99
104
  border?: boolean;
100
105
  fullwidth?: boolean;
101
106
  }
@@ -107,16 +112,16 @@ class ContentList extends React.PureComponent<IProps> {
107
112
  <div role='list' className={classes}>
108
113
  {this.props.items.map((item, index) => {
109
114
  return <ContentListItem
110
- key={index}
111
- itemColum={item.itemColum}
112
- locked={item.locked}
113
- action={item.action}
114
- loading={item.loading}
115
- activated={item.activated}
116
- selected={item.selected}
117
- archived={item.archived}
118
- onClick={item.onClick}
119
- onDoubleClick={item.onDoubleClick} />;
115
+ key={index}
116
+ itemColum={item.itemColum}
117
+ locked={item.locked}
118
+ action={item.action}
119
+ loading={item.loading}
120
+ activated={item.activated}
121
+ selected={item.selected}
122
+ archived={item.archived}
123
+ onClick={item.onClick}
124
+ onDoubleClick={item.onDoubleClick} />;
120
125
  })}
121
126
  </div>
122
127
  );
@@ -60026,6 +60026,10 @@ var ContentListItem = /** @class */ (function (_super) {
60026
60026
  _this.prevent = false;
60027
60027
  }, _this.delay);
60028
60028
  };
60029
+ _this.onActionMenuClick = function (event) {
60030
+ event.preventDefault();
60031
+ event.stopPropagation();
60032
+ };
60029
60033
  return _this;
60030
60034
  }
60031
60035
  ContentListItem.prototype.render = function () {
@@ -60046,7 +60050,7 @@ var ContentListItem = /** @class */ (function (_super) {
60046
60050
  : React.createElement("div", { className: "sd-list-item__row", key: i }, e.content));
60047
60051
  }));
60048
60052
  }),
60049
- React.createElement("div", { className: "sd-list-item__action-menu" }, this.props.action)));
60053
+ React.createElement("div", { className: "sd-list-item__action-menu", onClick: this.onActionMenuClick }, this.props.action)));
60050
60054
  };
60051
60055
  return ContentListItem;
60052
60056
  }(React.PureComponent));
@@ -68743,7 +68747,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
68743
68747
  return (mod && mod.__esModule) ? mod : { "default": mod };
68744
68748
  };
68745
68749
  Object.defineProperty(exports, "__esModule", { value: true });
68746
- exports.Label = void 0;
68750
+ exports.getTextColor = exports.Label = void 0;
68747
68751
  var React = __importStar(__webpack_require__(0));
68748
68752
  var classnames_1 = __importDefault(__webpack_require__(2));
68749
68753
  var Label = /** @class */ (function (_super) {
@@ -68780,13 +68784,23 @@ var Label = /** @class */ (function (_super) {
68780
68784
  return (React.createElement("span", { className: classes, style: { color: this.props.hexColor, backgroundColor: "".concat(this.props.hexColor, "33") } }, this.props.text));
68781
68785
  }
68782
68786
  else {
68783
- return (React.createElement("span", { className: classes, style: { backgroundColor: this.props.hexColor } }, this.props.text));
68787
+ return (React.createElement("span", { className: classes, style: this.props.hexColor
68788
+ ? { backgroundColor: this.props.hexColor, color: getTextColor(this.props.hexColor) }
68789
+ : undefined }, this.props.text));
68784
68790
  }
68785
68791
  }
68786
68792
  };
68787
68793
  return Label;
68788
68794
  }(React.PureComponent));
68789
68795
  exports.Label = Label;
68796
+ function getTextColor(backgroundColor) {
68797
+ var r = parseInt(backgroundColor.substr(1, 2), 16);
68798
+ var g = parseInt(backgroundColor.substr(3, 2), 16);
68799
+ var b = parseInt(backgroundColor.substr(5, 2), 16);
68800
+ var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
68801
+ return (yiq >= 128) ? 'black' : 'white';
68802
+ }
68803
+ exports.getTextColor = getTextColor;
68790
68804
 
68791
68805
 
68792
68806
  /***/ }),
@@ -137913,7 +137927,7 @@ exports.WithSizeObserverDocs = WithSizeObserverDocs;
137913
137927
  /* 649 */
137914
137928
  /***/ (function(module, exports) {
137915
137929
 
137916
- module.exports = {"name":"superdesk-ui-framework","version":"3.0.1-beta.23","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"webpack --config tasks/webpack.prod.js && tsc","build-ui":"webpack && tsc && npm run lint","lint":"eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}'","lint-fix":"tsc -p tsconfig.json --noEmit && tslint --fix -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build"},"devDependencies":{"@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/lodash":"^4.14.161","@types/react":"16.8.23","@types/react-beautiful-dnd":"^13.1.2","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","@types/react-scrollspy":"^3.3.5","@typescript-eslint/parser":"5.14.0","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","lodash":"4.17.21","node-sass":"6.0","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-bootstrap":"^0.31.2","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","tslint":"^5.18.0","typescript":"4.5.2","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@material-ui/lab":"^4.0.0-alpha.56","@popperjs/core":"^2.4.0","@superdesk/primereact":"^5.0.2-6","@types/node":"^14.10.2","chart.js":"^2.9.3","date-fns":"2.7.0","moment":"^2.29.3","popper.js":"1.14.4","primeicons":"2.0.0","react-beautiful-dnd":"^13.0.0","react-id-generator":"^3.0.0","react-popper":"^2.2.3","react-scrollspy":"^3.4.3"}}
137930
+ module.exports = {"name":"superdesk-ui-framework","version":"3.0.1-beta.25","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"webpack --config tasks/webpack.prod.js && tsc","build-ui":"webpack && tsc && npm run lint","lint":"eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}'","lint-fix":"tsc -p tsconfig.json --noEmit && tslint --fix -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build"},"devDependencies":{"@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/lodash":"^4.14.161","@types/react":"16.8.23","@types/react-beautiful-dnd":"^13.1.2","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","@types/react-scrollspy":"^3.3.5","@typescript-eslint/parser":"5.14.0","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","lodash":"4.17.21","node-sass":"6.0","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-bootstrap":"^0.31.2","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","tslint":"^5.18.0","typescript":"4.5.2","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@material-ui/lab":"^4.0.0-alpha.56","@popperjs/core":"^2.4.0","@superdesk/primereact":"^5.0.2-6","@types/node":"^14.10.2","chart.js":"^2.9.3","date-fns":"2.7.0","moment":"^2.29.3","popper.js":"1.14.4","primeicons":"2.0.0","react-beautiful-dnd":"^13.0.0","react-id-generator":"^3.0.0","react-popper":"^2.2.3","react-scrollspy":"^3.4.3"}}
137917
137931
 
137918
137932
  /***/ }),
137919
137933
  /* 650 */
@@ -41932,7 +41932,7 @@ a.text-link {
41932
41932
  width: 32rem;
41933
41933
  max-height: 100%; }
41934
41934
  .editor-popup__main.editor-popup__main--floating {
41935
- background-color: #fff;
41935
+ background-color: var(--color-dropdown-menu-Bg);
41936
41936
  z-index: 2;
41937
41937
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 3px 1px -2px rgba(0, 0, 0, 0.1); }
41938
41938
 
@@ -41987,16 +41987,16 @@ a.text-link {
41987
41987
  padding-top: 0; }
41988
41988
 
41989
41989
  .editor-popup__secondary-content {
41990
- background-color: rgba(123, 123, 123, 0.1);
41991
- border-top: 1px solid rgba(123, 123, 123, 0.2); }
41990
+ background-color: rgba(106, 120, 138, 0.05);
41991
+ border-top: 1px solid var(--sd-colour-line--light); }
41992
41992
 
41993
41993
  .comment-box__reply-item {
41994
- border-bottom: 1px solid rgba(123, 123, 123, 0.2); }
41994
+ border-bottom: 1px solid var(--sd-colour-line--light); }
41995
41995
 
41996
41996
  .comment-box__input {
41997
41997
  padding: 0.4rem;
41998
- border-radius: var(--b-radius--x-small);
41999
- border: 1px solid rgba(123, 123, 123, 0.4);
41998
+ border-radius: var(--b-radius--small);
41999
+ border: 1px solid var(--sd-colour-line--light);
42000
42000
  height: 2.8rem;
42001
42001
  resize: none; }
42002
42002
 
@@ -42004,14 +42004,18 @@ a.text-link {
42004
42004
  display: none;
42005
42005
  padding-top: 1rem; }
42006
42006
  .comment-box__reply-toolbar--active {
42007
- display: block; }
42007
+ display: flex;
42008
+ justify-content: flex-end;
42009
+ align-items: center;
42010
+ gap: var(--gap--small); }
42008
42011
 
42009
42012
  .comment-box__button-toolbar {
42010
42013
  margin-top: 1.2rem;
42011
42014
  display: flex;
42012
42015
  flex-direction: row;
42013
42016
  align-items: center;
42014
- justify-content: flex-start; }
42017
+ justify-content: flex-start;
42018
+ gap: var(--gap--small); }
42015
42019
  .comment-box__button-toolbar--right {
42016
42020
  justify-content: flex-end; }
42017
42021
  .comment-box__button-toolbar--small {
@@ -59670,6 +59670,10 @@ var ContentListItem = /** @class */ (function (_super) {
59670
59670
  _this.prevent = false;
59671
59671
  }, _this.delay);
59672
59672
  };
59673
+ _this.onActionMenuClick = function (event) {
59674
+ event.preventDefault();
59675
+ event.stopPropagation();
59676
+ };
59673
59677
  return _this;
59674
59678
  }
59675
59679
  ContentListItem.prototype.render = function () {
@@ -59690,7 +59694,7 @@ var ContentListItem = /** @class */ (function (_super) {
59690
59694
  : React.createElement("div", { className: "sd-list-item__row", key: i }, e.content));
59691
59695
  }));
59692
59696
  }),
59693
- React.createElement("div", { className: "sd-list-item__action-menu" }, this.props.action)));
59697
+ React.createElement("div", { className: "sd-list-item__action-menu", onClick: this.onActionMenuClick }, this.props.action)));
59694
59698
  };
59695
59699
  return ContentListItem;
59696
59700
  }(React.PureComponent));
@@ -68004,7 +68008,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
68004
68008
  return (mod && mod.__esModule) ? mod : { "default": mod };
68005
68009
  };
68006
68010
  Object.defineProperty(exports, "__esModule", { value: true });
68007
- exports.Label = void 0;
68011
+ exports.getTextColor = exports.Label = void 0;
68008
68012
  var React = __importStar(__webpack_require__(0));
68009
68013
  var classnames_1 = __importDefault(__webpack_require__(2));
68010
68014
  var Label = /** @class */ (function (_super) {
@@ -68041,13 +68045,23 @@ var Label = /** @class */ (function (_super) {
68041
68045
  return (React.createElement("span", { className: classes, style: { color: this.props.hexColor, backgroundColor: "".concat(this.props.hexColor, "33") } }, this.props.text));
68042
68046
  }
68043
68047
  else {
68044
- return (React.createElement("span", { className: classes, style: { backgroundColor: this.props.hexColor } }, this.props.text));
68048
+ return (React.createElement("span", { className: classes, style: this.props.hexColor
68049
+ ? { backgroundColor: this.props.hexColor, color: getTextColor(this.props.hexColor) }
68050
+ : undefined }, this.props.text));
68045
68051
  }
68046
68052
  }
68047
68053
  };
68048
68054
  return Label;
68049
68055
  }(React.PureComponent));
68050
68056
  exports.Label = Label;
68057
+ function getTextColor(backgroundColor) {
68058
+ var r = parseInt(backgroundColor.substr(1, 2), 16);
68059
+ var g = parseInt(backgroundColor.substr(3, 2), 16);
68060
+ var b = parseInt(backgroundColor.substr(5, 2), 16);
68061
+ var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
68062
+ return (yiq >= 128) ? 'black' : 'white';
68063
+ }
68064
+ exports.getTextColor = getTextColor;
68051
68065
 
68052
68066
 
68053
68067
  /***/ }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "3.0.1-beta.23",
3
+ "version": "3.0.1-beta.25",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,4 +13,5 @@ interface IProps {
13
13
  export declare class Label extends React.PureComponent<IProps> {
14
14
  render(): JSX.Element;
15
15
  }
16
+ export declare function getTextColor(backgroundColor: string): 'black' | 'white';
16
17
  export {};
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.Label = void 0;
40
+ exports.getTextColor = exports.Label = void 0;
41
41
  var React = __importStar(require("react"));
42
42
  var classnames_1 = __importDefault(require("classnames"));
43
43
  var Label = /** @class */ (function (_super) {
@@ -74,10 +74,20 @@ var Label = /** @class */ (function (_super) {
74
74
  return (React.createElement("span", { className: classes, style: { color: this.props.hexColor, backgroundColor: "".concat(this.props.hexColor, "33") } }, this.props.text));
75
75
  }
76
76
  else {
77
- return (React.createElement("span", { className: classes, style: { backgroundColor: this.props.hexColor } }, this.props.text));
77
+ return (React.createElement("span", { className: classes, style: this.props.hexColor
78
+ ? { backgroundColor: this.props.hexColor, color: getTextColor(this.props.hexColor) }
79
+ : undefined }, this.props.text));
78
80
  }
79
81
  }
80
82
  };
81
83
  return Label;
82
84
  }(React.PureComponent));
83
85
  exports.Label = Label;
86
+ function getTextColor(backgroundColor) {
87
+ var r = parseInt(backgroundColor.substr(1, 2), 16);
88
+ var g = parseInt(backgroundColor.substr(3, 2), 16);
89
+ var b = parseInt(backgroundColor.substr(5, 2), 16);
90
+ var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
91
+ return (yiq >= 128) ? 'black' : 'white';
92
+ }
93
+ exports.getTextColor = getTextColor;
@@ -22,6 +22,7 @@ declare class ContentListItem extends React.PureComponent<IPropsItem> {
22
22
  private prevent;
23
23
  onSingleClick: () => void;
24
24
  onDoubleClick: () => void;
25
+ onActionMenuClick: (event: React.MouseEvent<HTMLElement>) => void;
25
26
  render(): JSX.Element;
26
27
  }
27
28
  interface IProps {
@@ -65,6 +65,10 @@ var ContentListItem = /** @class */ (function (_super) {
65
65
  _this.prevent = false;
66
66
  }, _this.delay);
67
67
  };
68
+ _this.onActionMenuClick = function (event) {
69
+ event.preventDefault();
70
+ event.stopPropagation();
71
+ };
68
72
  return _this;
69
73
  }
70
74
  ContentListItem.prototype.render = function () {
@@ -85,7 +89,7 @@ var ContentListItem = /** @class */ (function (_super) {
85
89
  : React.createElement("div", { className: "sd-list-item__row", key: i }, e.content));
86
90
  }));
87
91
  }),
88
- React.createElement("div", { className: "sd-list-item__action-menu" }, this.props.action)));
92
+ React.createElement("div", { className: "sd-list-item__action-menu", onClick: this.onActionMenuClick }, this.props.action)));
89
93
  };
90
94
  return ContentListItem;
91
95
  }(React.PureComponent));
@@ -1,5 +0,0 @@
1
- {
2
- "cSpell.words": [
3
- "qcode"
4
- ]
5
- }
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- interface IProps {
3
- type?: 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'sd-green';
4
- style?: 'filled' | 'hollow';
5
- size?: 'normal' | 'small';
6
- restoreIcon?: 'info' | 'help';
7
- }
8
- interface IState {
9
- open: boolean;
10
- }
11
- export declare class Alert extends React.PureComponent<IProps, IState> {
12
- constructor(props: IProps);
13
- onToggle(): void;
14
- render(): JSX.Element;
15
- }
16
- export {};
@@ -1,48 +0,0 @@
1
- import * as React from 'react';
2
- interface IProps {
3
- items: Array<any>;
4
- keyValue?: string;
5
- minLength?: number;
6
- value?: string | object;
7
- label?: string;
8
- placeholder?: string;
9
- info?: string;
10
- error?: string;
11
- required?: boolean;
12
- disabled?: boolean;
13
- invalid?: boolean;
14
- inlineLabel?: boolean;
15
- isSearchField?: boolean;
16
- listItemTemplate?(value: any): any;
17
- search?(searhString: string, callback: (result: Array<any>) => void): {
18
- cancel: () => void;
19
- };
20
- onChange(newValue: string): void;
21
- onSelect?(suggestion: string): void;
22
- }
23
- interface IState {
24
- selectedItem: any;
25
- filteredItems: any;
26
- invalid: boolean;
27
- focused: boolean;
28
- }
29
- export declare class Autocomplete extends React.Component<IProps, IState> {
30
- latestCall?: {
31
- cancel: () => void;
32
- };
33
- constructor(props: IProps);
34
- htmlId: string;
35
- search(term: string): void;
36
- searchItem(event: any): void;
37
- handleChange(event: {
38
- originalEvent: Event;
39
- value: any;
40
- }): void;
41
- handleSelect(event: {
42
- originalEvent: Event;
43
- value: any;
44
- }): void;
45
- handleInputClear(): void;
46
- render(): JSX.Element;
47
- }
48
- export {};
@@ -1,33 +0,0 @@
1
- import * as React from 'react';
2
- interface IBase {
3
- tooltipText?: string;
4
- }
5
- interface IImageAvatar extends IBase {
6
- imageUrl?: string;
7
- }
8
- interface ITextAvatar extends IBase {
9
- text: string;
10
- }
11
- export declare class AvatarContentText extends React.PureComponent<ITextAvatar> {
12
- render(): JSX.Element;
13
- }
14
- export declare class AvatarContentImage extends React.PureComponent<IImageAvatar> {
15
- render(): JSX.Element;
16
- }
17
- interface IPropsAvatarWrapper {
18
- size?: 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';
19
- statusIndicator?: {
20
- status: 'online' | 'offline';
21
- tooltipText?: string;
22
- };
23
- administratorIndicator?: {
24
- enabled: boolean;
25
- tooltipText?: string;
26
- };
27
- children: React.ReactNode;
28
- 'data-test-id'?: string;
29
- }
30
- export declare class AvatarWrapper extends React.PureComponent<IPropsAvatarWrapper> {
31
- render(): JSX.Element;
32
- }
33
- export {};
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- interface IProps {
3
- text?: string;
4
- type?: 'default' | 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'light';
5
- color?: string;
6
- shape?: 'round' | 'square';
7
- children?: React.ReactNode;
8
- 'data-test-id'?: string;
9
- }
10
- export declare class Badge extends React.PureComponent<IProps> {
11
- render(): JSX.Element;
12
- }
13
- export {};
@@ -1,23 +0,0 @@
1
- import * as React from 'react';
2
- interface IButtonBase {
3
- id?: string;
4
- theme?: 'light' | 'dark';
5
- type?: 'default' | 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'sd-green';
6
- size?: 'small' | 'normal' | 'large';
7
- children?: never;
8
- icon?: string;
9
- disabled?: boolean;
10
- iconOnly?: boolean;
11
- onClick(): void;
12
- 'data-test-id'?: string;
13
- }
14
- interface IPropsButton extends IButtonBase {
15
- text: string;
16
- expand?: boolean;
17
- style?: 'filled' | 'hollow' | 'text-only';
18
- shape?: 'square' | 'round';
19
- }
20
- export declare class Button extends React.PureComponent<IPropsButton> {
21
- render(): JSX.Element;
22
- }
23
- export {};
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- interface IProps {
3
- orientation?: 'horizontal' | 'vertical';
4
- spaces?: 'comfort' | 'compact';
5
- align?: 'left' | 'right' | 'center' | 'inline';
6
- padded?: boolean;
7
- children: React.ReactNode;
8
- }
9
- export declare class ButtonGroup extends React.PureComponent<IProps> {
10
- render(): JSX.Element;
11
- }
12
- export {};
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- interface IProps {
3
- orientation?: 'horizontal' | 'vertical';
4
- grid?: boolean;
5
- align?: 'left' | 'right' | 'center' | 'inline';
6
- padded?: boolean;
7
- }
8
- export declare class CheckButtonGroup extends React.PureComponent<IProps> {
9
- render(): JSX.Element;
10
- }
11
- export {};
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- interface IProps {
3
- orientation?: 'horizontal' | 'vertical';
4
- children: React.ReactNode;
5
- }
6
- export declare class CheckGroup extends React.PureComponent<IProps> {
7
- render(): JSX.Element;
8
- }
9
- export {};
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- interface IProps {
3
- label: {
4
- text: string;
5
- side?: 'left' | 'right';
6
- hidden?: boolean;
7
- };
8
- checked?: boolean;
9
- disabled?: boolean;
10
- required?: boolean;
11
- onChange(nextValue: boolean): void;
12
- }
13
- export declare class Checkbox extends React.Component<IProps> {
14
- htmlId: string;
15
- constructor(props: IProps);
16
- handleChange(event: React.ChangeEvent<HTMLInputElement>): void;
17
- render(): JSX.Element;
18
- }
19
- export {};