@equinor/eds-core-react 0.20.3 → 0.21.0-dev.20220905
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.
- package/README.md +8 -0
- package/dist/eds-core-react.cjs.js +583 -313
- package/dist/esm/components/Accordion/Accordion.tokens.js +7 -0
- package/dist/esm/components/Accordion/AccordionHeader.js +4 -0
- package/dist/esm/components/Accordion/AccordionHeaderActions.js +3 -1
- package/dist/esm/components/Accordion/AccordionHeaderTitle.js +3 -1
- package/dist/esm/components/Accordion/AccordionPanel.js +2 -2
- package/dist/esm/components/Autocomplete/Autocomplete.js +93 -68
- package/dist/esm/components/Breadcrumbs/Breadcrumb.js +4 -2
- package/dist/esm/components/Button/Button.js +4 -1
- package/dist/esm/components/Button/ButtonGroup/ButtonGroup.js +37 -0
- package/dist/esm/components/Button/ButtonGroup/ButtonGroup.tokens.js +17 -0
- package/dist/esm/components/Button/index.js +8 -0
- package/dist/esm/components/Button/tokens/contained_icon.js +56 -0
- package/dist/esm/components/Button/tokens/index.js +7 -3
- package/dist/esm/components/Card/Card.js +3 -12
- package/dist/esm/components/Checkbox/Checkbox.js +4 -0
- package/dist/esm/components/Checkbox/Input.js +5 -1
- package/dist/esm/components/Icon/Icon.js +1 -1
- package/dist/esm/components/Menu/Menu.js +56 -40
- package/dist/esm/components/Menu/MenuItem.js +2 -2
- package/dist/esm/components/Pagination/Pagination.js +1 -1
- package/dist/esm/components/Pagination/PaginationItem.js +1 -1
- package/dist/esm/components/Popover/Popover.js +90 -35
- package/dist/esm/components/Radio/Radio.js +4 -0
- package/dist/esm/components/Scrim/Scrim.js +3 -3
- package/dist/esm/components/Search/Search.js +7 -4
- package/dist/esm/components/Select/NativeSelect/NativeSelect.js +3 -1
- package/dist/esm/components/Select/commonStyles.js +1 -1
- package/dist/esm/components/SideSheet/SideSheet.js +8 -6
- package/dist/esm/components/SideSheet/SideSheet.tokens.js +7 -0
- package/dist/esm/components/Switch/Switch.js +6 -0
- package/dist/esm/components/Switch/SwitchDefault.js +4 -0
- package/dist/esm/components/Switch/SwitchSmall.js +4 -0
- package/dist/esm/components/Tabs/TabList.js +2 -3
- package/dist/esm/components/Tabs/Tabs.js +3 -3
- package/dist/esm/components/TextField/TextField.js +2 -1
- package/dist/esm/components/Textarea/Textarea.js +4 -3
- package/dist/esm/components/Tooltip/Tooltip.js +102 -83
- package/dist/esm/components/TopBar/TopBar.tokens.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +4 -0
- package/dist/types/components/Breadcrumbs/Breadcrumb.d.ts +9 -6
- package/dist/types/components/Button/Button.d.ts +8 -26
- package/dist/types/components/Button/Button.types.d.ts +1 -0
- package/dist/types/components/Button/ButtonGroup/ButtonGroup.d.ts +9 -0
- package/dist/types/components/{Group/Group.tokens.d.ts → Button/ButtonGroup/ButtonGroup.tokens.d.ts} +0 -0
- package/dist/types/components/Button/ButtonGroup/index.d.ts +1 -0
- package/dist/types/components/Button/index.d.ts +8 -1
- package/dist/types/components/Button/tokens/contained_icon.d.ts +4 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +13 -5
- package/dist/types/components/Checkbox/Input.d.ts +10 -5
- package/dist/types/components/Icon/Icon.d.ts +1 -1
- package/dist/types/components/Menu/Menu.d.ts +1 -1
- package/dist/types/components/Popover/Popover.d.ts +1 -1
- package/dist/types/components/Progress/Circular/CircularProgress.d.ts +1 -1
- package/dist/types/components/Progress/Dots/DotProgress.d.ts +1 -1
- package/dist/types/components/Progress/Star/StarProgress.d.ts +1 -1
- package/dist/types/components/Radio/Radio.d.ts +8 -5
- package/dist/types/components/Select/commonStyles.d.ts +5 -9
- package/dist/types/components/SideSheet/SideSheet.d.ts +4 -0
- package/dist/types/components/Switch/Switch.d.ts +10 -5
- package/dist/types/components/Switch/SwitchDefault.d.ts +3 -5
- package/dist/types/components/Switch/SwitchSmall.d.ts +3 -5
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/components/Typography/Typography.d.ts +11 -3
- package/package.json +5 -6
- package/dist/types/components/Group/Group.d.ts +0 -3
- package/dist/types/components/Group/index.d.ts +0 -1
|
@@ -9,6 +9,7 @@ var edsUtils = require('@equinor/eds-utils');
|
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
var edsIcons = require('@equinor/eds-icons');
|
|
11
11
|
var ReactDom = require('react-dom');
|
|
12
|
+
var reactDomInteractions = require('@floating-ui/react-dom-interactions');
|
|
12
13
|
var downshift = require('downshift');
|
|
13
14
|
|
|
14
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -75,8 +76,8 @@ const {
|
|
|
75
76
|
focused: outline
|
|
76
77
|
},
|
|
77
78
|
clickbounds: {
|
|
78
|
-
default__base: clicboundHeight$
|
|
79
|
-
compact__standard: compactClickboundHeight$
|
|
79
|
+
default__base: clicboundHeight$2,
|
|
80
|
+
compact__standard: compactClickboundHeight$2
|
|
80
81
|
}
|
|
81
82
|
} = edsTokens.tokens;
|
|
82
83
|
const button = {
|
|
@@ -100,10 +101,10 @@ const button = {
|
|
|
100
101
|
right: "var(--eds_button__padding_x, ".concat(medium$6, ")")
|
|
101
102
|
},
|
|
102
103
|
clickbound: {
|
|
103
|
-
height: clicboundHeight$
|
|
104
|
+
height: clicboundHeight$2,
|
|
104
105
|
width: '100%',
|
|
105
106
|
offset: {
|
|
106
|
-
top: "".concat((parseInt(clicboundHeight$
|
|
107
|
+
top: "".concat((parseInt(clicboundHeight$2) - parseInt(buttonHeight)) / 2 + 1, "px"),
|
|
107
108
|
left: '0'
|
|
108
109
|
}
|
|
109
110
|
},
|
|
@@ -154,10 +155,10 @@ const button = {
|
|
|
154
155
|
bottom: 'var(--eds_button__padding_y_compact, 0)'
|
|
155
156
|
},
|
|
156
157
|
clickbound: {
|
|
157
|
-
height: compactClickboundHeight$
|
|
158
|
+
height: compactClickboundHeight$2,
|
|
158
159
|
width: '100%',
|
|
159
160
|
offset: {
|
|
160
|
-
top: "".concat((parseInt(compactClickboundHeight$
|
|
161
|
+
top: "".concat((parseInt(compactClickboundHeight$2) - parseInt(compactButtonHeight)) / 2 + 1, "px"),
|
|
161
162
|
left: '0'
|
|
162
163
|
}
|
|
163
164
|
}
|
|
@@ -419,7 +420,7 @@ const {
|
|
|
419
420
|
}
|
|
420
421
|
}
|
|
421
422
|
} = edsTokens.tokens;
|
|
422
|
-
const primary$
|
|
423
|
+
const primary$a = mergeDeepRight(button, {
|
|
423
424
|
background: primaryColor$8,
|
|
424
425
|
typography: {
|
|
425
426
|
color: primaryWhite
|
|
@@ -437,7 +438,7 @@ const primary$9 = mergeDeepRight(button, {
|
|
|
437
438
|
}
|
|
438
439
|
}
|
|
439
440
|
});
|
|
440
|
-
const secondary$
|
|
441
|
+
const secondary$5 = mergeDeepRight(primary$a, {
|
|
441
442
|
background: secondaryColor$3,
|
|
442
443
|
border: {
|
|
443
444
|
color: secondaryColor$3
|
|
@@ -451,7 +452,7 @@ const secondary$4 = mergeDeepRight(primary$9, {
|
|
|
451
452
|
}
|
|
452
453
|
}
|
|
453
454
|
});
|
|
454
|
-
const danger$
|
|
455
|
+
const danger$6 = mergeDeepRight(primary$a, {
|
|
455
456
|
background: dangerColor$3,
|
|
456
457
|
border: {
|
|
457
458
|
color: dangerColor$3
|
|
@@ -504,7 +505,7 @@ const {
|
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
507
|
} = edsTokens.tokens;
|
|
507
|
-
const primary$
|
|
508
|
+
const primary$9 = mergeDeepRight(button, {
|
|
508
509
|
typography: {
|
|
509
510
|
color: primaryColor$7
|
|
510
511
|
},
|
|
@@ -533,7 +534,7 @@ const primary$8 = mergeDeepRight(button, {
|
|
|
533
534
|
}
|
|
534
535
|
}
|
|
535
536
|
});
|
|
536
|
-
const secondary$
|
|
537
|
+
const secondary$4 = mergeDeepRight(primary$9, {
|
|
537
538
|
typography: {
|
|
538
539
|
color: secondaryColor$2
|
|
539
540
|
},
|
|
@@ -552,7 +553,7 @@ const secondary$3 = mergeDeepRight(primary$8, {
|
|
|
552
553
|
}
|
|
553
554
|
}
|
|
554
555
|
});
|
|
555
|
-
const danger$
|
|
556
|
+
const danger$5 = mergeDeepRight(primary$9, {
|
|
556
557
|
typography: {
|
|
557
558
|
color: dangerColor$2
|
|
558
559
|
},
|
|
@@ -605,7 +606,7 @@ const {
|
|
|
605
606
|
}
|
|
606
607
|
}
|
|
607
608
|
} = edsTokens.tokens;
|
|
608
|
-
const primary$
|
|
609
|
+
const primary$8 = mergeDeepRight(button, {
|
|
609
610
|
typography: {
|
|
610
611
|
color: primaryColor$6
|
|
611
612
|
},
|
|
@@ -624,7 +625,7 @@ const primary$7 = mergeDeepRight(button, {
|
|
|
624
625
|
}
|
|
625
626
|
}
|
|
626
627
|
});
|
|
627
|
-
const secondary$
|
|
628
|
+
const secondary$3 = mergeDeepRight(primary$8, {
|
|
628
629
|
typography: {
|
|
629
630
|
color: secondaryColor$1
|
|
630
631
|
},
|
|
@@ -637,7 +638,7 @@ const secondary$2 = mergeDeepRight(primary$7, {
|
|
|
637
638
|
}
|
|
638
639
|
}
|
|
639
640
|
});
|
|
640
|
-
const danger$
|
|
641
|
+
const danger$4 = mergeDeepRight(primary$8, {
|
|
641
642
|
typography: {
|
|
642
643
|
color: dangerColor$1
|
|
643
644
|
},
|
|
@@ -681,19 +682,19 @@ const {
|
|
|
681
682
|
}
|
|
682
683
|
},
|
|
683
684
|
clickbounds: {
|
|
684
|
-
default__base: clicboundHeight,
|
|
685
|
-
compact__standard: compactClickboundHeight
|
|
685
|
+
default__base: clicboundHeight$1,
|
|
686
|
+
compact__standard: compactClickboundHeight$1
|
|
686
687
|
},
|
|
687
|
-
shape: shape$
|
|
688
|
+
shape: shape$4,
|
|
688
689
|
interactions: {
|
|
689
690
|
focused: {
|
|
690
691
|
width: focusOutlineWidth$8
|
|
691
692
|
}
|
|
692
693
|
}
|
|
693
694
|
} = edsTokens.tokens;
|
|
694
|
-
const primary$
|
|
695
|
-
height: shape$
|
|
696
|
-
width: shape$
|
|
695
|
+
const primary$7 = mergeDeepRight(button, {
|
|
696
|
+
height: shape$4.icon_button.minHeight,
|
|
697
|
+
width: shape$4.icon_button.minWidth,
|
|
697
698
|
typography: {
|
|
698
699
|
color: primaryColor$5
|
|
699
700
|
},
|
|
@@ -707,10 +708,10 @@ const primary$6 = mergeDeepRight(button, {
|
|
|
707
708
|
right: '0'
|
|
708
709
|
},
|
|
709
710
|
clickbound: {
|
|
710
|
-
width: clicboundHeight,
|
|
711
|
+
width: clicboundHeight$1,
|
|
711
712
|
offset: {
|
|
712
713
|
top: '0',
|
|
713
|
-
left: "".concat((parseInt(clicboundHeight) - parseInt(shape$
|
|
714
|
+
left: "".concat((parseInt(clicboundHeight$1) - parseInt(shape$4.icon_button.minWidth)) / 2, "px")
|
|
714
715
|
}
|
|
715
716
|
},
|
|
716
717
|
states: {
|
|
@@ -735,19 +736,19 @@ const primary$6 = mergeDeepRight(button, {
|
|
|
735
736
|
},
|
|
736
737
|
modes: {
|
|
737
738
|
compact: {
|
|
738
|
-
height: shape$
|
|
739
|
-
width: shape$
|
|
739
|
+
height: shape$4._modes.compact.icon_button.minHeight,
|
|
740
|
+
width: shape$4._modes.compact.icon_button.minWidth,
|
|
740
741
|
clickbound: {
|
|
741
|
-
width: compactClickboundHeight,
|
|
742
|
+
width: compactClickboundHeight$1,
|
|
742
743
|
offset: {
|
|
743
744
|
top: '0',
|
|
744
|
-
left: "".concat((parseInt(compactClickboundHeight) - parseInt(shape$
|
|
745
|
+
left: "".concat((parseInt(compactClickboundHeight$1) - parseInt(shape$4._modes.compact.icon_button.minWidth)) / 2, "px")
|
|
745
746
|
}
|
|
746
747
|
}
|
|
747
748
|
}
|
|
748
749
|
}
|
|
749
750
|
});
|
|
750
|
-
const secondary$
|
|
751
|
+
const secondary$2 = mergeDeepRight(primary$7, {
|
|
751
752
|
typography: {
|
|
752
753
|
color: secondaryColor
|
|
753
754
|
},
|
|
@@ -760,7 +761,7 @@ const secondary$1 = mergeDeepRight(primary$6, {
|
|
|
760
761
|
}
|
|
761
762
|
}
|
|
762
763
|
});
|
|
763
|
-
const danger$
|
|
764
|
+
const danger$3 = mergeDeepRight(primary$7, {
|
|
764
765
|
typography: {
|
|
765
766
|
color: dangerColor
|
|
766
767
|
},
|
|
@@ -774,24 +775,78 @@ const danger$2 = mergeDeepRight(primary$6, {
|
|
|
774
775
|
}
|
|
775
776
|
});
|
|
776
777
|
|
|
778
|
+
const {
|
|
779
|
+
clickbounds: {
|
|
780
|
+
default__base: clicboundHeight,
|
|
781
|
+
compact__standard: compactClickboundHeight
|
|
782
|
+
},
|
|
783
|
+
shape: shape$3
|
|
784
|
+
} = edsTokens.tokens;
|
|
785
|
+
const contained_icon = {
|
|
786
|
+
height: shape$3.icon_button.minHeight,
|
|
787
|
+
width: shape$3.icon_button.minWidth,
|
|
788
|
+
border: {
|
|
789
|
+
width: '0px',
|
|
790
|
+
radius: '50%'
|
|
791
|
+
},
|
|
792
|
+
spacings: {
|
|
793
|
+
left: '0',
|
|
794
|
+
right: '0'
|
|
795
|
+
},
|
|
796
|
+
clickbound: {
|
|
797
|
+
width: clicboundHeight,
|
|
798
|
+
offset: {
|
|
799
|
+
top: '0',
|
|
800
|
+
left: "".concat((parseInt(clicboundHeight) - parseInt('40px')) / 2, "px")
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
states: {
|
|
804
|
+
hover: {
|
|
805
|
+
border: {
|
|
806
|
+
width: '0px',
|
|
807
|
+
radius: '50%'
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
},
|
|
811
|
+
modes: {
|
|
812
|
+
compact: {
|
|
813
|
+
height: shape$3._modes.compact.icon_button.minHeight,
|
|
814
|
+
width: shape$3._modes.compact.icon_button.minWidth,
|
|
815
|
+
clickbound: {
|
|
816
|
+
width: compactClickboundHeight,
|
|
817
|
+
offset: {
|
|
818
|
+
top: '0',
|
|
819
|
+
left: "".concat((parseInt(compactClickboundHeight) - parseInt(shape$3._modes.compact.icon_button.minWidth)) / 2, "px")
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
const primary$6 = mergeDeepRight(primary$a, contained_icon);
|
|
826
|
+
const secondary$1 = mergeDeepRight(secondary$5, contained_icon);
|
|
827
|
+
const danger$2 = mergeDeepRight(danger$6, contained_icon);
|
|
828
|
+
|
|
777
829
|
const token$5 = {
|
|
778
830
|
primary: {
|
|
779
|
-
contained: primary$
|
|
780
|
-
outlined: primary$
|
|
781
|
-
ghost: primary$
|
|
782
|
-
ghost_icon: primary$
|
|
831
|
+
contained: primary$a,
|
|
832
|
+
outlined: primary$9,
|
|
833
|
+
ghost: primary$8,
|
|
834
|
+
ghost_icon: primary$7,
|
|
835
|
+
contained_icon: primary$6
|
|
783
836
|
},
|
|
784
837
|
secondary: {
|
|
785
|
-
contained: secondary$
|
|
786
|
-
outlined: secondary$
|
|
787
|
-
ghost: secondary$
|
|
788
|
-
ghost_icon: secondary$
|
|
838
|
+
contained: secondary$5,
|
|
839
|
+
outlined: secondary$4,
|
|
840
|
+
ghost: secondary$3,
|
|
841
|
+
ghost_icon: secondary$2,
|
|
842
|
+
contained_icon: secondary$1
|
|
789
843
|
},
|
|
790
844
|
danger: {
|
|
791
|
-
contained: danger$
|
|
792
|
-
outlined: danger$
|
|
793
|
-
ghost: danger$
|
|
794
|
-
ghost_icon: danger$
|
|
845
|
+
contained: danger$6,
|
|
846
|
+
outlined: danger$5,
|
|
847
|
+
ghost: danger$4,
|
|
848
|
+
ghost_icon: danger$3,
|
|
849
|
+
contained_icon: danger$2
|
|
795
850
|
}
|
|
796
851
|
};
|
|
797
852
|
|
|
@@ -860,6 +915,9 @@ const getVariant = (tokenSet, variant) => {
|
|
|
860
915
|
case 'outlined':
|
|
861
916
|
return tokenSet.outlined;
|
|
862
917
|
|
|
918
|
+
case 'contained_icon':
|
|
919
|
+
return tokenSet.contained_icon;
|
|
920
|
+
|
|
863
921
|
case 'contained':
|
|
864
922
|
default:
|
|
865
923
|
return tokenSet.contained;
|
|
@@ -902,9 +960,9 @@ const ButtonBase = styled__default["default"].button.withConfig({
|
|
|
902
960
|
hover,
|
|
903
961
|
disabled
|
|
904
962
|
} = states;
|
|
905
|
-
return styled.css(["margin:0;padding:0;text-decoration:none;position:relative;cursor:pointer;display:inline-block;background:", ";height:", ";width:", ";svg{justify-self:center;}", " ", " ", " &::before{position:absolute;top:0;left:0;width:auto;min-height:auto;content:'';}&::after{position:absolute;top:-", ";left:-", ";width:", ";height:", ";content:'';}@media (hover:hover) and (pointer:fine){&:hover{background:", ";color:", ";", ";}}&:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}&::-moz-focus-inner{border:0;}&:disabled{cursor:not-allowed;background:", ";", ";", ";@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}}"], theme.background, theme.height, theme.width, edsUtils.spacingsTemplate(theme.spacings), edsUtils.bordersTemplate(theme.border), edsUtils.typographyTemplate(theme.typography), clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset = clickbound.offset) === null || _clickbound$offset === void 0 ? void 0 : _clickbound$offset.top, clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset2 = clickbound.offset) === null || _clickbound$offset2 === void 0 ? void 0 : _clickbound$offset2.left, clickbound === null || clickbound === void 0 ? void 0 : clickbound.width, clickbound === null || clickbound === void 0 ? void 0 : clickbound.height, hover.background, (_hover$typography = hover.typography) === null || _hover$typography === void 0 ? void 0 : _hover$typography.color, edsUtils.bordersTemplate(hover === null || hover === void 0 ? void 0 : hover.border), edsUtils.outlineTemplate(focus.outline), edsUtils.outlineTemplate(focus.outline), disabled.background, edsUtils.bordersTemplate(disabled.border), edsUtils.typographyTemplate(disabled.typography), disabled.background);
|
|
963
|
+
return styled.css(["box-sizing:border-box;margin:0;padding:0;text-decoration:none;position:relative;cursor:pointer;display:inline-block;background:", ";height:", ";width:", ";svg{justify-self:center;}", " ", " ", " &::before{position:absolute;top:0;left:0;width:auto;min-height:auto;content:'';}&::after{position:absolute;top:-", ";left:-", ";width:", ";height:", ";content:'';}@media (hover:hover) and (pointer:fine){&:hover{background:", ";color:", ";", ";}}&:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}&::-moz-focus-inner{border:0;}&:disabled{cursor:not-allowed;background:", ";", ";", ";@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}}"], theme.background, theme.height, theme.width, edsUtils.spacingsTemplate(theme.spacings), edsUtils.bordersTemplate(theme.border), edsUtils.typographyTemplate(theme.typography), clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset = clickbound.offset) === null || _clickbound$offset === void 0 ? void 0 : _clickbound$offset.top, clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset2 = clickbound.offset) === null || _clickbound$offset2 === void 0 ? void 0 : _clickbound$offset2.left, clickbound === null || clickbound === void 0 ? void 0 : clickbound.width, clickbound === null || clickbound === void 0 ? void 0 : clickbound.height, hover.background, (_hover$typography = hover.typography) === null || _hover$typography === void 0 ? void 0 : _hover$typography.color, edsUtils.bordersTemplate(hover === null || hover === void 0 ? void 0 : hover.border), edsUtils.outlineTemplate(focus.outline), edsUtils.outlineTemplate(focus.outline), disabled.background, edsUtils.bordersTemplate(disabled.border), edsUtils.typographyTemplate(disabled.typography), disabled.background);
|
|
906
964
|
});
|
|
907
|
-
const Button = /*#__PURE__*/react.forwardRef(function Button(_ref2, ref) {
|
|
965
|
+
const Button$1 = /*#__PURE__*/react.forwardRef(function Button(_ref2, ref) {
|
|
908
966
|
let {
|
|
909
967
|
color = 'primary',
|
|
910
968
|
variant = 'contained',
|
|
@@ -946,7 +1004,56 @@ const Button = /*#__PURE__*/react.forwardRef(function Button(_ref2, ref) {
|
|
|
946
1004
|
});
|
|
947
1005
|
|
|
948
1006
|
const {
|
|
949
|
-
|
|
1007
|
+
shape: {
|
|
1008
|
+
corners: {
|
|
1009
|
+
borderRadius: borderRadius$9
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
} = edsTokens.tokens;
|
|
1013
|
+
const group = {
|
|
1014
|
+
border: {
|
|
1015
|
+
type: 'border',
|
|
1016
|
+
radius: borderRadius$9
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
|
|
1020
|
+
const {
|
|
1021
|
+
border: border$4
|
|
1022
|
+
} = group;
|
|
1023
|
+
const radius$1 = border$4.type === 'border' && border$4.radius;
|
|
1024
|
+
const ButtonGroupBase = styled__default["default"].div.withConfig({
|
|
1025
|
+
displayName: "ButtonGroup__ButtonGroupBase",
|
|
1026
|
+
componentId: "sc-1fn8jon-0"
|
|
1027
|
+
})(["display:inline-flex;> *{border-radius:0;@media (hover:hover) and (pointer:fine){&:hover{border-radius:0;}}}", ""], _ref => {
|
|
1028
|
+
let {
|
|
1029
|
+
vertical
|
|
1030
|
+
} = _ref;
|
|
1031
|
+
return vertical ? styled.css(["flex-direction:column;> :first-child{border-top-left-radius:", ";border-top-right-radius:", ";}> :last-child{border-bottom-left-radius:", ";border-bottom-right-radius:", ";}> :not(:last-child){border-bottom:none;}"], radius$1, radius$1, radius$1, radius$1) : styled.css(["> :first-child{border-top-left-radius:", ";border-bottom-left-radius:", ";}> :last-child{border-top-right-radius:", ";border-bottom-right-radius:", ";}> :not(:last-child){border-right:none;}"], radius$1, radius$1, radius$1, radius$1);
|
|
1032
|
+
});
|
|
1033
|
+
const ButtonGroup = /*#__PURE__*/react.forwardRef(function ButtonGroup(_ref2, ref) {
|
|
1034
|
+
let {
|
|
1035
|
+
children,
|
|
1036
|
+
vertical,
|
|
1037
|
+
...rest
|
|
1038
|
+
} = _ref2;
|
|
1039
|
+
const props = {
|
|
1040
|
+
ref,
|
|
1041
|
+
vertical,
|
|
1042
|
+
...rest
|
|
1043
|
+
};
|
|
1044
|
+
return /*#__PURE__*/jsxRuntime.jsx(ButtonGroupBase, {
|
|
1045
|
+
role: "group",
|
|
1046
|
+
...props,
|
|
1047
|
+
children: children
|
|
1048
|
+
});
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
const Button = Button$1;
|
|
1052
|
+
Button.Group = ButtonGroup;
|
|
1053
|
+
Button.Group.displayName = 'Button.Group';
|
|
1054
|
+
|
|
1055
|
+
const {
|
|
1056
|
+
typography: typography$i,
|
|
950
1057
|
colors: colorsToken,
|
|
951
1058
|
interactions: {
|
|
952
1059
|
focused: {
|
|
@@ -957,7 +1064,7 @@ const {
|
|
|
957
1064
|
const {
|
|
958
1065
|
heading,
|
|
959
1066
|
paragraph: paragraph$2
|
|
960
|
-
} = typography$
|
|
1067
|
+
} = typography$i;
|
|
961
1068
|
const {
|
|
962
1069
|
interactive: {
|
|
963
1070
|
primary__resting: {
|
|
@@ -1039,7 +1146,7 @@ const findTypography = (variantName, group) => {
|
|
|
1039
1146
|
return quickVariants[variantName];
|
|
1040
1147
|
}
|
|
1041
1148
|
|
|
1042
|
-
return typography$
|
|
1149
|
+
return typography$i[group][variantName];
|
|
1043
1150
|
};
|
|
1044
1151
|
|
|
1045
1152
|
const findColor = function () {
|
|
@@ -1850,7 +1957,7 @@ const {
|
|
|
1850
1957
|
x_small: x_small$5
|
|
1851
1958
|
}
|
|
1852
1959
|
},
|
|
1853
|
-
typography: typography$
|
|
1960
|
+
typography: typography$h,
|
|
1854
1961
|
shape: shape$2
|
|
1855
1962
|
} = edsTokens.tokens;
|
|
1856
1963
|
const input$2 = {
|
|
@@ -1862,7 +1969,7 @@ const input$2 = {
|
|
|
1862
1969
|
top: '6px',
|
|
1863
1970
|
bottom: '6px'
|
|
1864
1971
|
},
|
|
1865
|
-
typography: { ...typography$
|
|
1972
|
+
typography: { ...typography$h.input.text,
|
|
1866
1973
|
color: static_icons__default.rgba
|
|
1867
1974
|
},
|
|
1868
1975
|
entities: {
|
|
@@ -2151,7 +2258,7 @@ const InputIcon = /*#__PURE__*/react.forwardRef(function InputIcon(_ref2, ref) {
|
|
|
2151
2258
|
|
|
2152
2259
|
const {
|
|
2153
2260
|
colors: colors$6,
|
|
2154
|
-
typography: typography$
|
|
2261
|
+
typography: typography$g,
|
|
2155
2262
|
spacings: {
|
|
2156
2263
|
comfortable: {
|
|
2157
2264
|
small: small$5,
|
|
@@ -2189,7 +2296,7 @@ const textfield$1 = {
|
|
|
2189
2296
|
},
|
|
2190
2297
|
entities: {
|
|
2191
2298
|
unit: {
|
|
2192
|
-
typography: { ...typography$
|
|
2299
|
+
typography: { ...typography$g.input.label,
|
|
2193
2300
|
color: colors$6.text.static_icons__tertiary.hex
|
|
2194
2301
|
},
|
|
2195
2302
|
states: {
|
|
@@ -2348,8 +2455,9 @@ const Textarea = /*#__PURE__*/react.forwardRef(function Textarea(_ref2, ref) {
|
|
|
2348
2455
|
const padding = parseInt(top) + parseInt(bottom);
|
|
2349
2456
|
const maxHeight = parseFloat(lineHeight) * fontSize * rowsMax + padding;
|
|
2350
2457
|
edsUtils.useAutoResize(textareaEl, rowsMax ? maxHeight : null);
|
|
2458
|
+
const combinedRef = react.useMemo(() => edsUtils.mergeRefs(ref, setTextareaEl), [setTextareaEl, ref]);
|
|
2351
2459
|
const inputProps = {
|
|
2352
|
-
ref:
|
|
2460
|
+
ref: combinedRef,
|
|
2353
2461
|
type,
|
|
2354
2462
|
disabled,
|
|
2355
2463
|
variant,
|
|
@@ -2512,11 +2620,11 @@ const {
|
|
|
2512
2620
|
spacings: {
|
|
2513
2621
|
comfortable: comfortable$5
|
|
2514
2622
|
},
|
|
2515
|
-
typography: typography$
|
|
2623
|
+
typography: typography$f
|
|
2516
2624
|
} = edsTokens.tokens;
|
|
2517
2625
|
const label = {
|
|
2518
2626
|
background: colors$5.ui.background__light.rgba,
|
|
2519
|
-
typography: { ...typography$
|
|
2627
|
+
typography: { ...typography$f.input.label,
|
|
2520
2628
|
color: colors$5.text.static_icons__tertiary.rgba
|
|
2521
2629
|
},
|
|
2522
2630
|
spacings: {
|
|
@@ -2576,11 +2684,11 @@ const {
|
|
|
2576
2684
|
spacings: {
|
|
2577
2685
|
comfortable: comfortable$4
|
|
2578
2686
|
},
|
|
2579
|
-
typography: typography$
|
|
2687
|
+
typography: typography$e
|
|
2580
2688
|
} = edsTokens.tokens;
|
|
2581
2689
|
const helperText = {
|
|
2582
2690
|
background: colors$4.ui.background__light.hex,
|
|
2583
|
-
typography: typography$
|
|
2691
|
+
typography: typography$e.input.helper,
|
|
2584
2692
|
spacings: {
|
|
2585
2693
|
comfortable: {
|
|
2586
2694
|
left: comfortable$4.small,
|
|
@@ -2720,6 +2828,7 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField(_ref, ref) {
|
|
|
2720
2828
|
inputIcon,
|
|
2721
2829
|
helperIcon,
|
|
2722
2830
|
rowsMax,
|
|
2831
|
+
style,
|
|
2723
2832
|
...other
|
|
2724
2833
|
} = _ref;
|
|
2725
2834
|
const helperTextId = edsUtils.useId(null, 'helpertext');
|
|
@@ -2746,7 +2855,7 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField(_ref, ref) {
|
|
|
2746
2855
|
const containerProps = {
|
|
2747
2856
|
ref,
|
|
2748
2857
|
className,
|
|
2749
|
-
style
|
|
2858
|
+
style
|
|
2750
2859
|
};
|
|
2751
2860
|
const labelProps = {
|
|
2752
2861
|
htmlFor: id,
|
|
@@ -2860,7 +2969,7 @@ const findIcon = (name, data, size) => {
|
|
|
2860
2969
|
|
|
2861
2970
|
const Icon$2 = /*#__PURE__*/react.forwardRef(function Icon(_ref4, ref) {
|
|
2862
2971
|
let {
|
|
2863
|
-
size
|
|
2972
|
+
size,
|
|
2864
2973
|
color = 'currentColor',
|
|
2865
2974
|
name,
|
|
2866
2975
|
rotation,
|
|
@@ -2933,7 +3042,7 @@ const list = {
|
|
|
2933
3042
|
};
|
|
2934
3043
|
|
|
2935
3044
|
const {
|
|
2936
|
-
typography: typography$
|
|
3045
|
+
typography: typography$d
|
|
2937
3046
|
} = list;
|
|
2938
3047
|
const StyledList$2 = styled__default["default"].ul.withConfig({
|
|
2939
3048
|
displayName: "List__StyledList",
|
|
@@ -2943,7 +3052,7 @@ const StyledList$2 = styled__default["default"].ul.withConfig({
|
|
|
2943
3052
|
as
|
|
2944
3053
|
} = _ref;
|
|
2945
3054
|
return as === 'ol' ? styled.css(["& ol{list-style-type:lower-alpha;}"]) : '';
|
|
2946
|
-
}, edsUtils.typographyTemplate(typography$
|
|
3055
|
+
}, edsUtils.typographyTemplate(typography$d));
|
|
2947
3056
|
const List$2 = /*#__PURE__*/react.forwardRef(function List(_ref2, ref) {
|
|
2948
3057
|
let {
|
|
2949
3058
|
children,
|
|
@@ -2977,7 +3086,7 @@ List$1.Item.displayName = 'List.Item';
|
|
|
2977
3086
|
const {
|
|
2978
3087
|
typography: {
|
|
2979
3088
|
ui: {
|
|
2980
|
-
accordion_header: typography$
|
|
3089
|
+
accordion_header: typography$c
|
|
2981
3090
|
}
|
|
2982
3091
|
},
|
|
2983
3092
|
colors: {
|
|
@@ -3021,6 +3130,11 @@ const {
|
|
|
3021
3130
|
focused: {
|
|
3022
3131
|
width: focusOutlineWidth$6
|
|
3023
3132
|
}
|
|
3133
|
+
},
|
|
3134
|
+
typography: {
|
|
3135
|
+
input: {
|
|
3136
|
+
text
|
|
3137
|
+
}
|
|
3024
3138
|
}
|
|
3025
3139
|
} = edsTokens.tokens;
|
|
3026
3140
|
const accordion = {
|
|
@@ -3042,7 +3156,7 @@ const accordion = {
|
|
|
3042
3156
|
header: {
|
|
3043
3157
|
height: '48px',
|
|
3044
3158
|
background: backgroundDefault,
|
|
3045
|
-
typography: typography$
|
|
3159
|
+
typography: typography$c,
|
|
3046
3160
|
spacings: {
|
|
3047
3161
|
left: mediumSpacing,
|
|
3048
3162
|
right: mediumSpacing
|
|
@@ -3058,12 +3172,12 @@ const accordion = {
|
|
|
3058
3172
|
}
|
|
3059
3173
|
},
|
|
3060
3174
|
disabled: {
|
|
3061
|
-
typography: { ...typography$
|
|
3175
|
+
typography: { ...typography$c,
|
|
3062
3176
|
color: disabledColor$2
|
|
3063
3177
|
}
|
|
3064
3178
|
},
|
|
3065
3179
|
active: {
|
|
3066
|
-
typography: { ...typography$
|
|
3180
|
+
typography: { ...typography$c,
|
|
3067
3181
|
color: activatedColor
|
|
3068
3182
|
}
|
|
3069
3183
|
},
|
|
@@ -3078,6 +3192,8 @@ const accordion = {
|
|
|
3078
3192
|
left: mediumSpacing,
|
|
3079
3193
|
right: mediumSpacing,
|
|
3080
3194
|
top: mediumSpacing
|
|
3195
|
+
},
|
|
3196
|
+
typography: { ...text
|
|
3081
3197
|
}
|
|
3082
3198
|
},
|
|
3083
3199
|
icon: {
|
|
@@ -3190,12 +3306,14 @@ const AccordionHeaderTitle = /*#__PURE__*/react.forwardRef(function AccordionHea
|
|
|
3190
3306
|
let {
|
|
3191
3307
|
isExpanded,
|
|
3192
3308
|
disabled,
|
|
3193
|
-
children
|
|
3309
|
+
children,
|
|
3310
|
+
...rest
|
|
3194
3311
|
} = _ref2;
|
|
3195
3312
|
return /*#__PURE__*/jsxRuntime.jsx(StyledAccordionHeaderTitle, {
|
|
3196
3313
|
ref: ref,
|
|
3197
3314
|
isExpanded: isExpanded,
|
|
3198
3315
|
disabled: disabled,
|
|
3316
|
+
...rest,
|
|
3199
3317
|
children: children
|
|
3200
3318
|
});
|
|
3201
3319
|
}); // AccordionHeaderTitle.displayName = 'AccordionHeaderTitle'
|
|
@@ -3228,12 +3346,14 @@ const AccordionHeaderActions = /*#__PURE__*/react.forwardRef(function AccordionH
|
|
|
3228
3346
|
let {
|
|
3229
3347
|
isExpanded,
|
|
3230
3348
|
disabled,
|
|
3231
|
-
children
|
|
3349
|
+
children,
|
|
3350
|
+
...rest
|
|
3232
3351
|
} = _ref2;
|
|
3233
3352
|
return /*#__PURE__*/jsxRuntime.jsx(StyledAccordionHeaderActions, {
|
|
3234
3353
|
ref: ref,
|
|
3235
3354
|
isExpanded: isExpanded,
|
|
3236
3355
|
disabled: disabled,
|
|
3356
|
+
...rest,
|
|
3237
3357
|
children: children
|
|
3238
3358
|
});
|
|
3239
3359
|
});
|
|
@@ -3330,6 +3450,8 @@ const AccordionHeader = /*#__PURE__*/react.forwardRef(function AccordionHeader(_
|
|
|
3330
3450
|
children,
|
|
3331
3451
|
toggleExpanded,
|
|
3332
3452
|
disabled,
|
|
3453
|
+
className,
|
|
3454
|
+
style,
|
|
3333
3455
|
...props
|
|
3334
3456
|
} = _ref5;
|
|
3335
3457
|
|
|
@@ -3401,6 +3523,8 @@ const AccordionHeader = /*#__PURE__*/react.forwardRef(function AccordionHeader(_
|
|
|
3401
3523
|
disabled: disabled,
|
|
3402
3524
|
parentIndex: parentIndex,
|
|
3403
3525
|
as: headerLevel,
|
|
3526
|
+
className: className,
|
|
3527
|
+
style: style,
|
|
3404
3528
|
children: [/*#__PURE__*/jsxRuntime.jsx(StyledAccordionHeaderButton, {
|
|
3405
3529
|
isExpanded: isExpanded,
|
|
3406
3530
|
disabled: disabled,
|
|
@@ -3436,7 +3560,7 @@ const StyledAccordionPanel = styled__default["default"].div.attrs(_ref => {
|
|
|
3436
3560
|
},
|
|
3437
3561
|
border
|
|
3438
3562
|
} = theme;
|
|
3439
|
-
return styled.css(["", " ", " background:", ";min-height:96px;box-sizing:border-box;"], edsUtils.bordersTemplate(border), edsUtils.spacingsTemplate(panel.spacings), header.background);
|
|
3563
|
+
return styled.css(["", " ", " ", " background:", ";min-height:96px;box-sizing:border-box;"], edsUtils.bordersTemplate(border), edsUtils.spacingsTemplate(panel.spacings), edsUtils.typographyTemplate(panel.typography), header.background);
|
|
3440
3564
|
});
|
|
3441
3565
|
const AccordionPanel = /*#__PURE__*/react.forwardRef(function AccordionPanel(_ref3, ref) {
|
|
3442
3566
|
let {
|
|
@@ -3634,7 +3758,7 @@ const Tabs$1 = /*#__PURE__*/react.forwardRef(function Tabs(_ref, ref) {
|
|
|
3634
3758
|
} = _ref;
|
|
3635
3759
|
const tabsId = edsUtils.useId(id, 'tabs');
|
|
3636
3760
|
const tabsRef = react.useRef(null);
|
|
3637
|
-
const combinedTabsRef = edsUtils.
|
|
3761
|
+
const combinedTabsRef = react.useMemo(() => edsUtils.mergeRefs(tabsRef, ref), [tabsRef, ref]);
|
|
3638
3762
|
const [tabsFocused, setTabsFocused] = react.useState(false);
|
|
3639
3763
|
const [listenerAttached, setListenerAttached] = react.useState(false);
|
|
3640
3764
|
let blurTimer;
|
|
@@ -3759,8 +3883,7 @@ const TabList = /*#__PURE__*/react.forwardRef(function TabsList(_ref3, ref) {
|
|
|
3759
3883
|
currentTab.current = activeTab;
|
|
3760
3884
|
}, [activeTab]);
|
|
3761
3885
|
const Tabs = react.Children.map(children, (child, index) => {
|
|
3762
|
-
const tabRef = index === activeTab ?
|
|
3763
|
-
edsUtils.useCombinedRefs(child.ref, selectedTabRef) : child.ref;
|
|
3886
|
+
const tabRef = index === activeTab ? edsUtils.mergeRefs(child.ref, selectedTabRef) : child.ref;
|
|
3764
3887
|
return /*#__PURE__*/react.cloneElement(child, {
|
|
3765
3888
|
id: "".concat(tabsId, "-tab-").concat(index + 1),
|
|
3766
3889
|
'aria-controls': "".concat(tabsId, "-panel-").concat(index + 1),
|
|
@@ -4007,38 +4130,29 @@ const {
|
|
|
4007
4130
|
const StyledCard = styled__default["default"](Paper).withConfig({
|
|
4008
4131
|
displayName: "Card__StyledCard",
|
|
4009
4132
|
componentId: "sc-bjucjn-0"
|
|
4010
|
-
})(["width:100%;position:relative;background-color:", ";box-sizing:border-box;display:flex;flex-direction:column;grid-gap:16px;
|
|
4133
|
+
})(["width:100%;position:relative;background-color:", ";box-sizing:border-box;display:flex;flex-direction:column;grid-gap:16px;", ";"], _ref => {
|
|
4011
4134
|
let {
|
|
4012
4135
|
background
|
|
4013
4136
|
} = _ref;
|
|
4014
4137
|
return background;
|
|
4015
|
-
}, _ref2 => {
|
|
4016
|
-
let {
|
|
4017
|
-
cursor
|
|
4018
|
-
} = _ref2;
|
|
4019
|
-
return cursor;
|
|
4020
4138
|
}, edsUtils.bordersTemplate(primary$3.border));
|
|
4021
|
-
const Card$1 = /*#__PURE__*/react.forwardRef(function Card(
|
|
4139
|
+
const Card$1 = /*#__PURE__*/react.forwardRef(function Card(_ref2, ref) {
|
|
4022
4140
|
let {
|
|
4023
4141
|
children,
|
|
4024
4142
|
variant = 'default',
|
|
4025
4143
|
elevation = 'none',
|
|
4026
|
-
onClick,
|
|
4027
4144
|
...rest
|
|
4028
|
-
} =
|
|
4029
|
-
const cursor = onClick ? 'pointer' : 'default';
|
|
4145
|
+
} = _ref2;
|
|
4030
4146
|
const cardVariant = variant === 'default' ? 'primary' : variant;
|
|
4031
4147
|
const token = tokens$4[cardVariant];
|
|
4032
4148
|
const props = {
|
|
4033
4149
|
ref,
|
|
4034
4150
|
background: token.background,
|
|
4035
|
-
cursor,
|
|
4036
4151
|
...rest
|
|
4037
4152
|
};
|
|
4038
4153
|
return /*#__PURE__*/jsxRuntime.jsx(StyledCard, {
|
|
4039
4154
|
elevation: elevation,
|
|
4040
4155
|
...props,
|
|
4041
|
-
onClick: onClick,
|
|
4042
4156
|
children: children
|
|
4043
4157
|
});
|
|
4044
4158
|
});
|
|
@@ -4186,8 +4300,8 @@ const topbar = {
|
|
|
4186
4300
|
background: colors$3.ui.background__default.rgba,
|
|
4187
4301
|
typography: navigation.menu_title,
|
|
4188
4302
|
spacings: {
|
|
4189
|
-
left: comfortable$3.
|
|
4190
|
-
right: comfortable$3.
|
|
4303
|
+
left: comfortable$3.large,
|
|
4304
|
+
right: comfortable$3.large,
|
|
4191
4305
|
top: comfortable$3.small,
|
|
4192
4306
|
bottom: comfortable$3.small
|
|
4193
4307
|
},
|
|
@@ -4332,7 +4446,7 @@ const Scrim = /*#__PURE__*/react.forwardRef(function Scrim(_ref, ref) {
|
|
|
4332
4446
|
...rest
|
|
4333
4447
|
} = _ref;
|
|
4334
4448
|
const scrimRef = react.useRef(null);
|
|
4335
|
-
const combinedScrimRef = edsUtils.
|
|
4449
|
+
const combinedScrimRef = react.useMemo(() => edsUtils.mergeRefs(scrimRef, ref), [scrimRef, ref]);
|
|
4336
4450
|
const props = { ...rest,
|
|
4337
4451
|
open,
|
|
4338
4452
|
isDismissable
|
|
@@ -4650,10 +4764,10 @@ const {
|
|
|
4650
4764
|
xxx_large
|
|
4651
4765
|
}
|
|
4652
4766
|
},
|
|
4653
|
-
typography: typography$
|
|
4767
|
+
typography: typography$b
|
|
4654
4768
|
} = edsTokens.tokens;
|
|
4655
4769
|
const tableOfContents = {
|
|
4656
|
-
typography: { ...typography$
|
|
4770
|
+
typography: { ...typography$b.navigation.button,
|
|
4657
4771
|
color: labelColor
|
|
4658
4772
|
},
|
|
4659
4773
|
spacings: {
|
|
@@ -4669,7 +4783,7 @@ const tableOfContents = {
|
|
|
4669
4783
|
},
|
|
4670
4784
|
links: {
|
|
4671
4785
|
width: 'calc(189px - 36px)',
|
|
4672
|
-
typography: { ...typography$
|
|
4786
|
+
typography: { ...typography$b.navigation.button,
|
|
4673
4787
|
color: primaryColor$4
|
|
4674
4788
|
},
|
|
4675
4789
|
spacings: {
|
|
@@ -4709,7 +4823,7 @@ const tableOfContents = {
|
|
|
4709
4823
|
background: primaryHover$3
|
|
4710
4824
|
}
|
|
4711
4825
|
},
|
|
4712
|
-
typography: { ...typography$
|
|
4826
|
+
typography: { ...typography$b.navigation.button,
|
|
4713
4827
|
color: primaryHover$3
|
|
4714
4828
|
}
|
|
4715
4829
|
}
|
|
@@ -4812,6 +4926,11 @@ const {
|
|
|
4812
4926
|
xx_small: spacingXXS,
|
|
4813
4927
|
medium: spacingMedium$5
|
|
4814
4928
|
}
|
|
4929
|
+
},
|
|
4930
|
+
typography: {
|
|
4931
|
+
paragraph: {
|
|
4932
|
+
body_short
|
|
4933
|
+
}
|
|
4815
4934
|
}
|
|
4816
4935
|
} = edsTokens.tokens;
|
|
4817
4936
|
const comfortable$2 = {
|
|
@@ -4829,6 +4948,8 @@ const comfortable$2 = {
|
|
|
4829
4948
|
width: spacingXXS,
|
|
4830
4949
|
style: 'solid'
|
|
4831
4950
|
}
|
|
4951
|
+
},
|
|
4952
|
+
typography: { ...body_short
|
|
4832
4953
|
}
|
|
4833
4954
|
};
|
|
4834
4955
|
const variants = {
|
|
@@ -4841,17 +4962,18 @@ const variants = {
|
|
|
4841
4962
|
const {
|
|
4842
4963
|
background: background$6,
|
|
4843
4964
|
spacings: spacings$2,
|
|
4844
|
-
border: border$2
|
|
4965
|
+
border: border$2,
|
|
4966
|
+
typography: typography$a
|
|
4845
4967
|
} = comfortable$2;
|
|
4846
4968
|
const StyledSideSheet = styled__default["default"].div.withConfig({
|
|
4847
4969
|
displayName: "SideSheet__StyledSideSheet",
|
|
4848
4970
|
componentId: "sc-wkzlnn-0"
|
|
4849
|
-
})(["height:100%;position:absolute;z-index:1200;top:0;right:0;box-sizing:border-box;background:", ";width:", ";", " ", ";"], background$6, _ref => {
|
|
4971
|
+
})(["height:100%;position:absolute;z-index:1200;top:0;right:0;box-sizing:border-box;background:", ";width:", ";", " ", ";", ""], background$6, _ref => {
|
|
4850
4972
|
let {
|
|
4851
4973
|
width
|
|
4852
4974
|
} = _ref;
|
|
4853
4975
|
return width;
|
|
4854
|
-
}, edsUtils.bordersTemplate(border$2), edsUtils.spacingsTemplate(spacings$2));
|
|
4976
|
+
}, edsUtils.bordersTemplate(border$2), edsUtils.spacingsTemplate(spacings$2), edsUtils.typographyTemplate(typography$a));
|
|
4855
4977
|
const Header$1 = styled__default["default"].div.withConfig({
|
|
4856
4978
|
displayName: "SideSheet__Header",
|
|
4857
4979
|
componentId: "sc-wkzlnn-1"
|
|
@@ -4859,6 +4981,7 @@ const Header$1 = styled__default["default"].div.withConfig({
|
|
|
4859
4981
|
const SideSheet = /*#__PURE__*/react.forwardRef(function SideSheet(_ref2, ref) {
|
|
4860
4982
|
let {
|
|
4861
4983
|
variant = 'medium',
|
|
4984
|
+
width,
|
|
4862
4985
|
title = '',
|
|
4863
4986
|
children,
|
|
4864
4987
|
open = true,
|
|
@@ -4867,7 +4990,7 @@ const SideSheet = /*#__PURE__*/react.forwardRef(function SideSheet(_ref2, ref) {
|
|
|
4867
4990
|
} = _ref2;
|
|
4868
4991
|
const props = { ...rest,
|
|
4869
4992
|
ref,
|
|
4870
|
-
width: variants[variant]
|
|
4993
|
+
width: width || variants[variant]
|
|
4871
4994
|
}; // Controller must set open={false} when pressing the close button
|
|
4872
4995
|
|
|
4873
4996
|
return open && /*#__PURE__*/jsxRuntime.jsxs(StyledSideSheet, { ...props,
|
|
@@ -5418,6 +5541,7 @@ const Search = /*#__PURE__*/react.forwardRef(function Search(_ref4, ref) {
|
|
|
5418
5541
|
defaultValue = '',
|
|
5419
5542
|
value,
|
|
5420
5543
|
className = '',
|
|
5544
|
+
style,
|
|
5421
5545
|
disabled = false,
|
|
5422
5546
|
onBlur,
|
|
5423
5547
|
onFocus,
|
|
@@ -5493,14 +5617,16 @@ const Search = /*#__PURE__*/react.forwardRef(function Search(_ref4, ref) {
|
|
|
5493
5617
|
const containerProps = {
|
|
5494
5618
|
isFocused,
|
|
5495
5619
|
className,
|
|
5620
|
+
style,
|
|
5496
5621
|
disabled,
|
|
5497
5622
|
role: 'search',
|
|
5498
5623
|
'aria-label': rest['aria-label'],
|
|
5499
5624
|
onClick: handleOnClick
|
|
5500
5625
|
};
|
|
5626
|
+
const combinedRef = react.useMemo(() => edsUtils.mergeRefs(inputRef, ref), [inputRef, ref]);
|
|
5501
5627
|
const inputProps = applyControllingProps({ ...rest,
|
|
5502
5628
|
disabled,
|
|
5503
|
-
ref:
|
|
5629
|
+
ref: combinedRef,
|
|
5504
5630
|
type: 'search',
|
|
5505
5631
|
role: 'searchbox',
|
|
5506
5632
|
'aria-label': 'search input',
|
|
@@ -6161,11 +6287,11 @@ const tooltip = {
|
|
|
6161
6287
|
const StyledTooltip = styled__default["default"].div.withConfig({
|
|
6162
6288
|
displayName: "Tooltip__StyledTooltip",
|
|
6163
6289
|
componentId: "sc-m2im2p-0"
|
|
6164
|
-
})(["", " ", " ", " background:", ";z-index:1500;white-space:nowrap
|
|
6290
|
+
})(["", " ", " ", " background:", ";z-index:1500;white-space:nowrap;"], edsUtils.typographyTemplate(tooltip.typography), edsUtils.spacingsTemplate(tooltip.spacings), edsUtils.bordersTemplate(tooltip.border), tooltip.background);
|
|
6165
6291
|
const ArrowWrapper$1 = styled__default["default"].div.withConfig({
|
|
6166
6292
|
displayName: "Tooltip__ArrowWrapper",
|
|
6167
6293
|
componentId: "sc-m2im2p-1"
|
|
6168
|
-
})(["
|
|
6294
|
+
})(["position:absolute;width:", ";height:", ";z-index:-1;"], tooltip.entities.arrow.width, tooltip.entities.arrow.height);
|
|
6169
6295
|
const TooltipArrow = styled__default["default"].svg.withConfig({
|
|
6170
6296
|
displayName: "Tooltip__TooltipArrow",
|
|
6171
6297
|
componentId: "sc-m2im2p-2"
|
|
@@ -6175,96 +6301,115 @@ const Tooltip = /*#__PURE__*/react.forwardRef(function Tooltip(_ref, ref) {
|
|
|
6175
6301
|
title,
|
|
6176
6302
|
placement = 'bottom',
|
|
6177
6303
|
children,
|
|
6178
|
-
enterDelay = 100,
|
|
6179
|
-
id,
|
|
6180
6304
|
style,
|
|
6305
|
+
enterDelay = 100,
|
|
6181
6306
|
...rest
|
|
6182
6307
|
} = _ref;
|
|
6183
|
-
const
|
|
6184
|
-
const [popperEl, setPopperEl] = react.useState(null);
|
|
6185
|
-
const [arrowRef, setArrowRef] = react.useState(null);
|
|
6308
|
+
const arrowRef = react.useRef(null);
|
|
6186
6309
|
const [open, setOpen] = react.useState(false);
|
|
6187
|
-
const
|
|
6188
|
-
const tooltipRef = edsUtils.useCombinedRefs(setPopperEl, ref);
|
|
6189
|
-
const anchorRef = react.useRef();
|
|
6190
|
-
const combinedChilddRef = edsUtils.useCombinedRefs(anchorRef, children === null || children === void 0 ? void 0 : children.ref);
|
|
6191
|
-
const tooltipId = edsUtils.useId(id, 'tooltip');
|
|
6192
|
-
const containerId = 'eds-tooltip-container';
|
|
6193
|
-
const shouldOpen = isMounted && title !== '';
|
|
6194
|
-
react.useEffect(() => {
|
|
6195
|
-
if (document.getElementById(containerId) === null) {
|
|
6196
|
-
const tooltipContainerElement = document.createElement('div');
|
|
6197
|
-
tooltipContainerElement.id = containerId;
|
|
6198
|
-
document.body.appendChild(tooltipContainerElement);
|
|
6199
|
-
}
|
|
6200
|
-
|
|
6201
|
-
return () => {
|
|
6202
|
-
clearTimeout(openTimer.current);
|
|
6203
|
-
};
|
|
6204
|
-
}, []);
|
|
6205
|
-
|
|
6206
|
-
const openTooltip = () => {
|
|
6207
|
-
if (shouldOpen) {
|
|
6208
|
-
clearTimeout(openTimer.current);
|
|
6209
|
-
openTimer.current = setTimeout(() => {
|
|
6210
|
-
setOpen(true);
|
|
6211
|
-
}, enterDelay);
|
|
6212
|
-
}
|
|
6213
|
-
};
|
|
6214
|
-
|
|
6215
|
-
const closeTooltip = () => {
|
|
6216
|
-
clearTimeout(openTimer.current);
|
|
6217
|
-
setOpen(false);
|
|
6218
|
-
};
|
|
6219
|
-
|
|
6220
|
-
edsUtils.useGlobalKeyPress('Escape', () => closeTooltip());
|
|
6310
|
+
const shouldOpen = title !== '';
|
|
6221
6311
|
const {
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6312
|
+
x,
|
|
6313
|
+
y,
|
|
6314
|
+
reference,
|
|
6315
|
+
floating,
|
|
6316
|
+
strategy,
|
|
6317
|
+
context,
|
|
6318
|
+
middlewareData: {
|
|
6319
|
+
arrow: {
|
|
6320
|
+
x: arrowX,
|
|
6321
|
+
y: arrowY
|
|
6322
|
+
} = {}
|
|
6323
|
+
},
|
|
6324
|
+
placement: finalPlacement
|
|
6325
|
+
} = reactDomInteractions.useFloating({
|
|
6228
6326
|
placement,
|
|
6229
|
-
offset: 14
|
|
6230
|
-
});
|
|
6231
|
-
const props = {
|
|
6232
6327
|
open,
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6328
|
+
onOpenChange: setOpen,
|
|
6329
|
+
middleware: [reactDomInteractions.offset(14), reactDomInteractions.flip(), reactDomInteractions.shift({
|
|
6330
|
+
padding: 8
|
|
6331
|
+
}), reactDomInteractions.arrow({
|
|
6332
|
+
element: arrowRef
|
|
6333
|
+
})],
|
|
6334
|
+
whileElementsMounted: reactDomInteractions.autoUpdate
|
|
6335
|
+
});
|
|
6336
|
+
const anchorRef = react.useMemo(() => edsUtils.mergeRefs(reference, children === null || children === void 0 ? void 0 : children.ref), [reference, children === null || children === void 0 ? void 0 : children.ref]);
|
|
6337
|
+
const tooltipRef = react.useMemo(() => edsUtils.mergeRefs(floating, ref), [floating, ref]);
|
|
6338
|
+
const {
|
|
6339
|
+
getReferenceProps,
|
|
6340
|
+
getFloatingProps
|
|
6341
|
+
} = reactDomInteractions.useInteractions([reactDomInteractions.useHover(context, {
|
|
6342
|
+
delay: {
|
|
6343
|
+
open: enterDelay
|
|
6344
|
+
}
|
|
6345
|
+
}), reactDomInteractions.useFocus(context), reactDomInteractions.useRole(context, {
|
|
6346
|
+
role: 'tooltip'
|
|
6347
|
+
}), reactDomInteractions.useDismiss(context)]);
|
|
6348
|
+
const staticSide = {
|
|
6349
|
+
top: 'bottom',
|
|
6350
|
+
right: 'left',
|
|
6351
|
+
bottom: 'top',
|
|
6352
|
+
left: 'right'
|
|
6353
|
+
}[finalPlacement.split('-')[0]];
|
|
6354
|
+
let arrowTransform = 'none';
|
|
6355
|
+
|
|
6356
|
+
switch (staticSide) {
|
|
6357
|
+
case 'right':
|
|
6358
|
+
arrowTransform = 'rotateY(180deg)';
|
|
6359
|
+
break;
|
|
6360
|
+
|
|
6361
|
+
case 'left':
|
|
6362
|
+
arrowTransform = 'none';
|
|
6363
|
+
break;
|
|
6364
|
+
|
|
6365
|
+
case 'top':
|
|
6366
|
+
arrowTransform = 'rotate(90deg)';
|
|
6367
|
+
break;
|
|
6368
|
+
|
|
6369
|
+
case 'bottom':
|
|
6370
|
+
arrowTransform = 'rotate(-90deg)';
|
|
6371
|
+
break;
|
|
6372
|
+
}
|
|
6373
|
+
|
|
6374
|
+
if (arrowRef.current) {
|
|
6375
|
+
Object.assign(arrowRef.current.style, {
|
|
6376
|
+
left: arrowX != null ? "".concat(arrowX, "px") : '',
|
|
6377
|
+
top: arrowY != null ? "".concat(arrowY, "px") : '',
|
|
6378
|
+
right: '',
|
|
6379
|
+
bottom: '',
|
|
6380
|
+
[staticSide]: '-6px',
|
|
6381
|
+
transform: arrowTransform
|
|
6382
|
+
});
|
|
6383
|
+
}
|
|
6384
|
+
|
|
6385
|
+
const updatedChildren = /*#__PURE__*/react.cloneElement(children, { ...getReferenceProps({
|
|
6386
|
+
ref: anchorRef,
|
|
6387
|
+
...children.props
|
|
6388
|
+
})
|
|
6249
6389
|
});
|
|
6250
6390
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6251
|
-
children: [
|
|
6252
|
-
id:
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6391
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactDomInteractions.FloatingPortal, {
|
|
6392
|
+
id: "eds-tooltip-container",
|
|
6393
|
+
children: shouldOpen && open && /*#__PURE__*/jsxRuntime.jsxs(StyledTooltip, { ...rest,
|
|
6394
|
+
...getFloatingProps({
|
|
6395
|
+
ref: tooltipRef,
|
|
6396
|
+
style: { ...style,
|
|
6397
|
+
position: strategy,
|
|
6398
|
+
top: y !== null && y !== void 0 ? y : 0,
|
|
6399
|
+
left: x !== null && x !== void 0 ? x : 0
|
|
6400
|
+
}
|
|
6401
|
+
}),
|
|
6402
|
+
children: [title, /*#__PURE__*/jsxRuntime.jsx(ArrowWrapper$1, {
|
|
6403
|
+
ref: arrowRef,
|
|
6404
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TooltipArrow, {
|
|
6405
|
+
className: "arrowSvg",
|
|
6406
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
6407
|
+
d: "M0.504838 4.86885C-0.168399 4.48524 -0.168399 3.51476 0.504838 3.13115L6 8.59227e-08L6 8L0.504838 4.86885Z"
|
|
6408
|
+
})
|
|
6264
6409
|
})
|
|
6265
|
-
})
|
|
6266
|
-
})
|
|
6267
|
-
}),
|
|
6410
|
+
})]
|
|
6411
|
+
})
|
|
6412
|
+
}), updatedChildren]
|
|
6268
6413
|
});
|
|
6269
6414
|
});
|
|
6270
6415
|
|
|
@@ -6498,9 +6643,9 @@ const PopoverPaper = styled__default["default"](Paper).withConfig({
|
|
|
6498
6643
|
theme,
|
|
6499
6644
|
open
|
|
6500
6645
|
} = _ref;
|
|
6501
|
-
return styled.css(["", " ", " display:grid;grid-auto-columns:auto;align-items:center;align-content:start;background:", ";width:max-content;max-height:", ";max-width:", ";", " z-index:1400
|
|
6646
|
+
return styled.css(["", " ", " display:grid;grid-auto-columns:auto;align-items:center;align-content:start;background:", ";width:max-content;max-height:", ";max-width:", ";", " z-index:1400;overflow:auto;"], {
|
|
6502
6647
|
visibility: open ? null : 'hidden'
|
|
6503
|
-
}, edsUtils.typographyTemplate(theme.typography), theme.background, theme.maxHeight, theme.maxWidth, edsUtils.bordersTemplate(theme.border)
|
|
6648
|
+
}, edsUtils.typographyTemplate(theme.typography), theme.background, theme.maxHeight, theme.maxWidth, edsUtils.bordersTemplate(theme.border));
|
|
6504
6649
|
});
|
|
6505
6650
|
const ArrowWrapper = styled__default["default"].div.withConfig({
|
|
6506
6651
|
displayName: "Popover__ArrowWrapper",
|
|
@@ -6509,7 +6654,7 @@ const ArrowWrapper = styled__default["default"].div.withConfig({
|
|
|
6509
6654
|
let {
|
|
6510
6655
|
theme
|
|
6511
6656
|
} = _ref2;
|
|
6512
|
-
return styled.css(["
|
|
6657
|
+
return styled.css(["position:absolute;width:", ";height:", ";z-index:-1;"], theme.entities.arrow.width, theme.entities.arrow.height);
|
|
6513
6658
|
});
|
|
6514
6659
|
const InnerWrapper = styled__default["default"].div.withConfig({
|
|
6515
6660
|
displayName: "Popover__InnerWrapper",
|
|
@@ -6534,41 +6679,90 @@ const Popover$1 = /*#__PURE__*/react.forwardRef(function Popover(_ref5, ref) {
|
|
|
6534
6679
|
children,
|
|
6535
6680
|
placement = 'bottom',
|
|
6536
6681
|
anchorEl,
|
|
6682
|
+
style,
|
|
6537
6683
|
open,
|
|
6538
6684
|
onClose,
|
|
6539
6685
|
...rest
|
|
6540
6686
|
} = _ref5;
|
|
6541
|
-
const
|
|
6542
|
-
const
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6687
|
+
const arrowRef = react.useRef(null);
|
|
6688
|
+
const {
|
|
6689
|
+
x,
|
|
6690
|
+
y,
|
|
6691
|
+
reference,
|
|
6692
|
+
floating,
|
|
6693
|
+
refs,
|
|
6694
|
+
update,
|
|
6695
|
+
strategy,
|
|
6696
|
+
context,
|
|
6697
|
+
middlewareData: {
|
|
6698
|
+
arrow: {
|
|
6699
|
+
x: arrowX,
|
|
6700
|
+
y: arrowY
|
|
6701
|
+
} = {}
|
|
6702
|
+
},
|
|
6703
|
+
placement: finalPlacement
|
|
6704
|
+
} = reactDomInteractions.useFloating({
|
|
6705
|
+
placement,
|
|
6706
|
+
open,
|
|
6707
|
+
onOpenChange: onClose,
|
|
6708
|
+
middleware: [reactDomInteractions.offset(14), reactDomInteractions.flip(), reactDomInteractions.shift({
|
|
6709
|
+
padding: 8
|
|
6710
|
+
}), reactDomInteractions.arrow({
|
|
6711
|
+
element: arrowRef
|
|
6712
|
+
})]
|
|
6554
6713
|
});
|
|
6714
|
+
react.useLayoutEffect(() => {
|
|
6715
|
+
reference(anchorEl);
|
|
6716
|
+
}, [anchorEl, reference]);
|
|
6717
|
+
const popoverRef = react.useMemo(() => edsUtils.mergeRefs(floating, ref), [floating, ref]);
|
|
6555
6718
|
react.useEffect(() => {
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6719
|
+
if (refs.reference.current && refs.floating.current && open) {
|
|
6720
|
+
return reactDomInteractions.autoUpdate(refs.reference.current, refs.floating.current, update);
|
|
6721
|
+
}
|
|
6722
|
+
}, [refs.reference, refs.floating, update, open]);
|
|
6559
6723
|
const {
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
});
|
|
6724
|
+
getFloatingProps
|
|
6725
|
+
} = reactDomInteractions.useInteractions([reactDomInteractions.useDismiss(context)]);
|
|
6726
|
+
const staticSide = {
|
|
6727
|
+
top: 'bottom',
|
|
6728
|
+
right: 'left',
|
|
6729
|
+
bottom: 'top',
|
|
6730
|
+
left: 'right'
|
|
6731
|
+
}[finalPlacement.split('-')[0]];
|
|
6732
|
+
let arrowTransform = 'none';
|
|
6733
|
+
|
|
6734
|
+
switch (staticSide) {
|
|
6735
|
+
case 'right':
|
|
6736
|
+
arrowTransform = 'rotateY(180deg)';
|
|
6737
|
+
break;
|
|
6738
|
+
|
|
6739
|
+
case 'left':
|
|
6740
|
+
arrowTransform = 'none';
|
|
6741
|
+
break;
|
|
6742
|
+
|
|
6743
|
+
case 'top':
|
|
6744
|
+
arrowTransform = 'rotate(90deg)';
|
|
6745
|
+
break;
|
|
6746
|
+
|
|
6747
|
+
case 'bottom':
|
|
6748
|
+
arrowTransform = 'rotate(-90deg)';
|
|
6749
|
+
break;
|
|
6750
|
+
}
|
|
6751
|
+
|
|
6752
|
+
if (arrowRef.current) {
|
|
6753
|
+
Object.assign(arrowRef.current.style, {
|
|
6754
|
+
left: arrowX != null ? "".concat(arrowX, "px") : '',
|
|
6755
|
+
top: arrowY != null ? "".concat(arrowY, "px") : '',
|
|
6756
|
+
right: '',
|
|
6757
|
+
bottom: '',
|
|
6758
|
+
[staticSide]: '-6px',
|
|
6759
|
+
transform: arrowTransform
|
|
6760
|
+
});
|
|
6761
|
+
}
|
|
6762
|
+
|
|
6568
6763
|
const props = {
|
|
6569
6764
|
open,
|
|
6570
|
-
...rest
|
|
6571
|
-
...attributes.popper
|
|
6765
|
+
...rest
|
|
6572
6766
|
};
|
|
6573
6767
|
const {
|
|
6574
6768
|
density
|
|
@@ -6579,13 +6773,18 @@ const Popover$1 = /*#__PURE__*/react.forwardRef(function Popover(_ref5, ref) {
|
|
|
6579
6773
|
return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
6580
6774
|
theme: token,
|
|
6581
6775
|
children: /*#__PURE__*/jsxRuntime.jsxs(PopoverPaper, {
|
|
6582
|
-
ref: popoverRef,
|
|
6583
6776
|
elevation: "overlay",
|
|
6584
|
-
style: styles.popper,
|
|
6585
6777
|
...props,
|
|
6778
|
+
...getFloatingProps({
|
|
6779
|
+
ref: popoverRef,
|
|
6780
|
+
style: { ...style,
|
|
6781
|
+
position: strategy,
|
|
6782
|
+
top: y !== null && y !== void 0 ? y : 0,
|
|
6783
|
+
left: x !== null && x !== void 0 ? x : 0
|
|
6784
|
+
}
|
|
6785
|
+
}),
|
|
6586
6786
|
children: [/*#__PURE__*/jsxRuntime.jsx(ArrowWrapper, {
|
|
6587
|
-
ref:
|
|
6588
|
-
style: styles.arrow,
|
|
6787
|
+
ref: arrowRef,
|
|
6589
6788
|
className: "arrow",
|
|
6590
6789
|
children: /*#__PURE__*/jsxRuntime.jsx(PopoverArrow, {
|
|
6591
6790
|
className: "arrowSvg",
|
|
@@ -7523,6 +7722,7 @@ const Breadcrumb = /*#__PURE__*/react.forwardRef(function Breadcrumb(_ref2, ref)
|
|
|
7523
7722
|
children,
|
|
7524
7723
|
maxWidth,
|
|
7525
7724
|
href,
|
|
7725
|
+
as,
|
|
7526
7726
|
...other
|
|
7527
7727
|
} = _ref2;
|
|
7528
7728
|
const props = { ...other,
|
|
@@ -7532,10 +7732,11 @@ const Breadcrumb = /*#__PURE__*/react.forwardRef(function Breadcrumb(_ref2, ref)
|
|
|
7532
7732
|
};
|
|
7533
7733
|
const showTooltip = maxWidth > 0;
|
|
7534
7734
|
const isHrefDefined = href !== undefined;
|
|
7735
|
+
const forwardedAs = react.useMemo(() => as ? as : isHrefDefined ? 'a' : 'span', [as, isHrefDefined]);
|
|
7535
7736
|
|
|
7536
7737
|
const crumb = /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
|
|
7537
7738
|
link: isHrefDefined,
|
|
7538
|
-
forwardedAs:
|
|
7739
|
+
forwardedAs: forwardedAs,
|
|
7539
7740
|
variant: "body_short",
|
|
7540
7741
|
...props,
|
|
7541
7742
|
children: children
|
|
@@ -7808,7 +8009,7 @@ const MenuItem = /*#__PURE__*/react.forwardRef(function MenuItem(_ref5, ref) {
|
|
|
7808
8009
|
isFocused
|
|
7809
8010
|
};
|
|
7810
8011
|
return /*#__PURE__*/jsxRuntime.jsx(Item, { ...props,
|
|
7811
|
-
ref: edsUtils.
|
|
8012
|
+
ref: edsUtils.mergeRefs(ref, el => {
|
|
7812
8013
|
if (isFocused) {
|
|
7813
8014
|
requestAnimationFrame(() => {
|
|
7814
8015
|
if (el !== null) el.focus();
|
|
@@ -7972,7 +8173,6 @@ const MenuContainer = /*#__PURE__*/react.forwardRef(function MenuContainer(_ref2
|
|
|
7972
8173
|
anchorEl,
|
|
7973
8174
|
onClose: onCloseCallback,
|
|
7974
8175
|
open,
|
|
7975
|
-
containerEl,
|
|
7976
8176
|
...rest
|
|
7977
8177
|
} = _ref2;
|
|
7978
8178
|
const {
|
|
@@ -8016,11 +8216,6 @@ const MenuContainer = /*#__PURE__*/react.forwardRef(function MenuContainer(_ref2
|
|
|
8016
8216
|
if (anchorEl) anchorEl.removeEventListener('keydown', openWithKey);
|
|
8017
8217
|
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8018
8218
|
}, [anchorEl]);
|
|
8019
|
-
edsUtils.useOutsideClick(containerEl, e => {
|
|
8020
|
-
if (open && onClose !== null && !anchorEl.contains(e.target)) {
|
|
8021
|
-
onClose();
|
|
8022
|
-
}
|
|
8023
|
-
});
|
|
8024
8219
|
edsUtils.useGlobalKeyPress('Escape', () => {
|
|
8025
8220
|
if (open && onClose !== null) {
|
|
8026
8221
|
onClose();
|
|
@@ -8045,60 +8240,82 @@ const Menu$1 = /*#__PURE__*/react.forwardRef(function Menu(_ref3, ref) {
|
|
|
8045
8240
|
let {
|
|
8046
8241
|
anchorEl,
|
|
8047
8242
|
open,
|
|
8048
|
-
placement = '
|
|
8243
|
+
placement = 'bottom',
|
|
8244
|
+
onClose,
|
|
8049
8245
|
style,
|
|
8050
8246
|
className,
|
|
8051
8247
|
...rest
|
|
8052
8248
|
} = _ref3;
|
|
8053
|
-
const [containerEl, setContainerEl] = react.useState(null);
|
|
8054
|
-
const [storedAnchorEl, setStoredAnchorEl] = react.useState(null);
|
|
8055
|
-
const isMounted = edsUtils.useIsMounted();
|
|
8056
8249
|
const {
|
|
8057
8250
|
density
|
|
8058
8251
|
} = useEds();
|
|
8059
8252
|
const token = edsUtils.useToken({
|
|
8060
8253
|
density
|
|
8061
8254
|
}, menu);
|
|
8062
|
-
react.useEffect(() => {
|
|
8063
|
-
open ? setStoredAnchorEl(anchorEl) : setStoredAnchorEl(null);
|
|
8064
|
-
return () => setStoredAnchorEl(null);
|
|
8065
|
-
}, [anchorEl, open]);
|
|
8066
8255
|
const {
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8256
|
+
x,
|
|
8257
|
+
y,
|
|
8258
|
+
reference,
|
|
8259
|
+
floating,
|
|
8260
|
+
refs,
|
|
8261
|
+
update,
|
|
8262
|
+
strategy,
|
|
8263
|
+
context
|
|
8264
|
+
} = reactDomInteractions.useFloating({
|
|
8072
8265
|
placement,
|
|
8073
|
-
|
|
8266
|
+
open,
|
|
8267
|
+
onOpenChange: onClose,
|
|
8268
|
+
middleware: [reactDomInteractions.offset(4), reactDomInteractions.flip(), reactDomInteractions.shift({
|
|
8269
|
+
padding: 8
|
|
8270
|
+
})]
|
|
8074
8271
|
});
|
|
8272
|
+
react.useLayoutEffect(() => {
|
|
8273
|
+
reference(anchorEl);
|
|
8274
|
+
}, [anchorEl, reference]);
|
|
8275
|
+
const popoverRef = react.useMemo(() => edsUtils.mergeRefs(floating, ref), [floating, ref]);
|
|
8276
|
+
react.useEffect(() => {
|
|
8277
|
+
if (refs.reference.current && refs.floating.current && open) {
|
|
8278
|
+
return reactDomInteractions.autoUpdate(refs.reference.current, refs.floating.current, update);
|
|
8279
|
+
}
|
|
8280
|
+
}, [refs.reference, refs.floating, update, open]);
|
|
8281
|
+
const {
|
|
8282
|
+
getFloatingProps
|
|
8283
|
+
} = reactDomInteractions.useInteractions([reactDomInteractions.useDismiss(context, {
|
|
8284
|
+
escapeKey: false
|
|
8285
|
+
})]);
|
|
8075
8286
|
const props = {
|
|
8076
8287
|
open,
|
|
8077
|
-
|
|
8078
|
-
...style
|
|
8079
|
-
},
|
|
8080
|
-
className,
|
|
8081
|
-
...attributes.popper
|
|
8288
|
+
className
|
|
8082
8289
|
};
|
|
8083
8290
|
const menuProps = { ...rest,
|
|
8291
|
+
onClose,
|
|
8084
8292
|
anchorEl,
|
|
8085
|
-
open
|
|
8086
|
-
containerEl
|
|
8293
|
+
open
|
|
8087
8294
|
};
|
|
8088
8295
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
8089
|
-
children:
|
|
8090
|
-
|
|
8091
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
ref:
|
|
8296
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactDomInteractions.FloatingPortal, {
|
|
8297
|
+
id: "eds-menu-container",
|
|
8298
|
+
children: /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
8299
|
+
theme: token,
|
|
8300
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MenuPaper, {
|
|
8301
|
+
elevation: "raised",
|
|
8302
|
+
...props,
|
|
8303
|
+
...getFloatingProps({
|
|
8304
|
+
ref: popoverRef,
|
|
8305
|
+
style: { ...style,
|
|
8306
|
+
position: strategy,
|
|
8307
|
+
top: y !== null && y !== void 0 ? y : 0,
|
|
8308
|
+
left: x !== null && x !== void 0 ? x : 0
|
|
8309
|
+
}
|
|
8310
|
+
}),
|
|
8311
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MenuProvider, {
|
|
8312
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MenuContainer, { ...menuProps,
|
|
8313
|
+
ref: ref
|
|
8314
|
+
})
|
|
8098
8315
|
})
|
|
8099
8316
|
})
|
|
8100
8317
|
})
|
|
8101
|
-
})
|
|
8318
|
+
})
|
|
8102
8319
|
});
|
|
8103
8320
|
});
|
|
8104
8321
|
|
|
@@ -8441,6 +8658,7 @@ const NativeSelect = /*#__PURE__*/react.forwardRef(function NativeSelect(_ref2,
|
|
|
8441
8658
|
label,
|
|
8442
8659
|
children,
|
|
8443
8660
|
className,
|
|
8661
|
+
style,
|
|
8444
8662
|
selectRef,
|
|
8445
8663
|
id,
|
|
8446
8664
|
meta,
|
|
@@ -8456,7 +8674,8 @@ const NativeSelect = /*#__PURE__*/react.forwardRef(function NativeSelect(_ref2,
|
|
|
8456
8674
|
}, nativeselect);
|
|
8457
8675
|
const containerProps = {
|
|
8458
8676
|
ref,
|
|
8459
|
-
className
|
|
8677
|
+
className,
|
|
8678
|
+
style
|
|
8460
8679
|
};
|
|
8461
8680
|
const selectProps = {
|
|
8462
8681
|
ref: selectRef,
|
|
@@ -8940,6 +9159,8 @@ const CheckboxInput = /*#__PURE__*/react.forwardRef(function CheckboxInput(_ref1
|
|
|
8940
9159
|
let {
|
|
8941
9160
|
disabled = false,
|
|
8942
9161
|
indeterminate,
|
|
9162
|
+
style,
|
|
9163
|
+
className,
|
|
8943
9164
|
...rest
|
|
8944
9165
|
} = _ref10;
|
|
8945
9166
|
const {
|
|
@@ -8951,7 +9172,9 @@ const CheckboxInput = /*#__PURE__*/react.forwardRef(function CheckboxInput(_ref1
|
|
|
8951
9172
|
const iconSize = 24;
|
|
8952
9173
|
const fill = disabled ? checkbox.states.disabled.background : checkbox.background;
|
|
8953
9174
|
const inputWrapperProps = {
|
|
8954
|
-
disabled
|
|
9175
|
+
disabled,
|
|
9176
|
+
style,
|
|
9177
|
+
className
|
|
8955
9178
|
};
|
|
8956
9179
|
const inputProps = {
|
|
8957
9180
|
ref,
|
|
@@ -9215,11 +9438,13 @@ const Checkbox = /*#__PURE__*/react.forwardRef(function Checkbox(_ref2, ref) {
|
|
|
9215
9438
|
disabled = false,
|
|
9216
9439
|
indeterminate,
|
|
9217
9440
|
className,
|
|
9441
|
+
style,
|
|
9218
9442
|
...rest
|
|
9219
9443
|
} = _ref2;
|
|
9220
9444
|
return label ? /*#__PURE__*/jsxRuntime.jsxs(StyledLabel$2, {
|
|
9221
9445
|
disabled: disabled,
|
|
9222
9446
|
className: className,
|
|
9447
|
+
style: style,
|
|
9223
9448
|
children: [/*#__PURE__*/jsxRuntime.jsx(CheckboxInput, { ...rest,
|
|
9224
9449
|
disabled: disabled,
|
|
9225
9450
|
ref: ref,
|
|
@@ -9228,6 +9453,8 @@ const Checkbox = /*#__PURE__*/react.forwardRef(function Checkbox(_ref2, ref) {
|
|
|
9228
9453
|
children: label
|
|
9229
9454
|
})]
|
|
9230
9455
|
}) : /*#__PURE__*/jsxRuntime.jsx(CheckboxInput, { ...rest,
|
|
9456
|
+
className: className,
|
|
9457
|
+
style: style,
|
|
9231
9458
|
disabled: disabled,
|
|
9232
9459
|
ref: ref,
|
|
9233
9460
|
indeterminate: indeterminate
|
|
@@ -9428,6 +9655,7 @@ const Radio = /*#__PURE__*/react.forwardRef(function Radio(_ref12, ref) {
|
|
|
9428
9655
|
label,
|
|
9429
9656
|
disabled = false,
|
|
9430
9657
|
className,
|
|
9658
|
+
style,
|
|
9431
9659
|
...rest
|
|
9432
9660
|
} = _ref12;
|
|
9433
9661
|
const {
|
|
@@ -9459,6 +9687,7 @@ const Radio = /*#__PURE__*/react.forwardRef(function Radio(_ref12, ref) {
|
|
|
9459
9687
|
children: label ? /*#__PURE__*/jsxRuntime.jsxs(StyledLabel$1, {
|
|
9460
9688
|
disabled: disabled,
|
|
9461
9689
|
className: className,
|
|
9690
|
+
style: style,
|
|
9462
9691
|
children: [/*#__PURE__*/jsxRuntime.jsxs(InputWrapper, {
|
|
9463
9692
|
disabled: disabled,
|
|
9464
9693
|
children: [/*#__PURE__*/jsxRuntime.jsx(Input$2, { ...rest,
|
|
@@ -9471,6 +9700,8 @@ const Radio = /*#__PURE__*/react.forwardRef(function Radio(_ref12, ref) {
|
|
|
9471
9700
|
})]
|
|
9472
9701
|
}) : /*#__PURE__*/jsxRuntime.jsxs(InputWrapper, {
|
|
9473
9702
|
disabled: disabled,
|
|
9703
|
+
className: className,
|
|
9704
|
+
style: style,
|
|
9474
9705
|
children: [/*#__PURE__*/jsxRuntime.jsx(Input$2, { ...rest,
|
|
9475
9706
|
ref: ref,
|
|
9476
9707
|
disabled: disabled,
|
|
@@ -9565,9 +9796,13 @@ const Handle$1 = styled__default["default"].span.withConfig({
|
|
|
9565
9796
|
const SwitchSmall = /*#__PURE__*/react.forwardRef(function SwitchSmall(_ref4, ref) {
|
|
9566
9797
|
let {
|
|
9567
9798
|
disabled,
|
|
9799
|
+
className,
|
|
9800
|
+
style,
|
|
9568
9801
|
...rest
|
|
9569
9802
|
} = _ref4;
|
|
9570
9803
|
return /*#__PURE__*/jsxRuntime.jsxs(GridWrapper, {
|
|
9804
|
+
className: className,
|
|
9805
|
+
style: style,
|
|
9571
9806
|
children: [/*#__PURE__*/jsxRuntime.jsx(Input$1, { ...rest,
|
|
9572
9807
|
ref: ref,
|
|
9573
9808
|
disabled: disabled
|
|
@@ -9627,9 +9862,13 @@ const Handle = styled__default["default"].span.withConfig({
|
|
|
9627
9862
|
const SwitchDefault = /*#__PURE__*/react.forwardRef(function SwitchDefault(_ref4, ref) {
|
|
9628
9863
|
let {
|
|
9629
9864
|
disabled,
|
|
9865
|
+
className,
|
|
9866
|
+
style,
|
|
9630
9867
|
...rest
|
|
9631
9868
|
} = _ref4;
|
|
9632
9869
|
return /*#__PURE__*/jsxRuntime.jsxs(GridWrapper, {
|
|
9870
|
+
className: className,
|
|
9871
|
+
style: style,
|
|
9633
9872
|
children: [/*#__PURE__*/jsxRuntime.jsx(Input, { ...rest,
|
|
9634
9873
|
ref: ref,
|
|
9635
9874
|
disabled: disabled
|
|
@@ -9838,6 +10077,7 @@ const Switch = /*#__PURE__*/react.forwardRef(function Switch(_ref3, ref) {
|
|
|
9838
10077
|
disabled,
|
|
9839
10078
|
label,
|
|
9840
10079
|
className,
|
|
10080
|
+
style,
|
|
9841
10081
|
...rest
|
|
9842
10082
|
} = _ref3;
|
|
9843
10083
|
const {
|
|
@@ -9853,6 +10093,7 @@ const Switch = /*#__PURE__*/react.forwardRef(function Switch(_ref3, ref) {
|
|
|
9853
10093
|
children: label ? /*#__PURE__*/jsxRuntime.jsxs(StyledLabel, {
|
|
9854
10094
|
isDisabled: disabled,
|
|
9855
10095
|
className: className,
|
|
10096
|
+
style: style,
|
|
9856
10097
|
children: [size === 'small' ? /*#__PURE__*/jsxRuntime.jsx(SwitchSmall, {
|
|
9857
10098
|
disabled: disabled,
|
|
9858
10099
|
...rest,
|
|
@@ -9866,10 +10107,14 @@ const Switch = /*#__PURE__*/react.forwardRef(function Switch(_ref3, ref) {
|
|
|
9866
10107
|
})]
|
|
9867
10108
|
}) : size === 'small' ? /*#__PURE__*/jsxRuntime.jsx(SwitchSmall, {
|
|
9868
10109
|
disabled: disabled,
|
|
10110
|
+
className: className,
|
|
10111
|
+
style: style,
|
|
9869
10112
|
...rest,
|
|
9870
10113
|
ref: ref
|
|
9871
10114
|
}) : /*#__PURE__*/jsxRuntime.jsx(SwitchDefault, {
|
|
9872
10115
|
disabled: disabled,
|
|
10116
|
+
className: className,
|
|
10117
|
+
style: style,
|
|
9873
10118
|
...rest,
|
|
9874
10119
|
ref: ref
|
|
9875
10120
|
})
|
|
@@ -10044,7 +10289,7 @@ const StyledList = styled__default["default"](List$1).withConfig({
|
|
|
10044
10289
|
let {
|
|
10045
10290
|
theme
|
|
10046
10291
|
} = _ref2;
|
|
10047
|
-
return styled.css(["background-color:", ";box-shadow:", ";", " overflow-y:auto;max-height:300px;padding:0;
|
|
10292
|
+
return styled.css(["background-color:", ";box-shadow:", ";", " overflow-y:auto;max-height:300px;padding:0;"], theme.background, theme.boxShadow, edsUtils.bordersTemplate(theme.border));
|
|
10048
10293
|
});
|
|
10049
10294
|
const StyledButton = styled__default["default"](Button).withConfig({
|
|
10050
10295
|
displayName: "Autocomplete__StyledButton",
|
|
@@ -10136,8 +10381,10 @@ function AutocompleteInner(props, ref) {
|
|
|
10136
10381
|
label,
|
|
10137
10382
|
meta,
|
|
10138
10383
|
className,
|
|
10384
|
+
style,
|
|
10139
10385
|
disabled = false,
|
|
10140
10386
|
readOnly = false,
|
|
10387
|
+
hideClearButton = false,
|
|
10141
10388
|
onOptionsChange,
|
|
10142
10389
|
selectedOptions,
|
|
10143
10390
|
multiple,
|
|
@@ -10150,10 +10397,7 @@ function AutocompleteInner(props, ref) {
|
|
|
10150
10397
|
optionLabel,
|
|
10151
10398
|
...other
|
|
10152
10399
|
} = props;
|
|
10153
|
-
const anchorRef = react.useRef();
|
|
10154
|
-
const [anchorEl, setAnchorEl] = react.useState();
|
|
10155
|
-
const [containerEl, setContainerEl] = react.useState();
|
|
10156
|
-
const isMounted = edsUtils.useIsMounted();
|
|
10400
|
+
const anchorRef = react.useRef(null);
|
|
10157
10401
|
const isControlled = Boolean(selectedOptions);
|
|
10158
10402
|
const [inputOptions, setInputOptions] = react.useState(options);
|
|
10159
10403
|
react.useEffect(() => {
|
|
@@ -10317,9 +10561,8 @@ function AutocompleteInner(props, ref) {
|
|
|
10317
10561
|
}
|
|
10318
10562
|
};
|
|
10319
10563
|
|
|
10320
|
-
if (
|
|
10564
|
+
if (!multiple) {
|
|
10321
10565
|
comboBoxProps = { ...comboBoxProps,
|
|
10322
|
-
selectedItem: selectedOptions[0] || null,
|
|
10323
10566
|
onSelectedItemChange: changes => {
|
|
10324
10567
|
if (onOptionsChange) {
|
|
10325
10568
|
const {
|
|
@@ -10331,6 +10574,12 @@ function AutocompleteInner(props, ref) {
|
|
|
10331
10574
|
}
|
|
10332
10575
|
}
|
|
10333
10576
|
};
|
|
10577
|
+
|
|
10578
|
+
if (isControlled) {
|
|
10579
|
+
comboBoxProps = { ...comboBoxProps,
|
|
10580
|
+
selectedItem: selectedOptions[0] || null
|
|
10581
|
+
};
|
|
10582
|
+
}
|
|
10334
10583
|
}
|
|
10335
10584
|
|
|
10336
10585
|
if (multiple) {
|
|
@@ -10401,40 +10650,10 @@ function AutocompleteInner(props, ref) {
|
|
|
10401
10650
|
reset: resetCombobox
|
|
10402
10651
|
} = downshift.useCombobox(comboBoxProps);
|
|
10403
10652
|
react.useEffect(() => {
|
|
10404
|
-
if (anchorRef.current && isOpen) {
|
|
10405
|
-
setAnchorEl(anchorRef.current);
|
|
10406
|
-
} else {
|
|
10407
|
-
setAnchorEl(null);
|
|
10408
|
-
}
|
|
10409
|
-
|
|
10410
10653
|
if (isControlled) {
|
|
10411
10654
|
setSelectedItems(selectedOptions);
|
|
10412
10655
|
}
|
|
10413
|
-
|
|
10414
|
-
return () => {
|
|
10415
|
-
setAnchorEl(null);
|
|
10416
|
-
setContainerEl(null);
|
|
10417
|
-
};
|
|
10418
|
-
}, [anchorRef, isControlled, isOpen, selectedOptions, setSelectedItems]); //"Turn on" popper on load to position menu correctly and then turn it off
|
|
10419
|
-
|
|
10420
|
-
react.useEffect(() => {
|
|
10421
|
-
if (anchorRef.current) {
|
|
10422
|
-
setAnchorEl(anchorRef.current);
|
|
10423
|
-
setTimeout(() => {
|
|
10424
|
-
setAnchorEl(null);
|
|
10425
|
-
}, 1);
|
|
10426
|
-
}
|
|
10427
|
-
}, []);
|
|
10428
|
-
const {
|
|
10429
|
-
styles,
|
|
10430
|
-
attributes
|
|
10431
|
-
} = edsUtils.usePopper({
|
|
10432
|
-
anchorEl,
|
|
10433
|
-
popperEl: containerEl,
|
|
10434
|
-
placement: 'bottom-start',
|
|
10435
|
-
offset: 4,
|
|
10436
|
-
autoWidth
|
|
10437
|
-
});
|
|
10656
|
+
}, [isControlled, selectedOptions, setSelectedItems]);
|
|
10438
10657
|
|
|
10439
10658
|
const openSelect = () => {
|
|
10440
10659
|
if (!isOpen && !(disabled || readOnly)) {
|
|
@@ -10442,38 +10661,85 @@ function AutocompleteInner(props, ref) {
|
|
|
10442
10661
|
}
|
|
10443
10662
|
};
|
|
10444
10663
|
|
|
10664
|
+
const {
|
|
10665
|
+
x,
|
|
10666
|
+
y,
|
|
10667
|
+
refs,
|
|
10668
|
+
update,
|
|
10669
|
+
reference,
|
|
10670
|
+
floating,
|
|
10671
|
+
strategy
|
|
10672
|
+
} = reactDomInteractions.useFloating({
|
|
10673
|
+
placement: 'bottom-start',
|
|
10674
|
+
middleware: [reactDomInteractions.offset(4), reactDomInteractions.flip(), reactDomInteractions.shift({
|
|
10675
|
+
padding: 8
|
|
10676
|
+
}), reactDomInteractions.size({
|
|
10677
|
+
apply(_ref10) {
|
|
10678
|
+
let {
|
|
10679
|
+
rects,
|
|
10680
|
+
availableHeight,
|
|
10681
|
+
elements
|
|
10682
|
+
} = _ref10;
|
|
10683
|
+
const anchorWidth = "".concat(rects.reference.width, "px");
|
|
10684
|
+
Object.assign(elements.floating.style, {
|
|
10685
|
+
width: "".concat(autoWidth ? anchorWidth : 'auto'),
|
|
10686
|
+
maxHeight: "".concat(availableHeight, "px")
|
|
10687
|
+
});
|
|
10688
|
+
},
|
|
10689
|
+
|
|
10690
|
+
padding: 10
|
|
10691
|
+
})]
|
|
10692
|
+
});
|
|
10693
|
+
const {
|
|
10694
|
+
getFloatingProps
|
|
10695
|
+
} = reactDomInteractions.useInteractions([]);
|
|
10696
|
+
react.useLayoutEffect(() => {
|
|
10697
|
+
reference(anchorRef.current);
|
|
10698
|
+
}, [anchorRef, reference]);
|
|
10699
|
+
react.useLayoutEffect(() => {
|
|
10700
|
+
if (refs.reference.current && refs.floating.current && isOpen) {
|
|
10701
|
+
return reactDomInteractions.autoUpdate(refs.reference.current, refs.floating.current, update);
|
|
10702
|
+
}
|
|
10703
|
+
}, [refs.reference, refs.floating, update, isOpen]);
|
|
10704
|
+
|
|
10445
10705
|
const clear = () => {
|
|
10446
10706
|
resetCombobox();
|
|
10447
10707
|
resetSelection();
|
|
10448
10708
|
};
|
|
10449
10709
|
|
|
10450
|
-
const showClearButton = (selectedItems.length > 0 || inputValue) && !readOnly;
|
|
10710
|
+
const showClearButton = (selectedItems.length > 0 || inputValue) && !readOnly && !hideClearButton;
|
|
10451
10711
|
const selectedItemsLabels = react.useMemo(() => selectedItems.map(getLabel), [selectedItems, getLabel]);
|
|
10452
10712
|
|
|
10453
|
-
const optionsList = /*#__PURE__*/jsxRuntime.jsx(
|
|
10454
|
-
ref:
|
|
10455
|
-
style:
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10459
|
-
|
|
10713
|
+
const optionsList = /*#__PURE__*/jsxRuntime.jsx("div", { ...getFloatingProps({
|
|
10714
|
+
ref: floating,
|
|
10715
|
+
style: {
|
|
10716
|
+
position: strategy,
|
|
10717
|
+
top: y !== null && y !== void 0 ? y : 0,
|
|
10718
|
+
left: x !== null && x !== void 0 ? x : 0
|
|
10719
|
+
}
|
|
10460
10720
|
}),
|
|
10461
|
-
children:
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
isSelected
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
index,
|
|
10474
|
-
|
|
10475
|
-
|
|
10476
|
-
|
|
10721
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledList, { ...getMenuProps({
|
|
10722
|
+
'aria-multiselectable': multiple ? 'true' : null
|
|
10723
|
+
}, {
|
|
10724
|
+
suppressRefError: true
|
|
10725
|
+
}),
|
|
10726
|
+
children: !isOpen ? null : availableItems.map((item, index) => {
|
|
10727
|
+
const label = getLabel(item);
|
|
10728
|
+
const isDisabled = optionDisabled(item);
|
|
10729
|
+
const isSelected = selectedItemsLabels.includes(label);
|
|
10730
|
+
return /*#__PURE__*/jsxRuntime.jsx(AutocompleteOption, {
|
|
10731
|
+
value: label,
|
|
10732
|
+
multiple: multiple,
|
|
10733
|
+
highlighted: highlightedIndex === index && !isDisabled ? 'true' : 'false',
|
|
10734
|
+
isSelected: isSelected,
|
|
10735
|
+
isDisabled: isDisabled,
|
|
10736
|
+
...getItemProps({
|
|
10737
|
+
item,
|
|
10738
|
+
index,
|
|
10739
|
+
disabled
|
|
10740
|
+
})
|
|
10741
|
+
}, label);
|
|
10742
|
+
})
|
|
10477
10743
|
})
|
|
10478
10744
|
});
|
|
10479
10745
|
|
|
@@ -10481,6 +10747,7 @@ function AutocompleteInner(props, ref) {
|
|
|
10481
10747
|
theme: token,
|
|
10482
10748
|
children: /*#__PURE__*/jsxRuntime.jsxs(Container, {
|
|
10483
10749
|
className: className,
|
|
10750
|
+
style: style,
|
|
10484
10751
|
ref: ref,
|
|
10485
10752
|
children: [/*#__PURE__*/jsxRuntime.jsx(Label$1, { ...getLabelProps(),
|
|
10486
10753
|
label: label,
|
|
@@ -10491,7 +10758,7 @@ function AutocompleteInner(props, ref) {
|
|
|
10491
10758
|
getDropdownProps({
|
|
10492
10759
|
preventKeyAction: multiple ? isOpen : undefined,
|
|
10493
10760
|
disabled,
|
|
10494
|
-
ref:
|
|
10761
|
+
ref: refs.reference
|
|
10495
10762
|
})),
|
|
10496
10763
|
placeholder: placeholderText,
|
|
10497
10764
|
readOnly: readOnly,
|
|
@@ -10522,7 +10789,10 @@ function AutocompleteInner(props, ref) {
|
|
|
10522
10789
|
data: isOpen ? edsIcons.arrow_drop_up : edsIcons.arrow_drop_down
|
|
10523
10790
|
})
|
|
10524
10791
|
})]
|
|
10525
|
-
}), disablePortal ? optionsList :
|
|
10792
|
+
}), disablePortal ? optionsList : /*#__PURE__*/jsxRuntime.jsx(reactDomInteractions.FloatingPortal, {
|
|
10793
|
+
id: "eds-autocomplete-container",
|
|
10794
|
+
children: optionsList
|
|
10795
|
+
})]
|
|
10526
10796
|
})
|
|
10527
10797
|
});
|
|
10528
10798
|
}
|