@equinor/eds-core-react 0.20.4 → 0.20.5-dev.20220701

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.
@@ -75,8 +75,8 @@ const {
75
75
  focused: outline
76
76
  },
77
77
  clickbounds: {
78
- default__base: clicboundHeight$1,
79
- compact__standard: compactClickboundHeight$1
78
+ default__base: clicboundHeight$2,
79
+ compact__standard: compactClickboundHeight$2
80
80
  }
81
81
  } = edsTokens.tokens;
82
82
  const button = {
@@ -100,10 +100,10 @@ const button = {
100
100
  right: "var(--eds_button__padding_x, ".concat(medium$6, ")")
101
101
  },
102
102
  clickbound: {
103
- height: clicboundHeight$1,
103
+ height: clicboundHeight$2,
104
104
  width: '100%',
105
105
  offset: {
106
- top: "".concat((parseInt(clicboundHeight$1) - parseInt(buttonHeight)) / 2 + 1, "px"),
106
+ top: "".concat((parseInt(clicboundHeight$2) - parseInt(buttonHeight)) / 2 + 1, "px"),
107
107
  left: '0'
108
108
  }
109
109
  },
@@ -154,10 +154,10 @@ const button = {
154
154
  bottom: 'var(--eds_button__padding_y_compact, 0)'
155
155
  },
156
156
  clickbound: {
157
- height: compactClickboundHeight$1,
157
+ height: compactClickboundHeight$2,
158
158
  width: '100%',
159
159
  offset: {
160
- top: "".concat((parseInt(compactClickboundHeight$1) - parseInt(compactButtonHeight)) / 2 + 1, "px"),
160
+ top: "".concat((parseInt(compactClickboundHeight$2) - parseInt(compactButtonHeight)) / 2 + 1, "px"),
161
161
  left: '0'
162
162
  }
163
163
  }
@@ -419,7 +419,7 @@ const {
419
419
  }
420
420
  }
421
421
  } = edsTokens.tokens;
422
- const primary$9 = mergeDeepRight(button, {
422
+ const primary$a = mergeDeepRight(button, {
423
423
  background: primaryColor$8,
424
424
  typography: {
425
425
  color: primaryWhite
@@ -437,7 +437,7 @@ const primary$9 = mergeDeepRight(button, {
437
437
  }
438
438
  }
439
439
  });
440
- const secondary$4 = mergeDeepRight(primary$9, {
440
+ const secondary$5 = mergeDeepRight(primary$a, {
441
441
  background: secondaryColor$3,
442
442
  border: {
443
443
  color: secondaryColor$3
@@ -451,7 +451,7 @@ const secondary$4 = mergeDeepRight(primary$9, {
451
451
  }
452
452
  }
453
453
  });
454
- const danger$5 = mergeDeepRight(primary$9, {
454
+ const danger$6 = mergeDeepRight(primary$a, {
455
455
  background: dangerColor$3,
456
456
  border: {
457
457
  color: dangerColor$3
@@ -504,7 +504,7 @@ const {
504
504
  }
505
505
  }
506
506
  } = edsTokens.tokens;
507
- const primary$8 = mergeDeepRight(button, {
507
+ const primary$9 = mergeDeepRight(button, {
508
508
  typography: {
509
509
  color: primaryColor$7
510
510
  },
@@ -533,7 +533,7 @@ const primary$8 = mergeDeepRight(button, {
533
533
  }
534
534
  }
535
535
  });
536
- const secondary$3 = mergeDeepRight(primary$8, {
536
+ const secondary$4 = mergeDeepRight(primary$9, {
537
537
  typography: {
538
538
  color: secondaryColor$2
539
539
  },
@@ -552,7 +552,7 @@ const secondary$3 = mergeDeepRight(primary$8, {
552
552
  }
553
553
  }
554
554
  });
555
- const danger$4 = mergeDeepRight(primary$8, {
555
+ const danger$5 = mergeDeepRight(primary$9, {
556
556
  typography: {
557
557
  color: dangerColor$2
558
558
  },
@@ -605,7 +605,7 @@ const {
605
605
  }
606
606
  }
607
607
  } = edsTokens.tokens;
608
- const primary$7 = mergeDeepRight(button, {
608
+ const primary$8 = mergeDeepRight(button, {
609
609
  typography: {
610
610
  color: primaryColor$6
611
611
  },
@@ -624,7 +624,7 @@ const primary$7 = mergeDeepRight(button, {
624
624
  }
625
625
  }
626
626
  });
627
- const secondary$2 = mergeDeepRight(primary$7, {
627
+ const secondary$3 = mergeDeepRight(primary$8, {
628
628
  typography: {
629
629
  color: secondaryColor$1
630
630
  },
@@ -637,7 +637,7 @@ const secondary$2 = mergeDeepRight(primary$7, {
637
637
  }
638
638
  }
639
639
  });
640
- const danger$3 = mergeDeepRight(primary$7, {
640
+ const danger$4 = mergeDeepRight(primary$8, {
641
641
  typography: {
642
642
  color: dangerColor$1
643
643
  },
@@ -681,19 +681,19 @@ const {
681
681
  }
682
682
  },
683
683
  clickbounds: {
684
- default__base: clicboundHeight,
685
- compact__standard: compactClickboundHeight
684
+ default__base: clicboundHeight$1,
685
+ compact__standard: compactClickboundHeight$1
686
686
  },
687
- shape: shape$3,
687
+ shape: shape$4,
688
688
  interactions: {
689
689
  focused: {
690
690
  width: focusOutlineWidth$8
691
691
  }
692
692
  }
693
693
  } = edsTokens.tokens;
694
- const primary$6 = mergeDeepRight(button, {
695
- height: shape$3.icon_button.minHeight,
696
- width: shape$3.icon_button.minWidth,
694
+ const primary$7 = mergeDeepRight(button, {
695
+ height: shape$4.icon_button.minHeight,
696
+ width: shape$4.icon_button.minWidth,
697
697
  typography: {
698
698
  color: primaryColor$5
699
699
  },
@@ -707,10 +707,10 @@ const primary$6 = mergeDeepRight(button, {
707
707
  right: '0'
708
708
  },
709
709
  clickbound: {
710
- width: clicboundHeight,
710
+ width: clicboundHeight$1,
711
711
  offset: {
712
712
  top: '0',
713
- left: "".concat((parseInt(clicboundHeight) - parseInt(shape$3.icon_button.minWidth)) / 2, "px")
713
+ left: "".concat((parseInt(clicboundHeight$1) - parseInt(shape$4.icon_button.minWidth)) / 2, "px")
714
714
  }
715
715
  },
716
716
  states: {
@@ -735,19 +735,19 @@ const primary$6 = mergeDeepRight(button, {
735
735
  },
736
736
  modes: {
737
737
  compact: {
738
- height: shape$3._modes.compact.icon_button.minHeight,
739
- width: shape$3._modes.compact.icon_button.minWidth,
738
+ height: shape$4._modes.compact.icon_button.minHeight,
739
+ width: shape$4._modes.compact.icon_button.minWidth,
740
740
  clickbound: {
741
- width: compactClickboundHeight,
741
+ width: compactClickboundHeight$1,
742
742
  offset: {
743
743
  top: '0',
744
- left: "".concat((parseInt(compactClickboundHeight) - parseInt(shape$3._modes.compact.icon_button.minWidth)) / 2, "px")
744
+ left: "".concat((parseInt(compactClickboundHeight$1) - parseInt(shape$4._modes.compact.icon_button.minWidth)) / 2, "px")
745
745
  }
746
746
  }
747
747
  }
748
748
  }
749
749
  });
750
- const secondary$1 = mergeDeepRight(primary$6, {
750
+ const secondary$2 = mergeDeepRight(primary$7, {
751
751
  typography: {
752
752
  color: secondaryColor
753
753
  },
@@ -760,7 +760,7 @@ const secondary$1 = mergeDeepRight(primary$6, {
760
760
  }
761
761
  }
762
762
  });
763
- const danger$2 = mergeDeepRight(primary$6, {
763
+ const danger$3 = mergeDeepRight(primary$7, {
764
764
  typography: {
765
765
  color: dangerColor
766
766
  },
@@ -774,24 +774,78 @@ const danger$2 = mergeDeepRight(primary$6, {
774
774
  }
775
775
  });
776
776
 
777
+ const {
778
+ clickbounds: {
779
+ default__base: clicboundHeight,
780
+ compact__standard: compactClickboundHeight
781
+ },
782
+ shape: shape$3
783
+ } = edsTokens.tokens;
784
+ const contained_icon = {
785
+ height: shape$3.icon_button.minHeight,
786
+ width: shape$3.icon_button.minWidth,
787
+ border: {
788
+ width: '0px',
789
+ radius: '50%'
790
+ },
791
+ spacings: {
792
+ left: '0',
793
+ right: '0'
794
+ },
795
+ clickbound: {
796
+ width: clicboundHeight,
797
+ offset: {
798
+ top: '0',
799
+ left: "".concat((parseInt(clicboundHeight) - parseInt('40px')) / 2, "px")
800
+ }
801
+ },
802
+ states: {
803
+ hover: {
804
+ border: {
805
+ width: '0px',
806
+ radius: '50%'
807
+ }
808
+ }
809
+ },
810
+ modes: {
811
+ compact: {
812
+ height: shape$3._modes.compact.icon_button.minHeight,
813
+ width: shape$3._modes.compact.icon_button.minWidth,
814
+ clickbound: {
815
+ width: compactClickboundHeight,
816
+ offset: {
817
+ top: '0',
818
+ left: "".concat((parseInt(compactClickboundHeight) - parseInt(shape$3._modes.compact.icon_button.minWidth)) / 2, "px")
819
+ }
820
+ }
821
+ }
822
+ }
823
+ };
824
+ const primary$6 = mergeDeepRight(primary$a, contained_icon);
825
+ const secondary$1 = mergeDeepRight(secondary$5, contained_icon);
826
+ const danger$2 = mergeDeepRight(danger$6, contained_icon);
827
+
777
828
  const token$5 = {
778
829
  primary: {
779
- contained: primary$9,
780
- outlined: primary$8,
781
- ghost: primary$7,
782
- ghost_icon: primary$6
830
+ contained: primary$a,
831
+ outlined: primary$9,
832
+ ghost: primary$8,
833
+ ghost_icon: primary$7,
834
+ contained_icon: primary$6
783
835
  },
784
836
  secondary: {
785
- contained: secondary$4,
786
- outlined: secondary$3,
787
- ghost: secondary$2,
788
- ghost_icon: secondary$1
837
+ contained: secondary$5,
838
+ outlined: secondary$4,
839
+ ghost: secondary$3,
840
+ ghost_icon: secondary$2,
841
+ contained_icon: secondary$1
789
842
  },
790
843
  danger: {
791
- contained: danger$5,
792
- outlined: danger$4,
793
- ghost: danger$3,
794
- ghost_icon: danger$2
844
+ contained: danger$6,
845
+ outlined: danger$5,
846
+ ghost: danger$4,
847
+ ghost_icon: danger$3,
848
+ contained_icon: danger$2
795
849
  }
796
850
  };
797
851
 
@@ -860,6 +914,9 @@ const getVariant = (tokenSet, variant) => {
860
914
  case 'outlined':
861
915
  return tokenSet.outlined;
862
916
 
917
+ case 'contained_icon':
918
+ return tokenSet.contained_icon;
919
+
863
920
  case 'contained':
864
921
  default:
865
922
  return tokenSet.contained;
@@ -10258,7 +10315,7 @@ function AutocompleteInner(props, ref) {
10258
10315
  const selectedsHash = JSON.stringify(selectedItem);
10259
10316
 
10260
10317
  if (availableItems.length === 1 && selectedsHash === availableHash) {
10261
- setAvailableItems(options);
10318
+ setAvailableItems(inputOptions);
10262
10319
  }
10263
10320
  },
10264
10321
  onStateChange: _ref9 => {
@@ -251,7 +251,7 @@ function AutocompleteInner(props, ref) {
251
251
  const selectedsHash = JSON.stringify(selectedItem);
252
252
 
253
253
  if (availableItems.length === 1 && selectedsHash === availableHash) {
254
- setAvailableItems(options);
254
+ setAvailableItems(inputOptions);
255
255
  }
256
256
  },
257
257
  onStateChange: _ref9 => {
@@ -17,6 +17,9 @@ const getVariant = (tokenSet, variant) => {
17
17
  case 'outlined':
18
18
  return tokenSet.outlined;
19
19
 
20
+ case 'contained_icon':
21
+ return tokenSet.contained_icon;
22
+
20
23
  case 'contained':
21
24
  default:
22
25
  return tokenSet.contained;
@@ -0,0 +1,56 @@
1
+ import { tokens } from '@equinor/eds-tokens';
2
+ import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.28.0/node_modules/ramda/es/mergeDeepRight.js';
3
+ import { primary as primary$1, secondary as secondary$1, danger as danger$1 } from './contained.js';
4
+
5
+ const {
6
+ clickbounds: {
7
+ default__base: clicboundHeight,
8
+ compact__standard: compactClickboundHeight
9
+ },
10
+ shape
11
+ } = tokens;
12
+ const contained_icon = {
13
+ height: shape.icon_button.minHeight,
14
+ width: shape.icon_button.minWidth,
15
+ border: {
16
+ width: '0px',
17
+ radius: '50%'
18
+ },
19
+ spacings: {
20
+ left: '0',
21
+ right: '0'
22
+ },
23
+ clickbound: {
24
+ width: clicboundHeight,
25
+ offset: {
26
+ top: '0',
27
+ left: "".concat((parseInt(clicboundHeight) - parseInt('40px')) / 2, "px")
28
+ }
29
+ },
30
+ states: {
31
+ hover: {
32
+ border: {
33
+ width: '0px',
34
+ radius: '50%'
35
+ }
36
+ }
37
+ },
38
+ modes: {
39
+ compact: {
40
+ height: shape._modes.compact.icon_button.minHeight,
41
+ width: shape._modes.compact.icon_button.minWidth,
42
+ clickbound: {
43
+ width: compactClickboundHeight,
44
+ offset: {
45
+ top: '0',
46
+ left: "".concat((parseInt(compactClickboundHeight) - parseInt(shape._modes.compact.icon_button.minWidth)) / 2, "px")
47
+ }
48
+ }
49
+ }
50
+ }
51
+ };
52
+ const primary = mergeDeepRight(primary$1, contained_icon);
53
+ const secondary = mergeDeepRight(secondary$1, contained_icon);
54
+ const danger = mergeDeepRight(danger$1, contained_icon);
55
+
56
+ export { danger, primary, secondary };
@@ -2,25 +2,29 @@ import { primary, secondary, danger } from './contained.js';
2
2
  import { primary as primary$1, secondary as secondary$1, danger as danger$1 } from './outlined.js';
3
3
  import { primary as primary$2, secondary as secondary$2, danger as danger$2 } from './ghost.js';
4
4
  import { primary as primary$3, secondary as secondary$3, danger as danger$3 } from './icon.js';
5
+ import { primary as primary$4, secondary as secondary$4, danger as danger$4 } from './contained_icon.js';
5
6
 
6
7
  const token = {
7
8
  primary: {
8
9
  contained: primary,
9
10
  outlined: primary$1,
10
11
  ghost: primary$2,
11
- ghost_icon: primary$3
12
+ ghost_icon: primary$3,
13
+ contained_icon: primary$4
12
14
  },
13
15
  secondary: {
14
16
  contained: secondary,
15
17
  outlined: secondary$1,
16
18
  ghost: secondary$2,
17
- ghost_icon: secondary$3
19
+ ghost_icon: secondary$3,
20
+ contained_icon: secondary$4
18
21
  },
19
22
  danger: {
20
23
  contained: danger,
21
24
  outlined: danger$1,
22
25
  ghost: danger$2,
23
- ghost_icon: danger$3
26
+ ghost_icon: danger$3,
27
+ contained_icon: danger$4
24
28
  }
25
29
  };
26
30
 
@@ -1,9 +1,11 @@
1
1
  import { ElementType, ButtonHTMLAttributes } from 'react';
2
+ declare type Colors = 'primary' | 'secondary' | 'danger';
3
+ declare type Variants = 'contained' | 'contained_icon' | 'outlined' | 'ghost' | 'ghost_icon';
2
4
  export declare type ButtonProps = {
3
5
  /** Specifies color */
4
- color?: 'primary' | 'secondary' | 'danger';
6
+ color?: Colors;
5
7
  /** Specifies which variant to use */
6
- variant?: 'contained' | 'outlined' | 'ghost' | 'ghost_icon';
8
+ variant?: Variants;
7
9
  /**
8
10
  * URL link destination
9
11
  * If defined, an 'a' element is used as root instead of 'button'
@@ -22,9 +24,9 @@ export declare type ButtonProps = {
22
24
  } & ButtonHTMLAttributes<HTMLButtonElement>;
23
25
  export declare const Button: import("react").ForwardRefExoticComponent<{
24
26
  /** Specifies color */
25
- color?: 'primary' | 'secondary' | 'danger';
27
+ color?: Colors;
26
28
  /** Specifies which variant to use */
27
- variant?: 'contained' | 'outlined' | 'ghost' | 'ghost_icon';
29
+ variant?: Variants;
28
30
  /**
29
31
  * URL link destination
30
32
  * If defined, an 'a' element is used as root instead of 'button'
@@ -41,3 +43,4 @@ export declare const Button: import("react").ForwardRefExoticComponent<{
41
43
  /** FullWidth (stretched) button */
42
44
  fullWidth?: boolean;
43
45
  } & ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
46
+ export {};
@@ -6,6 +6,7 @@ export declare type ButtonToken = ComponentToken & {
6
6
  };
7
7
  export declare type ButtonTokenSet = {
8
8
  contained: ButtonToken;
9
+ contained_icon: ButtonToken;
9
10
  outlined: ButtonToken;
10
11
  ghost: ButtonToken;
11
12
  ghost_icon: ButtonToken;
@@ -0,0 +1,4 @@
1
+ import { ButtonToken } from '../Button.types';
2
+ export declare const primary: ButtonToken;
3
+ export declare const secondary: Partial<ButtonToken>;
4
+ export declare const danger: Partial<ButtonToken>;
@@ -21,7 +21,7 @@ export declare const StyledList: import("styled-components").StyledComponent<imp
21
21
  export declare const StyledListItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../List").ListItemProps & import("react").RefAttributes<HTMLLIElement>>, import("styled-components").DefaultTheme, StyledListItemType, never>;
22
22
  export declare const StyledButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
23
23
  color?: "primary" | "secondary" | "danger";
24
- variant?: "contained" | "outlined" | "ghost" | "ghost_icon";
24
+ variant?: "contained" | "contained_icon" | "outlined" | "ghost" | "ghost_icon";
25
25
  href?: string;
26
26
  disabled?: boolean;
27
27
  as?: import("react").ElementType<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/eds-core-react",
3
- "version": "0.20.4",
3
+ "version": "0.20.5-dev.20220701",
4
4
  "description": "The React implementation of the Equinor Design System",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "dependencies": {
88
88
  "@babel/runtime": "^7.17.9",
89
- "@equinor/eds-icons": "0.11.0",
89
+ "@equinor/eds-icons": "0.12.0",
90
90
  "@equinor/eds-tokens": "0.7.1",
91
91
  "@equinor/eds-utils": "0.2.3",
92
92
  "@popperjs/core": "2.9.2",