superdesk-ui-framework 3.0.54 → 3.0.56

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.
@@ -283,131 +283,131 @@ tags-input,
283
283
  opacity: 1;
284
284
  }
285
285
  }
286
+ }
286
287
 
287
- .autocomplete {
288
- position: absolute;
289
- padding: 0.5rem 0;
290
- z-index: 999;
291
- width: 100%;
292
- background-color: var(--color-dropdown-menu-Bg);
293
- box-shadow: $shadow__dropdown--default;
288
+ .autocomplete {
289
+ position: absolute;
290
+ padding: 0.5rem 0;
291
+ z-index: 999;
292
+ width: 100%;
293
+ background-color: var(--color-dropdown-menu-Bg);
294
+ box-shadow: $shadow__dropdown--default;
294
295
 
295
- .suggestion-list {
296
- margin: 0;
297
- padding: 0;
298
- list-style-type: none;
299
- max-height: 28rem;
300
- overflow-y: auto;
301
- position: relative;
302
- }
296
+ .suggestion-list {
297
+ margin: 0;
298
+ padding: 0;
299
+ list-style-type: none;
300
+ max-height: 28rem;
301
+ overflow-y: auto;
302
+ position: relative;
303
+ }
303
304
 
304
- .suggestion-list--multi-select {
305
- padding: 4px 0 !important;
306
- min-height: 40px;
307
- }
305
+ .suggestion-list--multi-select {
306
+ padding: 4px 0 !important;
307
+ min-height: 40px;
308
+ }
308
309
 
309
- .suggestion-list--loader {
310
- padding: 4px 0 !important;
310
+ .suggestion-list--loader {
311
+ padding: 4px 0 !important;
312
+ position: relative;
313
+ min-height: 3.2rem;
314
+ >div {
315
+ padding: 0.5rem 1rem;
316
+ min-height: $sd-base-increment * 4;
311
317
  position: relative;
312
- min-height: 3.2rem;
313
- >div {
314
- padding: 0.5rem 1rem;
315
- min-height: $sd-base-increment * 4;
316
- position: relative;
317
- }
318
318
  }
319
+ }
319
320
 
320
- .suggestion-item {
321
- position: relative;
322
- white-space: nowrap;
323
- overflow: hidden;
324
- text-overflow: ellipsis;
325
- color: $sd-text;
326
- transition: all ease 0.2s;
327
- min-height: $sd-base-increment * 4;
328
-
329
- &.selected {
330
- background-color: var(--sd-colour-interactive--alpha-30);
321
+ .suggestion-item {
322
+ position: relative;
323
+ white-space: nowrap;
324
+ overflow: hidden;
325
+ text-overflow: ellipsis;
326
+ color: $sd-text;
327
+ transition: all ease 0.2s;
328
+ min-height: $sd-base-increment * 4;
331
329
 
332
- &:active {
333
- background-color: var(--sd-colour-interactive--alpha-70);
334
- color: $white;
335
- }
336
- }
330
+ &.selected {
331
+ background-color: var(--sd-colour-interactive--alpha-30);
337
332
 
338
- &[disabled], &[disabled]:hover, &[disabled]:active {
339
- background-color: transparent;
340
- opacity: 0.45;
341
- cursor: default;
342
- pointer-events: none;
333
+ &:active {
334
+ background-color: var(--sd-colour-interactive--alpha-70);
335
+ color: $white;
343
336
  }
337
+ }
344
338
 
345
- .suggestion-item__icon {
346
- display: flex;
347
- align-items: center;
348
- justify-content: center;
349
- opacity: 0.5;
350
- }
339
+ &[disabled], &[disabled]:hover, &[disabled]:active {
340
+ background-color: transparent;
341
+ opacity: 0.45;
342
+ cursor: default;
343
+ pointer-events: none;
351
344
  }
352
345
 
353
- .suggestion-item--multi-select {
346
+ .suggestion-item__icon {
354
347
  display: flex;
355
348
  align-items: center;
349
+ justify-content: center;
350
+ opacity: 0.5;
356
351
  }
352
+ }
357
353
 
358
- .suggestion-item--btn {
359
- display: flex;
360
- justify-content: space-between;
361
- align-items: center;
362
- cursor: pointer;
363
- width: 100%;
364
- padding: 0.5rem 1rem;
354
+ .suggestion-item--multi-select {
355
+ display: flex;
356
+ align-items: center;
357
+ }
365
358
 
366
- &:focus {
367
- background-color: $sd-colour-background__menu-item;
368
- box-shadow: var(--sd-shadow__menu-item--focus-inner);
369
- text-decoration: none;
370
- outline: none;
371
- }
359
+ .suggestion-item--btn {
360
+ display: flex;
361
+ justify-content: space-between;
362
+ align-items: center;
363
+ cursor: pointer;
364
+ width: 100%;
365
+ padding: 0.5rem 1rem;
372
366
 
373
- &:hover {
374
- background-color: var(--sd-colour-interactive--alpha-10) !important;
375
- }
367
+ &:focus {
368
+ background-color: $sd-colour-background__menu-item;
369
+ box-shadow: var(--sd-shadow__menu-item--focus-inner);
370
+ text-decoration: none;
371
+ outline: none;
376
372
  }
377
373
 
378
- .suggestion-item--bgcolor {
379
- min-height: 1.5em;
380
- min-width: 1.5em;
381
- padding: 4px 0;
382
- display: inline-flex;
383
- justify-content: center;
384
- align-items: center;
385
- border-radius: 99px;
386
- white-space: nowrap;
387
-
388
- &[style*="background-color"] {
389
- padding-inline: 8px;
390
- }
374
+ &:hover {
375
+ background-color: var(--sd-colour-interactive--alpha-10) !important;
391
376
  }
377
+ }
392
378
 
393
- .suggestion-item--disabled {
394
- opacity: 0.5;
395
- }
379
+ .suggestion-item--bgcolor {
380
+ min-height: 1.5em;
381
+ min-width: 1.5em;
382
+ padding: 4px 0;
383
+ display: inline-flex;
384
+ justify-content: center;
385
+ align-items: center;
386
+ border-radius: 99px;
387
+ white-space: nowrap;
396
388
 
397
- .suggestion-item--nothing-found {
398
- padding: 0.5rem 1rem;
399
- cursor: not-allowed;
400
- white-space: nowrap;
401
- overflow: hidden;
402
- text-overflow: ellipsis;
403
- color: $sd-text-light;
404
- transition: all ease 0.2s;
405
- min-height: $sd-base-increment * 4;
406
- display: flex;
407
- align-items: center;
408
- justify-content: center;
389
+ &[style*="background-color"] {
390
+ padding-inline: 8px;
409
391
  }
410
392
  }
393
+
394
+ .suggestion-item--disabled {
395
+ opacity: 0.5;
396
+ }
397
+
398
+ .suggestion-item--nothing-found {
399
+ padding: 0.5rem 1rem;
400
+ cursor: not-allowed;
401
+ white-space: nowrap;
402
+ overflow: hidden;
403
+ text-overflow: ellipsis;
404
+ color: $sd-text-light;
405
+ transition: all ease 0.2s;
406
+ min-height: $sd-base-increment * 4;
407
+ display: flex;
408
+ align-items: center;
409
+ justify-content: center;
410
+ }
411
411
  }
412
412
 
413
413
  //TESTING TAG INPUT REACT NEW CSS
@@ -463,140 +463,140 @@ tags-input,
463
463
  display: flex;
464
464
  align-items: center;
465
465
  }
466
+ }
466
467
 
467
- .autocomplete {
468
- position: absolute;
469
- padding: 0;
470
- padding-block-start: 0.5rem;
471
- padding-block-end: 0.5rem;
472
- z-index: 999;
473
- width: 100%;
474
- border-radius: $border-radius__base--small;
475
- background-color: var(--color-dropdown-menu-Bg);
476
- box-shadow: $shadow__dropdown--default;
477
-
478
- .autocomplete__header {
479
- display: flex;
480
- align-items: center;
481
- justify-content: center;
482
- gap: 4px;
483
- border-bottom: 1px solid var(--sd-colour-line--light);
484
- padding: 4px;
485
- }
468
+ .autocomplete {
469
+ position: absolute;
470
+ padding: 0;
471
+ padding-block-start: 0.5rem;
472
+ padding-block-end: 0.5rem;
473
+ z-index: 999;
474
+ width: 100%;
475
+ border-radius: $border-radius__base--small;
476
+ background-color: var(--color-dropdown-menu-Bg);
477
+ box-shadow: $shadow__dropdown--default;
486
478
 
487
- .autocomplete__category-header {
488
- display: flex;
489
- align-items: center;
490
- justify-content: center;
491
- gap: 4px;
492
- border-bottom: 1px solid var(--sd-colour-line--x-light);
493
- padding: 4px;
494
- }
479
+ .autocomplete__header {
480
+ display: flex;
481
+ align-items: center;
482
+ justify-content: center;
483
+ gap: 4px;
484
+ border-bottom: 1px solid var(--sd-colour-line--light);
485
+ padding: 4px;
486
+ }
495
487
 
496
- .autocomplete__icon {
497
- display: flex;
498
- align-items: center;
499
- justify-content: center;
500
- height: 35px;
501
- width: 35px;
502
- &:hover .arrow-left {
503
- color: var(--sd-colour-interactive--alpha-70);
504
- transition: 0.2s;
505
- transform: translate(-3px);
506
- }
507
- .arrow-left {
508
- cursor: pointer;
509
- }
510
- .search {
511
- cursor: default;
512
- opacity: 0.65;
513
- }
514
- }
488
+ .autocomplete__category-header {
489
+ display: flex;
490
+ align-items: center;
491
+ justify-content: center;
492
+ gap: 4px;
493
+ border-bottom: 1px solid var(--sd-colour-line--x-light);
494
+ padding: 4px;
495
+ }
515
496
 
516
- .autocomplete__filter {
517
- height: 32px;
518
- width: 100%;
519
- display: flex;
520
- align-items: center;
521
- gap: 4px;
497
+ .autocomplete__icon {
498
+ display: flex;
499
+ align-items: center;
500
+ justify-content: center;
501
+ height: 35px;
502
+ width: 35px;
503
+ &:hover .arrow-left {
504
+ color: var(--sd-colour-interactive--alpha-70);
505
+ transition: 0.2s;
506
+ transform: translate(-3px);
507
+ }
508
+ .arrow-left {
509
+ cursor: pointer;
522
510
  }
523
-
524
- .autocomplete__button {
525
- height: 32px;
526
- padding: 0 15px;
527
- font-weight: 600;
528
- width: auto;
511
+ .search {
529
512
  cursor: default;
530
- margin-inline-start: auto;
513
+ opacity: 0.65;
531
514
  }
515
+ }
532
516
 
533
- .autocomplete__category-title {
534
- font-weight: 600;
535
- padding: 0;
536
- cursor: default;
537
- }
517
+ .autocomplete__filter {
518
+ height: 32px;
519
+ width: 100%;
520
+ display: flex;
521
+ align-items: center;
522
+ gap: 4px;
523
+ }
538
524
 
539
- .autocomplete__input {
540
- height: 32px;
541
- width: 100%;
542
- padding: 4px;
543
- border: none;
544
- background-color: transparent;
545
- color: var(--color-text);
525
+ .autocomplete__button {
526
+ height: 32px;
527
+ padding: 0 15px;
528
+ font-weight: 600;
529
+ width: auto;
530
+ cursor: default;
531
+ margin-inline-start: auto;
532
+ }
546
533
 
547
- &::placeholder {
548
- color: var(--color-text-lighter);
549
- font-weight: 300;
550
- //font-style: italic;
551
- }
534
+ .autocomplete__category-title {
535
+ font-weight: 600;
536
+ padding: 0;
537
+ cursor: default;
538
+ }
539
+
540
+ .autocomplete__input {
541
+ height: 32px;
542
+ width: 100%;
543
+ padding: 4px;
544
+ border: none;
545
+ background-color: transparent;
546
+ color: var(--color-text);
547
+
548
+ &::placeholder {
549
+ color: var(--color-text-lighter);
550
+ font-weight: 300;
551
+ //font-style: italic;
552
552
  }
553
+ }
553
554
 
554
- .autocomplete__button--multi-select {
555
- background-color: transparent;
556
- border: 1px solid var(--sd-colour-interactive--alpha-50);
557
- border-radius: var(--b-radius--small);
558
- color: var(--sd-colour-interactive);
559
- cursor: pointer;
560
- transition: all ease 0.2s;
561
- font-size: 1.3rem;
562
- font-weight: 400;
563
- margin-inline-end: $sd-base-increment;
564
- height: 2.8rem;
555
+ .autocomplete__button--multi-select {
556
+ background-color: transparent;
557
+ border: 1px solid var(--sd-colour-interactive--alpha-50);
558
+ border-radius: var(--b-radius--small);
559
+ color: var(--sd-colour-interactive);
560
+ cursor: pointer;
561
+ transition: all ease 0.2s;
562
+ font-size: 1.3rem;
563
+ font-weight: 400;
564
+ margin-inline-end: $sd-base-increment;
565
+ height: 2.8rem;
565
566
 
566
- &:hover {
567
- border: 1px solid var(--sd-colour-interactive);
568
- box-shadow: inset 0 0 0 2px var(--sd-colour-interactive--alpha-20);
569
- }
567
+ &:hover {
568
+ border: 1px solid var(--sd-colour-interactive);
569
+ box-shadow: inset 0 0 0 2px var(--sd-colour-interactive--alpha-20);
570
+ }
570
571
 
571
- &:focus {
572
- border: 1px solid var(--sd-colour-interactive);
573
- box-shadow: inset 0 0 0 2px var(--sd-colour-interactive--alpha-20);
574
- }
572
+ &:focus {
573
+ border: 1px solid var(--sd-colour-interactive);
574
+ box-shadow: inset 0 0 0 2px var(--sd-colour-interactive--alpha-20);
575
+ }
575
576
 
576
- &:active {
577
- border: 1px solid var(--sd-colour-interactive);
578
- box-shadow: inset 0 0 0 3px var(--sd-colour-interactive--alpha-30);
579
- }
577
+ &:active {
578
+ border: 1px solid var(--sd-colour-interactive);
579
+ box-shadow: inset 0 0 0 3px var(--sd-colour-interactive--alpha-30);
580
+ }
580
581
 
581
- &.autocomplete__button--disabled,
582
- &.autocomplete__button--disabled:hover {
583
- opacity: 0.75;
584
- border: 1px solid var(--sd-colour-line--light);
585
- color: var(--color-text-light);
586
- cursor: not-allowed;
587
- box-shadow: none;
588
- }
582
+ &.autocomplete__button--disabled,
583
+ &.autocomplete__button--disabled:hover {
584
+ opacity: 0.75;
585
+ border: 1px solid var(--sd-colour-line--light);
586
+ color: var(--color-text-light);
587
+ cursor: not-allowed;
588
+ box-shadow: none;
589
589
  }
590
590
  }
591
+ }
591
592
 
592
- .autocomplete--multi-select {
593
- padding: 0 !important;
594
- margin-block-start: 0;
595
- }
593
+ .autocomplete--multi-select {
594
+ padding: 0 !important;
595
+ margin-block-start: 0;
596
+ }
596
597
 
597
- .autocomplete--fixed-width {
598
- width: 275px !important;
599
- }
598
+ .autocomplete--fixed-width {
599
+ width: 275px !important;
600
600
  }
601
601
 
602
602
  .tags-input--single-select {
@@ -691,5 +691,3 @@ tags-input,
691
691
  inset-block: 5px;
692
692
  }
693
693
  }
694
-
695
-
@@ -37,6 +37,7 @@ interface IDatePickerBase extends IInputWrapper {
37
37
  interface IDatePicker extends IDatePickerBase {
38
38
  value: Date | null;
39
39
  onChange(valueNext: Date | null): void;
40
+ 'data-test-id'?: string;
40
41
  }
41
42
 
42
43
  const internalPrimereactClassnames = {
@@ -160,6 +161,13 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
160
161
  ariaLabelledBy={this.htmlId + 'label'}
161
162
  ref={(ref) => {
162
163
  this.instance = ref as unknown as IPrivatePrimeReactCalendarApi;
164
+
165
+ const refAny: any = ref;
166
+
167
+ if (this.props['data-test-id'] != null && refAny?.inputElement != null) {
168
+ refAny.inputElement.setAttribute('data-test-id', this.props['data-test-id']);
169
+ }
170
+
163
171
  }}
164
172
  value={this.state.value === null ? undefined : this.state.value}
165
173
  onChange={(event) => {
@@ -6,6 +6,7 @@ interface IPropsBase extends IInputCommon {
6
6
  maxLength?: number;
7
7
  placeholder?: string;
8
8
  size?: 'medium' | 'large' | 'x-large'; // default: 'medium'
9
+ 'data-test-id'?: string;
9
10
  }
10
11
 
11
12
  interface IPropsText extends IPropsBase {
@@ -83,6 +84,7 @@ export class Input extends React.Component<IProps> {
83
84
  onChange={this.handleChange}
84
85
  placeholder={this.props.placeholder}
85
86
  disabled={this.props.disabled}
87
+ data-test-id={this.props['data-test-id']}
86
88
  />
87
89
  </InputWrapper>
88
90
  );
@@ -23,6 +23,7 @@ interface IProps {
23
23
  required?: boolean;
24
24
  tabindex?: number;
25
25
  onChange(nextValue: string): void;
26
+ 'data-test-id'?: string;
26
27
  }
27
28
 
28
29
  export class RadioButtonGroup extends React.Component<IProps> {
@@ -50,7 +51,12 @@ export class RadioButtonGroup extends React.Component<IProps> {
50
51
  return (
51
52
  <React.Fragment>
52
53
  {!this.props.group?.groupLabel ?
53
- <div role="radiogroup" className={classes} aria-labelledby={this.props.group?.groupLabelledBy}>{
54
+ <div
55
+ role="radiogroup"
56
+ className={classes}
57
+ aria-labelledby={this.props.group?.groupLabelledBy}
58
+ data-test-id={this.props['data-test-id']}
59
+ >{
54
60
  this.props.options.map((item: any, index: number) => (
55
61
  <span className="sd-check-button sd-check-button--native"
56
62
  key={index}
@@ -64,8 +70,12 @@ export class RadioButtonGroup extends React.Component<IProps> {
64
70
  disabled={item.disabled}
65
71
  required={this.props.required}
66
72
  checked={item.value === this.props.value} />
67
- <label className="sd-check-button__text-label" htmlFor={this.htmlId + index}
68
- aria-label={item.labelHidden ? item.label : undefined}>
73
+ <label
74
+ className="sd-check-button__text-label"
75
+ htmlFor={this.htmlId + index}
76
+ aria-label={item.labelHidden ? item.label : undefined}
77
+ data-test-id="item"
78
+ >
69
79
 
70
80
  { item.icon ? <i className={`icon-${item.icon}`} aria-hidden="true" /> : null }
71
81
  { !item.labelHidden || !item.icon ?
@@ -76,7 +86,7 @@ export class RadioButtonGroup extends React.Component<IProps> {
76
86
  }</div>
77
87
  : null }
78
88
  {this.props.group?.groupLabel ?
79
- <div className='sd-check-button__group-wrapper'>
89
+ <div className='sd-check-button__group-wrapper' data-test-id={this.props['data-test-id']}>
80
90
 
81
91
  <FormLabel forId={this.htmlId + 'group'} text={this.props.group.groupLabel} />
82
92
  <div role="radiogroup" id={this.htmlId + 'group'} className={classes}>{
@@ -7,6 +7,7 @@ interface ITabs {
7
7
  children: Array<any>;
8
8
  onClick(i: number): void;
9
9
  initiallySelectedIndex?: number;
10
+ 'data-test-id'?: string;
10
11
  }
11
12
 
12
13
  interface ITabLabel {
@@ -31,7 +32,8 @@ export const TabLabel = ({label}: ITabLabel) => {
31
32
  );
32
33
  };
33
34
 
34
- export const Tabs = ({initiallySelectedIndex, size, theme, ariaLabel, children, onClick}: ITabs) => {
35
+ export const Tabs = (props: ITabs) => {
36
+ const {initiallySelectedIndex, size, theme, ariaLabel, children, onClick} = props;
35
37
  const [index, setIndex] = React.useState(initiallySelectedIndex ?? 0);
36
38
 
37
39
  function handleSelected(i: number) {
@@ -49,7 +51,12 @@ export const Tabs = ({initiallySelectedIndex, size, theme, ariaLabel, children,
49
51
  });
50
52
 
51
53
  return (
52
- <div className={classes} role='tablist' aria-label={ariaLabel ? ariaLabel : 'tabs'}>
54
+ <div
55
+ className={classes}
56
+ role='tablist'
57
+ aria-label={ariaLabel ? ariaLabel : 'tabs'}
58
+ data-test-id={props['data-test-id']}
59
+ >
53
60
  {
54
61
  children.map((item, i) => (
55
62
  <button
@@ -7,6 +7,7 @@ interface IProps extends IInputWrapper {
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
9
  allowSeconds?: boolean;
10
+ 'data-test-id'?: string;
10
11
  }
11
12
 
12
13
  export class TimePicker extends React.PureComponent<IProps> {
@@ -46,6 +47,7 @@ export class TimePicker extends React.PureComponent<IProps> {
46
47
  onChange={(event) => {
47
48
  this.props.onChange(event.target.value);
48
49
  }}
50
+ data-test-id={this.props['data-test-id']}
49
51
  />
50
52
  </InputWrapper>
51
53
  );