superdesk-ui-framework 3.0.1-beta.7 → 3.0.1-beta.9

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 (52) hide show
  1. package/app/fonts/sd_icons.eot +0 -0
  2. package/app/fonts/sd_icons.svg +14 -7
  3. package/app/fonts/sd_icons.ttf +0 -0
  4. package/app/fonts/sd_icons.woff +0 -0
  5. package/app/styles/_icon-font.scss +7 -0
  6. package/app/styles/_sd-tag-input.scss +1 -0
  7. package/app/styles/components/_sd-grid-item.scss +30 -16
  8. package/app/styles/design-tokens/_design-tokens-general.scss +1 -1
  9. package/app/styles/form-elements/_forms-general.scss +64 -5
  10. package/app/styles/grids/_grid-layout.scss +25 -1
  11. package/app/styles/layout/_basic-layout.scss +2 -2
  12. package/app/styles/layout/_editor.scss +4 -4
  13. package/app-typescript/components/EmptyState.tsx +2 -1
  14. package/app-typescript/components/Form/FormRowNew.tsx +41 -0
  15. package/app-typescript/components/Form/index.tsx +1 -0
  16. package/app-typescript/components/Layouts/AuthoringContainer.tsx +2 -1
  17. package/app-typescript/components/LeftMenu.tsx +127 -122
  18. package/app-typescript/components/TimePicker.tsx +2 -0
  19. package/dist/examples.bundle.css +273 -0
  20. package/dist/examples.bundle.js +997 -875
  21. package/dist/playgrounds/react-playgrounds/RundownEditor.tsx +1 -1
  22. package/dist/playgrounds/react-playgrounds/SamsPlayground.tsx +12 -3
  23. package/dist/playgrounds/react-playgrounds/TestGround.tsx +120 -14
  24. package/dist/react/LeftNavigations.tsx +71 -44
  25. package/dist/react/TimePicker.tsx +6 -4
  26. package/dist/react/TreeSelect.tsx +1 -1
  27. package/dist/sd_icons.eot +0 -0
  28. package/dist/sd_icons.svg +14 -7
  29. package/dist/sd_icons.ttf +0 -0
  30. package/dist/sd_icons.woff +0 -0
  31. package/dist/superdesk-ui.bundle.css +928 -24
  32. package/dist/superdesk-ui.bundle.js +617 -534
  33. package/dist/vendor.bundle.js +14 -14
  34. package/examples/pages/playgrounds/react-playgrounds/RundownEditor.tsx +1 -1
  35. package/examples/pages/playgrounds/react-playgrounds/SamsPlayground.tsx +12 -3
  36. package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +120 -14
  37. package/examples/pages/react/LeftNavigations.tsx +71 -44
  38. package/examples/pages/react/TimePicker.tsx +6 -4
  39. package/examples/pages/react/TreeSelect.tsx +1 -1
  40. package/package.json +2 -2
  41. package/react/components/EmptyState.d.ts +1 -0
  42. package/react/components/EmptyState.js +1 -1
  43. package/react/components/Form/FormRowNew.d.ts +12 -0
  44. package/react/components/Form/FormRowNew.js +67 -0
  45. package/react/components/Form/index.d.ts +1 -0
  46. package/react/components/Form/index.js +3 -1
  47. package/react/components/Layouts/AuthoringContainer.d.ts +1 -0
  48. package/react/components/Layouts/AuthoringContainer.js +1 -1
  49. package/react/components/LeftMenu.d.ts +3 -1
  50. package/react/components/LeftMenu.js +8 -1
  51. package/react/components/TimePicker.d.ts +1 -0
  52. package/react/components/TimePicker.js +1 -1
@@ -3,150 +3,155 @@ import classNames from "classnames";
3
3
  import Scrollspy from "react-scrollspy";
4
4
 
5
5
  interface IMenuItem {
6
- id: string;
7
- label: string;
8
- route?: string;
9
- ref?: string;
10
- onClick?(): void;
6
+ id: string;
7
+ label: string;
8
+ route?: string;
9
+ ref?: string;
10
+ onClick?(): void;
11
11
  }
12
12
 
13
13
  interface IMenuGroup {
14
- label: string;
15
- items: Array<IMenuItem>;
14
+ label: string;
15
+ items: Array<IMenuItem>;
16
16
  }
17
17
 
18
18
  interface IMenu {
19
- className?: string;
20
- groups: Array<IMenuGroup>;
21
- activeItemId: string;
22
- ariaLabel?: string;
23
- scrollSpy?: string;
24
- offset?: number;
25
- reverseItemBorder?: boolean;
26
- style?: "default" | "inverse" | "blanc";
27
- size?: "medium" | "large";
28
- onSelect(id: string, route: string): void;
19
+ className?: string;
20
+ groups: Array<IMenuGroup>;
21
+ activeItemId?: string;
22
+ scrollTo?: string;
23
+ ariaLabel?: string;
24
+ scrollSpy?: string;
25
+ offset?: number;
26
+ reverseItemBorder?: boolean;
27
+ style?: "default" | "inverse" | "blanc";
28
+ size?: "medium" | "large";
29
+ onSelect(id: string, route: string): void;
29
30
  }
30
31
 
31
32
  interface IState {
32
- active: string;
33
+ active: string;
33
34
  }
34
35
 
35
36
  export class LeftMenu extends React.PureComponent<IMenu, IState> {
36
- constructor(props: IMenu) {
37
- super(props);
37
+ constructor(props: IMenu) {
38
+ super(props);
38
39
 
39
- this.state = {
40
- active: "",
41
- };
42
- }
40
+ this.state = {
41
+ active: this.props.activeItemId ? this.props.activeItemId : '',
42
+ };
43
+ }
44
+
45
+ handleClick(item: IMenuItem, event?: React.MouseEvent) {
46
+ event?.preventDefault();
47
+
48
+ this.setState({
49
+ active: item.id,
50
+ });
43
51
 
44
- handleClick(item: IMenuItem, event?: React.MouseEvent) {
45
- event?.preventDefault();
52
+ if (item.ref) {
53
+ return document
54
+ .getElementById(item.ref)
55
+ ?.scrollIntoView({ block: "nearest", behavior: "smooth" });
56
+ }
46
57
 
47
- this.setState({
48
- active: item.id,
49
- });
58
+ if (item.onClick) {
59
+ return item.onClick();
60
+ }
50
61
 
51
- if (item.ref) {
52
- return document
53
- .getElementById(item.ref)
54
- ?.scrollIntoView({ block: "nearest", behavior: "smooth" });
62
+ this.props.onSelect(item.id, item.route ? item.route : "");
55
63
  }
56
64
 
57
- if (item.onClick) {
58
- return item.onClick();
65
+ componentDidMount() {
66
+ if (this.props.scrollTo) {
67
+ return document
68
+ .getElementById(this.props.scrollTo)
69
+ ?.scrollIntoView({ block: "nearest", behavior: "smooth" });
70
+ }
59
71
  }
60
72
 
61
- this.props.onSelect(item.id, item.route ? item.route : "");
62
- }
63
-
64
- render() {
65
- let classes = classNames(
66
- "sd-left-nav",
67
- {
68
- "sd-left-nav--default": this.props.style === undefined,
69
- [`sd-left-nav--${this.props.style}`]:
70
- this.props.style || this.props.style !== undefined,
71
- "sd-left-nav--medium": this.props.size === undefined,
72
- [`sd-left-nav--${this.props.size}`]:
73
- this.props.size || this.props.size !== undefined,
74
- "sd-left-nav--reverse-border": this.props.reverseItemBorder,
75
- },
76
- this.props.className,
77
- );
78
-
79
- const scrollspyList = () => {
80
- let scrollSpyList: Array<string> = [];
81
- let scrollSpyItems: Array<JSX.Element> = [];
82
- this.props.groups.map((element, index) => {
83
- scrollSpyList = [...scrollSpyList, element.label];
84
- scrollSpyItems.push(
85
- <span className="sd-left-nav__group-header" key={"group-" + index}>
86
- {element.label}
87
- </span>,
73
+ render() {
74
+ let classes = classNames(
75
+ "sd-left-nav",
76
+ {
77
+ "sd-left-nav--default": this.props.style === undefined,
78
+ [`sd-left-nav--${this.props.style}`]:
79
+ this.props.style || this.props.style !== undefined,
80
+ "sd-left-nav--medium": this.props.size === undefined,
81
+ [`sd-left-nav--${this.props.size}`]:
82
+ this.props.size || this.props.size !== undefined,
83
+ "sd-left-nav--reverse-border": this.props.reverseItemBorder,
84
+ },
85
+ this.props.className,
88
86
  );
89
87
 
90
- element.items.map((elementOfItem, indexOfItem) => {
91
- scrollSpyList = [...scrollSpyList, `${elementOfItem.ref}`];
92
-
93
- scrollSpyItems.push(
94
- <a
95
- key={"item-" + indexOfItem}
96
- onClick={(event) => {
97
- this.handleClick(elementOfItem, event);
98
- }}
99
- className="sd-left-nav__btn"
100
- >
101
- {elementOfItem.label}
102
- </a>,
103
- );
104
- });
105
- });
106
-
107
- return (
108
- <Scrollspy
109
- offset={this.props.offset ? this.props.offset : -300}
110
- items={scrollSpyList}
111
- rootEl={this.props.scrollSpy}
112
- currentClassName="sd-left-nav__btn--active"
113
- >
114
- {scrollSpyItems.map((element) => element)}
115
- </Scrollspy>
116
- );
117
- };
118
-
119
- const defaultList = () => {
120
- return this.props.groups.map((group, i) => {
88
+ const scrollspyList = () => {
89
+ let scrollSpyList: Array<string> = [];
90
+ let scrollSpyItems: Array<JSX.Element> = [];
91
+ this.props.groups.map((element, index) => {
92
+ scrollSpyList = [...scrollSpyList, element.label];
93
+ scrollSpyItems.push(
94
+ <span className="sd-left-nav__group-header" key={"group-" + index}>
95
+ {element.label}
96
+ </span>,
97
+ );
98
+
99
+ element.items.map((elementOfItem, indexOfItem) => {
100
+ scrollSpyList = [...scrollSpyList, `${elementOfItem.ref}`];
101
+
102
+ scrollSpyItems.push(
103
+ <a key={"item-" + indexOfItem}
104
+ onClick={(event) => {
105
+ this.handleClick(elementOfItem, event);
106
+ }}
107
+ className="sd-left-nav__btn" >
108
+ {elementOfItem.label}
109
+ </a>,
110
+ );
111
+ });
112
+ });
113
+
114
+ return (
115
+ <Scrollspy
116
+ offset={this.props.offset ? this.props.offset : -300}
117
+ items={scrollSpyList}
118
+ rootEl={this.props.scrollSpy}
119
+ currentClassName="sd-left-nav__btn--active" >
120
+ {scrollSpyItems.map((element) => element)}
121
+ </Scrollspy>
122
+ );
123
+ };
124
+
125
+ const defaultList = () => {
126
+ return this.props.groups.map((group, i) => {
127
+ return (
128
+ <React.Fragment key={i}>
129
+ <span className="sd-left-nav__group-header">{group.label}</span>
130
+ {group.items.map((item, j) => {
131
+ return (
132
+ <button
133
+ key={j}
134
+ onClick={(event) => {
135
+ this.handleClick(item, event);
136
+ }}
137
+ className={
138
+ item.id === this.state.active
139
+ ? "sd-left-nav__btn sd-left-nav__btn--active"
140
+ : "sd-left-nav__btn"
141
+ }>
142
+ {item.label}
143
+ </button>
144
+ );
145
+ })}
146
+ </React.Fragment>
147
+ );
148
+ });
149
+ };
150
+
121
151
  return (
122
- <React.Fragment key={i}>
123
- <span className="sd-left-nav__group-header">{group.label}</span>
124
- {group.items.map((item, j) => {
125
- return (
126
- <button
127
- key={j}
128
- onClick={(event) => {
129
- this.handleClick(item, event);
130
- }}
131
- className={
132
- item.id === this.state.active
133
- ? "sd-left-nav__btn sd-left-nav__btn--active"
134
- : "sd-left-nav__btn"
135
- }
136
- >
137
- {item.label}
138
- </button>
139
- );
140
- })}
141
- </React.Fragment>
152
+ <nav className={classes} aria-label={this.props.ariaLabel}>
153
+ {this.props.scrollSpy ? scrollspyList() : defaultList()}
154
+ </nav>
142
155
  );
143
- });
144
- };
145
-
146
- return (
147
- <nav className={classes} aria-label={this.props.ariaLabel}>
148
- {this.props.scrollSpy ? scrollspyList() : defaultList()}
149
- </nav>
150
- );
151
- }
156
+ }
152
157
  }
@@ -6,6 +6,7 @@ import { InputWrapper } from './Form';
6
6
  interface IProps {
7
7
  value: string; // will output time as ISO8601 time string(e.g. 16:55) or an empty string if there's no value
8
8
  onChange(valueNext: string): void;
9
+ allowSeconds?: boolean;
9
10
  disabled?: boolean;
10
11
  inlineLabel?: boolean;
11
12
  required?: boolean;
@@ -49,6 +50,7 @@ export class TimePicker extends React.PureComponent<IProps, IState> {
49
50
  id={this.htmlId}
50
51
  aria-labelledby={this.htmlId + 'label'}
51
52
  type="time"
53
+ step={this.props.allowSeconds ? 1 : undefined}
52
54
  className="sd-input__input"
53
55
  value={this.props.value}
54
56
  required={this.props.required}
@@ -10832,6 +10832,279 @@ doc-react-playground {
10832
10832
  --icon-base-size: 64px
10833
10833
  ; }
10834
10834
 
10835
+ .icon-photo-cancel:before {
10836
+ content: ""; }
10837
+
10838
+ .icon-photo-cancel.color--default {
10839
+ color: var(--color-icon-default); }
10840
+
10841
+ .icon-photo-cancel.color--primary {
10842
+ color: var(--sd-colour-primary) !important; }
10843
+
10844
+ .icon-photo-cancel.color--success {
10845
+ color: var(--sd-colour-success) !important; }
10846
+
10847
+ .icon-photo-cancel.color--warning {
10848
+ color: var(--sd-colour-warning) !important; }
10849
+
10850
+ .icon-photo-cancel.color--alert {
10851
+ color: var(--sd-colour-alert) !important; }
10852
+
10853
+ .icon-photo-cancel.color--highlight {
10854
+ color: var(--sd-colour-highlight) !important; }
10855
+
10856
+ .icon-photo-cancel.color--light {
10857
+ color: var(--color-text-lighter) !important; }
10858
+
10859
+ .icon-photo-cancel.color--white {
10860
+ color: #e2e5e9 !important; }
10861
+
10862
+ .icon-photo-cancel.scale--2x {
10863
+ --icon-base-size: 32px
10864
+ ; }
10865
+
10866
+ .icon-photo-cancel.scale--3x {
10867
+ --icon-base-size: 48px
10868
+ ; }
10869
+
10870
+ .icon-photo-cancel.scale--4x {
10871
+ --icon-base-size: 64px
10872
+ ; }
10873
+
10874
+ .icon-video-cancel:before {
10875
+ content: ""; }
10876
+
10877
+ .icon-video-cancel.color--default {
10878
+ color: var(--color-icon-default); }
10879
+
10880
+ .icon-video-cancel.color--primary {
10881
+ color: var(--sd-colour-primary) !important; }
10882
+
10883
+ .icon-video-cancel.color--success {
10884
+ color: var(--sd-colour-success) !important; }
10885
+
10886
+ .icon-video-cancel.color--warning {
10887
+ color: var(--sd-colour-warning) !important; }
10888
+
10889
+ .icon-video-cancel.color--alert {
10890
+ color: var(--sd-colour-alert) !important; }
10891
+
10892
+ .icon-video-cancel.color--highlight {
10893
+ color: var(--sd-colour-highlight) !important; }
10894
+
10895
+ .icon-video-cancel.color--light {
10896
+ color: var(--color-text-lighter) !important; }
10897
+
10898
+ .icon-video-cancel.color--white {
10899
+ color: #e2e5e9 !important; }
10900
+
10901
+ .icon-video-cancel.scale--2x {
10902
+ --icon-base-size: 32px
10903
+ ; }
10904
+
10905
+ .icon-video-cancel.scale--3x {
10906
+ --icon-base-size: 48px
10907
+ ; }
10908
+
10909
+ .icon-video-cancel.scale--4x {
10910
+ --icon-base-size: 64px
10911
+ ; }
10912
+
10913
+ .icon-text-cancel:before {
10914
+ content: ""; }
10915
+
10916
+ .icon-text-cancel.color--default {
10917
+ color: var(--color-icon-default); }
10918
+
10919
+ .icon-text-cancel.color--primary {
10920
+ color: var(--sd-colour-primary) !important; }
10921
+
10922
+ .icon-text-cancel.color--success {
10923
+ color: var(--sd-colour-success) !important; }
10924
+
10925
+ .icon-text-cancel.color--warning {
10926
+ color: var(--sd-colour-warning) !important; }
10927
+
10928
+ .icon-text-cancel.color--alert {
10929
+ color: var(--sd-colour-alert) !important; }
10930
+
10931
+ .icon-text-cancel.color--highlight {
10932
+ color: var(--sd-colour-highlight) !important; }
10933
+
10934
+ .icon-text-cancel.color--light {
10935
+ color: var(--color-text-lighter) !important; }
10936
+
10937
+ .icon-text-cancel.color--white {
10938
+ color: #e2e5e9 !important; }
10939
+
10940
+ .icon-text-cancel.scale--2x {
10941
+ --icon-base-size: 32px
10942
+ ; }
10943
+
10944
+ .icon-text-cancel.scale--3x {
10945
+ --icon-base-size: 48px
10946
+ ; }
10947
+
10948
+ .icon-text-cancel.scale--4x {
10949
+ --icon-base-size: 64px
10950
+ ; }
10951
+
10952
+ .icon-file-cancel:before {
10953
+ content: ""; }
10954
+
10955
+ .icon-file-cancel.color--default {
10956
+ color: var(--color-icon-default); }
10957
+
10958
+ .icon-file-cancel.color--primary {
10959
+ color: var(--sd-colour-primary) !important; }
10960
+
10961
+ .icon-file-cancel.color--success {
10962
+ color: var(--sd-colour-success) !important; }
10963
+
10964
+ .icon-file-cancel.color--warning {
10965
+ color: var(--sd-colour-warning) !important; }
10966
+
10967
+ .icon-file-cancel.color--alert {
10968
+ color: var(--sd-colour-alert) !important; }
10969
+
10970
+ .icon-file-cancel.color--highlight {
10971
+ color: var(--sd-colour-highlight) !important; }
10972
+
10973
+ .icon-file-cancel.color--light {
10974
+ color: var(--color-text-lighter) !important; }
10975
+
10976
+ .icon-file-cancel.color--white {
10977
+ color: #e2e5e9 !important; }
10978
+
10979
+ .icon-file-cancel.scale--2x {
10980
+ --icon-base-size: 32px
10981
+ ; }
10982
+
10983
+ .icon-file-cancel.scale--3x {
10984
+ --icon-base-size: 48px
10985
+ ; }
10986
+
10987
+ .icon-file-cancel.scale--4x {
10988
+ --icon-base-size: 64px
10989
+ ; }
10990
+
10991
+ .icon-audio-cancel:before {
10992
+ content: ""; }
10993
+
10994
+ .icon-audio-cancel.color--default {
10995
+ color: var(--color-icon-default); }
10996
+
10997
+ .icon-audio-cancel.color--primary {
10998
+ color: var(--sd-colour-primary) !important; }
10999
+
11000
+ .icon-audio-cancel.color--success {
11001
+ color: var(--sd-colour-success) !important; }
11002
+
11003
+ .icon-audio-cancel.color--warning {
11004
+ color: var(--sd-colour-warning) !important; }
11005
+
11006
+ .icon-audio-cancel.color--alert {
11007
+ color: var(--sd-colour-alert) !important; }
11008
+
11009
+ .icon-audio-cancel.color--highlight {
11010
+ color: var(--sd-colour-highlight) !important; }
11011
+
11012
+ .icon-audio-cancel.color--light {
11013
+ color: var(--color-text-lighter) !important; }
11014
+
11015
+ .icon-audio-cancel.color--white {
11016
+ color: #e2e5e9 !important; }
11017
+
11018
+ .icon-audio-cancel.scale--2x {
11019
+ --icon-base-size: 32px
11020
+ ; }
11021
+
11022
+ .icon-audio-cancel.scale--3x {
11023
+ --icon-base-size: 48px
11024
+ ; }
11025
+
11026
+ .icon-audio-cancel.scale--4x {
11027
+ --icon-base-size: 64px
11028
+ ; }
11029
+
11030
+ .icon-list-alt-cancel:before {
11031
+ content: ""; }
11032
+
11033
+ .icon-list-alt-cancel.color--default {
11034
+ color: var(--color-icon-default); }
11035
+
11036
+ .icon-list-alt-cancel.color--primary {
11037
+ color: var(--sd-colour-primary) !important; }
11038
+
11039
+ .icon-list-alt-cancel.color--success {
11040
+ color: var(--sd-colour-success) !important; }
11041
+
11042
+ .icon-list-alt-cancel.color--warning {
11043
+ color: var(--sd-colour-warning) !important; }
11044
+
11045
+ .icon-list-alt-cancel.color--alert {
11046
+ color: var(--sd-colour-alert) !important; }
11047
+
11048
+ .icon-list-alt-cancel.color--highlight {
11049
+ color: var(--sd-colour-highlight) !important; }
11050
+
11051
+ .icon-list-alt-cancel.color--light {
11052
+ color: var(--color-text-lighter) !important; }
11053
+
11054
+ .icon-list-alt-cancel.color--white {
11055
+ color: #e2e5e9 !important; }
11056
+
11057
+ .icon-list-alt-cancel.scale--2x {
11058
+ --icon-base-size: 32px
11059
+ ; }
11060
+
11061
+ .icon-list-alt-cancel.scale--3x {
11062
+ --icon-base-size: 48px
11063
+ ; }
11064
+
11065
+ .icon-list-alt-cancel.scale--4x {
11066
+ --icon-base-size: 64px
11067
+ ; }
11068
+
11069
+ .icon-post-cancel:before {
11070
+ content: ""; }
11071
+
11072
+ .icon-post-cancel.color--default {
11073
+ color: var(--color-icon-default); }
11074
+
11075
+ .icon-post-cancel.color--primary {
11076
+ color: var(--sd-colour-primary) !important; }
11077
+
11078
+ .icon-post-cancel.color--success {
11079
+ color: var(--sd-colour-success) !important; }
11080
+
11081
+ .icon-post-cancel.color--warning {
11082
+ color: var(--sd-colour-warning) !important; }
11083
+
11084
+ .icon-post-cancel.color--alert {
11085
+ color: var(--sd-colour-alert) !important; }
11086
+
11087
+ .icon-post-cancel.color--highlight {
11088
+ color: var(--sd-colour-highlight) !important; }
11089
+
11090
+ .icon-post-cancel.color--light {
11091
+ color: var(--color-text-lighter) !important; }
11092
+
11093
+ .icon-post-cancel.color--white {
11094
+ color: #e2e5e9 !important; }
11095
+
11096
+ .icon-post-cancel.scale--2x {
11097
+ --icon-base-size: 32px
11098
+ ; }
11099
+
11100
+ .icon-post-cancel.scale--3x {
11101
+ --icon-base-size: 48px
11102
+ ; }
11103
+
11104
+ .icon-post-cancel.scale--4x {
11105
+ --icon-base-size: 64px
11106
+ ; }
11107
+
10835
11108
  .icn-mix {
10836
11109
  position: relative;
10837
11110
  display: inline-block;