superdesk-ui-framework 3.0.42 → 3.0.44

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 (119) hide show
  1. package/app/styles/_accessibility.scss +349 -310
  2. package/app/styles/_alerts.scss +102 -71
  3. package/app/styles/_animations.scss +29 -16
  4. package/app/styles/_avatar.scss +159 -140
  5. package/app/styles/_badge.scss +11 -5
  6. package/app/styles/_big-icon-font.scss +21 -9
  7. package/app/styles/_boxed-list.scss +72 -47
  8. package/app/styles/_buttons.scss +266 -177
  9. package/app/styles/_carousel.scss +58 -45
  10. package/app/styles/_content-divider.scss +28 -2
  11. package/app/styles/_drag-drop.scss +3 -0
  12. package/app/styles/_empty-states.scss +21 -13
  13. package/app/styles/_hamburger.scss +142 -144
  14. package/app/styles/_helpers.scss +297 -93
  15. package/app/styles/_icon-font.scss +75 -43
  16. package/app/styles/_icon-labels.scss +11 -1
  17. package/app/styles/_labels.scss +27 -14
  18. package/app/styles/_loaders.scss +2 -1
  19. package/app/styles/_master-desk.scss +67 -31
  20. package/app/styles/_mixins.scss +40 -20
  21. package/app/styles/_modals.scss +112 -56
  22. package/app/styles/_panel-info.scss +38 -34
  23. package/app/styles/_popover.scss +0 -1
  24. package/app/styles/_publisher-styles.scss +132 -122
  25. package/app/styles/_sd-tag-input.scss +104 -24
  26. package/app/styles/_simple-list.scss +89 -66
  27. package/app/styles/_spinner.scss +24 -17
  28. package/app/styles/_table-list.scss +114 -80
  29. package/app/styles/_tables.scss +14 -2
  30. package/app/styles/_tabs-vertical.scss +46 -43
  31. package/app/styles/_tabs.scss +97 -87
  32. package/app/styles/_tag-labels.scss +26 -11
  33. package/app/styles/_thumb-carousel.scss +37 -11
  34. package/app/styles/_toggle-box.scss +27 -7
  35. package/app/styles/_toggle-button.scss +5 -1
  36. package/app/styles/_tooltips.scss +284 -272
  37. package/app/styles/components/_card-item.scss +268 -192
  38. package/app/styles/components/_list-item.scss +261 -175
  39. package/app/styles/components/_sd-circular-progress.scss +109 -79
  40. package/app/styles/components/_sd-collapse-box.scss +45 -33
  41. package/app/styles/components/_sd-comment-box.scss +17 -12
  42. package/app/styles/components/_sd-dropzone.scss +32 -15
  43. package/app/styles/components/_sd-editor-popup.scss +29 -15
  44. package/app/styles/components/_sd-grid-item.scss +349 -237
  45. package/app/styles/components/_sd-loader.scss +1 -2
  46. package/app/styles/components/_sd-media-carousel.scss +119 -78
  47. package/app/styles/components/_sd-notification-panel.scss +2 -1
  48. package/app/styles/components/_sd-pagination.scss +27 -19
  49. package/app/styles/components/_sd-photo-preview.scss +82 -41
  50. package/app/styles/components/_sd-searchbar.scss +79 -51
  51. package/app/styles/components/_sd-toaster.scss +52 -30
  52. package/app/styles/components/_subnav.scss +230 -135
  53. package/app/styles/components/_theme-selector.scss +78 -53
  54. package/app/styles/components/sd-slider.scss +11 -7
  55. package/app/styles/design-tokens/_design-tokens-general.scss +31 -27
  56. package/app/styles/design-tokens/_new-colors.scss +3 -1
  57. package/app/styles/dropdowns/_basic-dropdown.scss +164 -86
  58. package/app/styles/dropdowns/_input-dropdown.scss +5 -2
  59. package/app/styles/dropdowns/_navigation_dropdown.scss +18 -4
  60. package/app/styles/dropdowns/_nested-dropdown.scss +11 -2
  61. package/app/styles/dropdowns/_other_dropdown.scss +9 -3
  62. package/app/styles/editor/_editor-buttons.scss +10 -6
  63. package/app/styles/editor/_editor-themes.scss +401 -350
  64. package/app/styles/form-elements/_autocomplete.scss +7 -1
  65. package/app/styles/form-elements/_checkbox.scss +230 -159
  66. package/app/styles/form-elements/_forms-general.scss +345 -285
  67. package/app/styles/form-elements/_input-preview.scss +15 -9
  68. package/app/styles/form-elements/_input-wrap.scss +77 -71
  69. package/app/styles/form-elements/_inputs.scss +668 -489
  70. package/app/styles/form-elements/_radio.scss +10 -5
  71. package/app/styles/form-elements/_switch.scss +27 -16
  72. package/app/styles/grids/_basic-grid.scss +83 -64
  73. package/app/styles/grids/_grid-layout.scss +301 -165
  74. package/app/styles/grids/_layout-grid.scss +85 -59
  75. package/app/styles/grids/_sd-kanban-list.scss +14 -4
  76. package/app/styles/interface-elements/_side-panel.scss +279 -200
  77. package/app/styles/layout/_basic-layout.scss +36 -34
  78. package/app/styles/layout/_container.scss +38 -31
  79. package/app/styles/layout/_editor.scss +57 -17
  80. package/app/styles/layout/_general.scss +81 -67
  81. package/app/styles/menus/_sd-bottom-tabs.scss +21 -12
  82. package/app/styles/menus/_sd-content-navigation.scss +20 -16
  83. package/app/styles/menus/_sd-left-navigation.scss +62 -49
  84. package/app/styles/menus/_sd-sidebar-menu.scss +365 -323
  85. package/app/styles/menus/_sd-top-menu.scss +16 -7
  86. package/app/styles/primereact/_pr-autocomplete.scss +2 -0
  87. package/app/styles/primereact/_pr-datepicker.scss +13 -2
  88. package/app/styles/primereact/_pr-dialog.scss +55 -47
  89. package/app/styles/primereact/_pr-dropdown.scss +27 -22
  90. package/app/styles/primereact/_pr-general.scss +3 -0
  91. package/app/styles/primereact/_pr-menu.scss +2 -1
  92. package/app/styles/primereact/_pr-skeleton.scss +1 -0
  93. package/app/styles/primereact/_pr-tag-input.scss +1 -0
  94. package/app/styles/variables/_colors.scss +168 -170
  95. package/app/styles/variables/_typography.scss +1 -2
  96. package/app-typescript/components/Form/InputWrapper.tsx +1 -1
  97. package/app-typescript/components/Menu.tsx +1 -1
  98. package/app-typescript/components/{TreeSelect.tsx → TreeSelect/TreeSelect.tsx} +228 -257
  99. package/app-typescript/components/TreeSelect/TreeSelectItem.tsx +84 -0
  100. package/app-typescript/components/TreeSelect/TreeSelectPill.tsx +53 -0
  101. package/app-typescript/index.ts +1 -1
  102. package/dist/examples.bundle.css +18 -16
  103. package/dist/examples.bundle.js +1029 -918
  104. package/dist/react/TreeSelect.tsx +1 -1
  105. package/dist/superdesk-ui.bundle.css +4265 -3552
  106. package/dist/superdesk-ui.bundle.js +776 -665
  107. package/dist/vendor.bundle.js +23 -23
  108. package/examples/pages/react/TreeSelect.tsx +1 -1
  109. package/package.json +2 -2
  110. package/react/components/Form/InputWrapper.d.ts +1 -1
  111. package/react/components/Menu.js +1 -1
  112. package/react/components/{TreeSelect.d.ts → TreeSelect/TreeSelect.d.ts} +2 -2
  113. package/react/components/{TreeSelect.js → TreeSelect/TreeSelect.js} +82 -144
  114. package/react/components/TreeSelect/TreeSelectItem.d.ts +20 -0
  115. package/react/components/TreeSelect/TreeSelectItem.js +90 -0
  116. package/react/components/TreeSelect/TreeSelectPill.d.ts +14 -0
  117. package/react/components/TreeSelect/TreeSelectPill.js +71 -0
  118. package/react/index.d.ts +1 -1
  119. package/react/index.js +1 -1
@@ -0,0 +1,84 @@
1
+ import * as React from "react";
2
+ import { Icon } from "../Icon";
3
+ import {getTextColor} from '../Label';
4
+ import {ITreeNode} from './TreeSelect';
5
+
6
+ export function getPrefixedItemId(id: string) {
7
+ return id + '-focus';
8
+ }
9
+
10
+ interface IProps<T> {
11
+ option: ITreeNode<T>;
12
+ selectedItem: boolean;
13
+ allowMultiple?: boolean;
14
+ handleTree(event: React.MouseEvent<HTMLLIElement, MouseEvent>, option: ITreeNode<T>): any;
15
+ getLabel(item: T): string;
16
+ getId(item: T): string;
17
+ getBackgroundColor?(item: T): string;
18
+ getBorderColor?(item: T): string;
19
+ optionTemplate?(item: T): React.ComponentType<T> | JSX.Element;
20
+ onClick?: () => void;
21
+ onKeyDown?: () => void;
22
+ }
23
+
24
+ export class TreeSelectItem<T> extends React.Component<IProps<T>> {
25
+ render() {
26
+ return (
27
+ <li
28
+ className='suggestion-item suggestion-item--multi-select'
29
+ onClick={(event) => {
30
+ this.props.onClick?.();
31
+ event.preventDefault();
32
+ event.stopPropagation();
33
+ this.props.handleTree(event, this.props.option);
34
+ }}
35
+ >
36
+ <button
37
+ // the className is generated in order to focus the element later
38
+ className={`suggestion-item--btn ${getPrefixedItemId(this.props.getId(this.props.option.value))}`}
39
+ onKeyDown={(event) => {
40
+ if (event.key === 'Enter' && this.props.option.children) {
41
+ this.props.onKeyDown?.();
42
+ }
43
+ }}
44
+ >
45
+ {(this.props.getBorderColor && !this.props.allowMultiple)
46
+ && <div
47
+ className="item-border"
48
+ style={{
49
+ backgroundColor: this.props.getBorderColor(this.props.option.value),
50
+ }}
51
+ >
52
+ </div>
53
+ }
54
+
55
+ <span
56
+ className={
57
+ 'suggestion-item--bgcolor'
58
+ + (this.props.selectedItem ? ' suggestion-item--disabled' : '')}
59
+ style={
60
+ (this.props.getBackgroundColor && this.props.option.value)
61
+ ? {
62
+ backgroundColor: this.props.getBackgroundColor(this.props.option.value),
63
+ color: getTextColor(this.props.getBackgroundColor(this.props.option.value),
64
+ ),
65
+ }
66
+ : undefined
67
+ }
68
+ >
69
+ {this.props.optionTemplate
70
+ ? this.props.optionTemplate(this.props.option.value)
71
+ : this.props.getLabel(this.props.option.value)
72
+ }
73
+ </span>
74
+
75
+ {this.props.option.children
76
+ && <span className="suggestion-item__icon">
77
+ <Icon name="chevron-right-thin"></Icon>
78
+ </span>
79
+ }
80
+ </button>
81
+ </li>
82
+ );
83
+ }
84
+ }
@@ -0,0 +1,53 @@
1
+ import * as React from "react";
2
+ import {Icon} from "../Icon";
3
+ import {getTextColor} from '../Label';
4
+
5
+ interface IProps<T> {
6
+ item: T;
7
+ readOnly?: boolean;
8
+ disabled?: boolean;
9
+ backgroundColor: string | undefined;
10
+ onRemove(): void;
11
+ valueTemplate?(item: T, Wrapper: React.ElementType): React.ComponentType<T> | JSX.Element;
12
+ getBackgroundColor?(item: T): string;
13
+ }
14
+
15
+ export class TreeSelectPill<T> extends React.Component<IProps<T>> {
16
+ render() {
17
+ return (
18
+ <li
19
+ className={
20
+ "tags-input__tag-item tags-input__tag-item--multi-select"
21
+ + (this.props.readOnly ? ' tags-input__tag-item--readonly' : '')
22
+ }
23
+ onClick={() => (!this.props.readOnly && !this.props.disabled)
24
+ && this.props.onRemove()
25
+ }
26
+ style={
27
+ this.props.valueTemplate
28
+ ? {backgroundColor: this.props.backgroundColor}
29
+ : this.props.getBackgroundColor
30
+ && {backgroundColor: this.props.getBackgroundColor(this.props.item)}
31
+ }
32
+ >
33
+ <span
34
+ className="tags-input__helper-box"
35
+ style={{
36
+ color: this.props.backgroundColor
37
+ ? getTextColor(this.props.backgroundColor)
38
+ : this.props.getBackgroundColor
39
+ && getTextColor(this.props.getBackgroundColor(this.props.item)),
40
+ }}
41
+ >
42
+ {this.props.children}
43
+
44
+ {!this.props.readOnly
45
+ && <span className="tags-input__remove-button">
46
+ <Icon name="close-small"></Icon>
47
+ </span>
48
+ }
49
+ </span>
50
+ </li>
51
+ );
52
+ }
53
+ }
@@ -90,7 +90,7 @@ export { Text } from './components/Text/Text';
90
90
  export { Time } from './components/Text/Time';
91
91
  export { Heading } from './components/Text/Heading';
92
92
  export { BottomNav } from './components/Navigation/BottomNav';
93
- export { TreeSelect } from './components/TreeSelect';
93
+ export { TreeSelect } from './components/TreeSelect/TreeSelect';
94
94
  export { TableList, TableListItem } from './components/Lists/TableList';
95
95
  export { ContentListItem } from './components/Lists/ContentList';
96
96
  export { MultiSelect } from './components/MultiSelect';
@@ -12012,19 +12012,20 @@ doc-react-playground {
12012
12012
  padding: 1px;
12013
12013
  z-index: 1;
12014
12014
  opacity: 1 !important; }
12015
- .icn-mix--2x {
12016
- font-size: 32px;
12017
- height: 32px; }
12018
- .icn-mix--2x .icn-mix__icn {
12019
- opacity: 0.6;
12020
- width: 32px;
12021
- height: 32px;
12022
- line-height: 32px;
12023
- font-size: 32px; }
12024
- .icn-mix--2x .icn-mix__sub-icn {
12025
- font-size: 1.6rem;
12026
- inset-inline-end: -0.6rem;
12027
- inset-block-end: -0.3rem; }
12015
+
12016
+ .icn-mix--2x {
12017
+ font-size: 32px;
12018
+ height: 32px; }
12019
+ .icn-mix--2x .icn-mix__icn {
12020
+ opacity: 0.6;
12021
+ width: 32px;
12022
+ height: 32px;
12023
+ line-height: 32px;
12024
+ font-size: 32px; }
12025
+ .icn-mix--2x .icn-mix__sub-icn {
12026
+ font-size: 1.6rem;
12027
+ inset-inline-end: -0.6rem;
12028
+ inset-block-end: -0.3rem; }
12028
12029
 
12029
12030
  .double-size-icn {
12030
12031
  display: inline-block;
@@ -12036,9 +12037,10 @@ doc-react-playground {
12036
12037
  height: 32px;
12037
12038
  line-height: 32px;
12038
12039
  font-size: 32px; }
12039
- .double-size-icn--light [class^="icon-"],
12040
- .double-size-icn--light [class*=" icon-"] {
12041
- opacity: 0.5; }
12040
+
12041
+ .double-size-icn--light [class^="icon-"],
12042
+ .double-size-icn--light [class*=" icon-"] {
12043
+ opacity: 0.5; }
12042
12044
 
12043
12045
  .subnav .icn-mix__sub-icn {
12044
12046
  background-color: var(--sd-colour-panel-bg--100) !important; }