@equinor/eds-core-react 2.4.0-beta.0 → 2.4.0
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/build/index.css +2 -336
- package/build/index.min.css +1 -1
- package/dist/eds-core-react.cjs +1 -5
- package/dist/esm/components/Autocomplete/MultipleInput.js +2 -2
- package/dist/esm/components/Autocomplete/useAutocomplete.js +0 -4
- package/dist/esm/components/InputWrapper/InputWrapper.js +1 -1
- package/dist/esm/components/Textarea/Textarea.js +1 -1
- package/dist/esm-next/components/next/Input/Input.js +1 -1
- package/dist/esm-next/components/next/TextField/TextField.js +1 -0
- package/dist/esm-next/index.next.js +0 -5
- package/dist/index.next.cjs +6 -417
- package/dist/types/components/Autocomplete/AutocompleteContext.d.ts +2 -2
- package/dist/types/components/Autocomplete/useAutocomplete.d.ts +2 -2
- package/dist/types/components/next/Input/Input.types.d.ts +1 -4
- package/dist/types/components/next/index.d.ts +0 -10
- package/package.json +32 -39
- package/dist/esm-next/components/next/Banner/Banner.js +0 -88
- package/dist/esm-next/components/next/Link/Link.js +0 -24
- package/dist/esm-next/components/next/Search/Search.js +0 -118
- package/dist/esm-next/components/next/TextArea/TextArea.js +0 -131
- package/dist/esm-next/components/next/Tooltip/Tooltip.js +0 -84
- package/dist/types/components/next/Banner/Banner.d.ts +0 -23
- package/dist/types/components/next/Banner/Banner.figma.d.ts +0 -1
- package/dist/types/components/next/Banner/Banner.types.d.ts +0 -33
- package/dist/types/components/next/Banner/index.d.ts +0 -2
- package/dist/types/components/next/Link/Link.d.ts +0 -4
- package/dist/types/components/next/Link/Link.figma.d.ts +0 -1
- package/dist/types/components/next/Link/Link.types.d.ts +0 -11
- package/dist/types/components/next/Link/index.d.ts +0 -2
- package/dist/types/components/next/Search/Search.d.ts +0 -9
- package/dist/types/components/next/Search/Search.figma.d.ts +0 -1
- package/dist/types/components/next/Search/Search.types.d.ts +0 -16
- package/dist/types/components/next/Search/index.d.ts +0 -2
- package/dist/types/components/next/TextArea/TextArea.d.ts +0 -11
- package/dist/types/components/next/TextArea/TextArea.figma.d.ts +0 -1
- package/dist/types/components/next/TextArea/TextArea.types.d.ts +0 -21
- package/dist/types/components/next/TextArea/index.d.ts +0 -2
- package/dist/types/components/next/Tooltip/Tooltip.d.ts +0 -7
- package/dist/types/components/next/Tooltip/Tooltip.figma.d.ts +0 -1
- package/dist/types/components/next/Tooltip/Tooltip.types.d.ts +0 -17
- package/dist/types/components/next/Tooltip/index.d.ts +0 -2
package/dist/index.next.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
|
-
var edsIcons = require('@equinor/eds-icons');
|
|
5
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var
|
|
5
|
+
var edsIcons = require('@equinor/eds-icons');
|
|
7
6
|
var reactDom = require('react-dom');
|
|
8
7
|
var styled = require('styled-components');
|
|
8
|
+
var edsUtils = require('@equinor/eds-utils');
|
|
9
9
|
var edsTokens = require('@equinor/eds-tokens');
|
|
10
10
|
var react$1 = require('@floating-ui/react');
|
|
11
11
|
|
|
@@ -609,7 +609,7 @@ const Input = /*#__PURE__*/react.forwardRef(function Input({
|
|
|
609
609
|
})]
|
|
610
610
|
}), /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
611
611
|
ref: ref,
|
|
612
|
-
type:
|
|
612
|
+
type: type,
|
|
613
613
|
disabled: disabled,
|
|
614
614
|
readOnly: readOnly,
|
|
615
615
|
className: ['eds-input', className].filter(Boolean).join(' '),
|
|
@@ -709,7 +709,7 @@ const TooltipArrow = styled__default.default.svg.withConfig({
|
|
|
709
709
|
displayName: "Tooltip__TooltipArrow",
|
|
710
710
|
componentId: "sc-m2im2p-2"
|
|
711
711
|
})(["width:", ";height:", ";position:absolute;fill:", ";"], tooltip.entities.arrow.width, tooltip.entities.arrow.height, tooltip.background);
|
|
712
|
-
const Tooltip
|
|
712
|
+
const Tooltip = /*#__PURE__*/react.forwardRef(function Tooltip({
|
|
713
713
|
title,
|
|
714
714
|
placement = 'bottom',
|
|
715
715
|
children,
|
|
@@ -856,13 +856,14 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField({
|
|
|
856
856
|
} = useFieldIds(providedId);
|
|
857
857
|
return /*#__PURE__*/jsxRuntime.jsxs(Field, {
|
|
858
858
|
disabled: disabled,
|
|
859
|
+
className: "eds-text-field",
|
|
859
860
|
children: [label && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
860
861
|
className: "eds-text-field__header",
|
|
861
862
|
children: [/*#__PURE__*/jsxRuntime.jsx(Field.Label, {
|
|
862
863
|
htmlFor: inputId,
|
|
863
864
|
indicator: indicator,
|
|
864
865
|
children: label
|
|
865
|
-
}), labelInfo && /*#__PURE__*/jsxRuntime.jsx(Tooltip
|
|
866
|
+
}), labelInfo && /*#__PURE__*/jsxRuntime.jsx(Tooltip, {
|
|
866
867
|
title: labelInfo,
|
|
867
868
|
placement: "top",
|
|
868
869
|
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
@@ -900,424 +901,12 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField({
|
|
|
900
901
|
});
|
|
901
902
|
});
|
|
902
903
|
|
|
903
|
-
const TextArea = /*#__PURE__*/react.forwardRef(function TextArea({
|
|
904
|
-
label,
|
|
905
|
-
labelInfo,
|
|
906
|
-
indicator,
|
|
907
|
-
description,
|
|
908
|
-
helperMessage,
|
|
909
|
-
id: providedId,
|
|
910
|
-
invalid,
|
|
911
|
-
disabled,
|
|
912
|
-
maxRows,
|
|
913
|
-
showCharacterCount,
|
|
914
|
-
...textareaProps
|
|
915
|
-
}, ref) {
|
|
916
|
-
const {
|
|
917
|
-
inputId,
|
|
918
|
-
descriptionId,
|
|
919
|
-
helperMessageId,
|
|
920
|
-
getDescribedBy
|
|
921
|
-
} = useFieldIds(providedId);
|
|
922
|
-
const [charCount, setCharCount] = react.useState(() => String(textareaProps.value ?? textareaProps.defaultValue ?? '').length);
|
|
923
|
-
react.useEffect(() => {
|
|
924
|
-
if (textareaProps.value !== undefined) {
|
|
925
|
-
setCharCount(String(textareaProps.value).length);
|
|
926
|
-
}
|
|
927
|
-
}, [textareaProps.value]);
|
|
928
|
-
const {
|
|
929
|
-
maxLength,
|
|
930
|
-
onChange: onChangeProp,
|
|
931
|
-
...restTextareaProps
|
|
932
|
-
} = textareaProps;
|
|
933
|
-
const handleChange = e => {
|
|
934
|
-
setCharCount(e.target.value.length);
|
|
935
|
-
onChangeProp?.(e);
|
|
936
|
-
};
|
|
937
|
-
const internalRef = react.useRef(null);
|
|
938
|
-
const [maxPixelHeight, setMaxPixelHeight] = react.useState(undefined);
|
|
939
|
-
|
|
940
|
-
// Auto-grow is always on. When maxRows is set, compute a pixel cap after
|
|
941
|
-
// mount using the element's actual rendered line-height and padding
|
|
942
|
-
// (density-aware). Until the cap is computed (or if maxRows is not set),
|
|
943
|
-
// pass Infinity so the textarea grows without bound.
|
|
944
|
-
const autoResizeHeight = maxRows !== undefined && maxPixelHeight !== undefined ? maxPixelHeight : Infinity;
|
|
945
|
-
const autoResizeRef = edsUtils.useAutoResize(autoResizeHeight);
|
|
946
|
-
react.useEffect(() => {
|
|
947
|
-
if (!maxRows || !internalRef.current) return;
|
|
948
|
-
const el = internalRef.current;
|
|
949
|
-
const updateMaxHeight = () => {
|
|
950
|
-
const style = window.getComputedStyle(el);
|
|
951
|
-
const lineHeight = parseFloat(style.lineHeight);
|
|
952
|
-
const paddingBlockStart = parseFloat(style.paddingBlockStart);
|
|
953
|
-
const paddingBlockEnd = parseFloat(style.paddingBlockEnd);
|
|
954
|
-
setMaxPixelHeight(lineHeight * maxRows + paddingBlockStart + paddingBlockEnd);
|
|
955
|
-
};
|
|
956
|
-
const observer = new ResizeObserver(updateMaxHeight);
|
|
957
|
-
observer.observe(el);
|
|
958
|
-
updateMaxHeight();
|
|
959
|
-
return () => observer.disconnect();
|
|
960
|
-
}, [maxRows]);
|
|
961
|
-
const combinedRef = react.useMemo(() => edsUtils.mergeRefs(ref, autoResizeRef, internalRef), [ref, autoResizeRef, internalRef]);
|
|
962
|
-
const showHelperRow = helperMessage || showCharacterCount;
|
|
963
|
-
return /*#__PURE__*/jsxRuntime.jsxs(Field, {
|
|
964
|
-
className: "eds-text-area",
|
|
965
|
-
disabled: disabled,
|
|
966
|
-
children: [label && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
967
|
-
className: "label-row",
|
|
968
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Field.Label, {
|
|
969
|
-
htmlFor: inputId,
|
|
970
|
-
indicator: indicator,
|
|
971
|
-
children: label
|
|
972
|
-
}), labelInfo && /*#__PURE__*/jsxRuntime.jsx(Tooltip$1, {
|
|
973
|
-
title: labelInfo,
|
|
974
|
-
placement: "top",
|
|
975
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
976
|
-
variant: "ghost",
|
|
977
|
-
icon: true,
|
|
978
|
-
round: true,
|
|
979
|
-
size: "small",
|
|
980
|
-
tone: "neutral",
|
|
981
|
-
"aria-label": "More information",
|
|
982
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
983
|
-
data: edsIcons.info_circle,
|
|
984
|
-
size: "xs"
|
|
985
|
-
})
|
|
986
|
-
})
|
|
987
|
-
})]
|
|
988
|
-
}), description && /*#__PURE__*/jsxRuntime.jsx(Field.Description, {
|
|
989
|
-
id: descriptionId,
|
|
990
|
-
children: description
|
|
991
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
992
|
-
ref: combinedRef,
|
|
993
|
-
as: "textarea",
|
|
994
|
-
id: inputId,
|
|
995
|
-
disabled: disabled,
|
|
996
|
-
invalid: invalid,
|
|
997
|
-
maxLength: maxLength,
|
|
998
|
-
onChange: handleChange,
|
|
999
|
-
"aria-describedby": getDescribedBy({
|
|
1000
|
-
hasDescription: !!description,
|
|
1001
|
-
hasHelperMessage: !!helperMessage
|
|
1002
|
-
}),
|
|
1003
|
-
...restTextareaProps
|
|
1004
|
-
}), showHelperRow && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1005
|
-
className: "helper-row",
|
|
1006
|
-
children: [helperMessage && /*#__PURE__*/jsxRuntime.jsx(Field.HelperMessage, {
|
|
1007
|
-
id: helperMessageId,
|
|
1008
|
-
role: invalid ? 'alert' : undefined,
|
|
1009
|
-
children: helperMessage
|
|
1010
|
-
}), showCharacterCount && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1011
|
-
className: "char-count",
|
|
1012
|
-
"data-font-family": "ui",
|
|
1013
|
-
"data-font-size": "xs",
|
|
1014
|
-
"aria-live": maxLength !== undefined && charCount >= maxLength * 0.8 ? 'polite' : 'off',
|
|
1015
|
-
children: maxLength !== undefined ? `${charCount} / ${maxLength}` : charCount
|
|
1016
|
-
})]
|
|
1017
|
-
})]
|
|
1018
|
-
});
|
|
1019
|
-
});
|
|
1020
|
-
TextArea.displayName = 'TextArea';
|
|
1021
|
-
|
|
1022
|
-
const Search = /*#__PURE__*/react.forwardRef(function Search({
|
|
1023
|
-
label,
|
|
1024
|
-
description,
|
|
1025
|
-
helperMessage,
|
|
1026
|
-
id: providedId,
|
|
1027
|
-
invalid,
|
|
1028
|
-
disabled,
|
|
1029
|
-
readOnly,
|
|
1030
|
-
value,
|
|
1031
|
-
defaultValue,
|
|
1032
|
-
onChange,
|
|
1033
|
-
onClear,
|
|
1034
|
-
clearLabel = 'Clear search',
|
|
1035
|
-
...inputProps
|
|
1036
|
-
}, forwardedRef) {
|
|
1037
|
-
const {
|
|
1038
|
-
inputId,
|
|
1039
|
-
labelId,
|
|
1040
|
-
descriptionId,
|
|
1041
|
-
helperMessageId,
|
|
1042
|
-
getDescribedBy
|
|
1043
|
-
} = useFieldIds(providedId);
|
|
1044
|
-
const isControlled = value !== undefined;
|
|
1045
|
-
const [internalHasValue, setInternalHasValue] = react.useState(() => Boolean(defaultValue));
|
|
1046
|
-
const hasValue = isControlled ? Boolean(value) : internalHasValue;
|
|
1047
|
-
const inputRef = react.useRef(null);
|
|
1048
|
-
const mergedRef = react.useCallback(node => {
|
|
1049
|
-
inputRef.current = node;
|
|
1050
|
-
if (typeof forwardedRef === 'function') {
|
|
1051
|
-
forwardedRef(node);
|
|
1052
|
-
} else if (forwardedRef) {
|
|
1053
|
-
forwardedRef.current = node;
|
|
1054
|
-
}
|
|
1055
|
-
}, [forwardedRef]);
|
|
1056
|
-
const handleChange = e => {
|
|
1057
|
-
if (!isControlled) {
|
|
1058
|
-
setInternalHasValue(Boolean(e.target.value));
|
|
1059
|
-
}
|
|
1060
|
-
onChange?.(e);
|
|
1061
|
-
};
|
|
1062
|
-
const handleClear = () => {
|
|
1063
|
-
if (!isControlled && inputRef.current) {
|
|
1064
|
-
// Direct DOM mutation: bypasses React's synthetic onChange, which is
|
|
1065
|
-
// intentional — onClear is the designated callback for clear actions.
|
|
1066
|
-
inputRef.current.value = '';
|
|
1067
|
-
setInternalHasValue(false);
|
|
1068
|
-
}
|
|
1069
|
-
onClear?.();
|
|
1070
|
-
inputRef.current?.focus();
|
|
1071
|
-
};
|
|
1072
|
-
const showClear = hasValue && !disabled && !readOnly;
|
|
1073
|
-
// Accent only in interactive states — grey in error, readonly, disabled
|
|
1074
|
-
const iconTone = disabled || readOnly || invalid ? 'neutral' : 'accent';
|
|
1075
|
-
return /*#__PURE__*/jsxRuntime.jsx("search", {
|
|
1076
|
-
className: "eds-search",
|
|
1077
|
-
"aria-labelledby": label ? labelId : undefined,
|
|
1078
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(Field, {
|
|
1079
|
-
disabled: disabled,
|
|
1080
|
-
children: [label && /*#__PURE__*/jsxRuntime.jsx(Field.Label, {
|
|
1081
|
-
id: labelId,
|
|
1082
|
-
htmlFor: inputId,
|
|
1083
|
-
children: label
|
|
1084
|
-
}), description && /*#__PURE__*/jsxRuntime.jsx(Field.Description, {
|
|
1085
|
-
id: descriptionId,
|
|
1086
|
-
children: description
|
|
1087
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
1088
|
-
ref: mergedRef,
|
|
1089
|
-
id: inputId,
|
|
1090
|
-
type: "search",
|
|
1091
|
-
disabled: disabled,
|
|
1092
|
-
readOnly: readOnly,
|
|
1093
|
-
invalid: invalid,
|
|
1094
|
-
value: value,
|
|
1095
|
-
defaultValue: defaultValue,
|
|
1096
|
-
onChange: handleChange,
|
|
1097
|
-
"aria-describedby": getDescribedBy({
|
|
1098
|
-
hasDescription: !!description,
|
|
1099
|
-
hasHelperMessage: !!helperMessage
|
|
1100
|
-
}),
|
|
1101
|
-
hideErrorIcon: true,
|
|
1102
|
-
startAdornment: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1103
|
-
data: edsIcons.search,
|
|
1104
|
-
className: "search-icon",
|
|
1105
|
-
"data-color-appearance": iconTone
|
|
1106
|
-
}),
|
|
1107
|
-
endAdornment: showClear ? /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1108
|
-
variant: "ghost",
|
|
1109
|
-
icon: true,
|
|
1110
|
-
round: true,
|
|
1111
|
-
size: "small",
|
|
1112
|
-
tone: invalid ? 'neutral' : 'accent',
|
|
1113
|
-
onClick: handleClear,
|
|
1114
|
-
"aria-label": clearLabel,
|
|
1115
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1116
|
-
data: edsIcons.close
|
|
1117
|
-
})
|
|
1118
|
-
}) : undefined,
|
|
1119
|
-
...inputProps
|
|
1120
|
-
}), helperMessage && /*#__PURE__*/jsxRuntime.jsx(Field.HelperMessage, {
|
|
1121
|
-
id: helperMessageId,
|
|
1122
|
-
role: invalid ? 'alert' : undefined,
|
|
1123
|
-
children: helperMessage
|
|
1124
|
-
})]
|
|
1125
|
-
})
|
|
1126
|
-
});
|
|
1127
|
-
});
|
|
1128
|
-
Search.displayName = 'Search';
|
|
1129
|
-
|
|
1130
|
-
const Link = /*#__PURE__*/react.forwardRef(function Link({
|
|
1131
|
-
variant = 'inline',
|
|
1132
|
-
className,
|
|
1133
|
-
children,
|
|
1134
|
-
...rest
|
|
1135
|
-
}, ref) {
|
|
1136
|
-
const classes = ['eds-link', className].filter(Boolean).join(' ');
|
|
1137
|
-
return /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
1138
|
-
ref: ref,
|
|
1139
|
-
className: classes,
|
|
1140
|
-
"data-variant": variant,
|
|
1141
|
-
"data-font-family": variant === 'standalone' ? 'ui' : undefined,
|
|
1142
|
-
"data-font-size": variant === 'standalone' ? 'md' : undefined,
|
|
1143
|
-
"data-line-height": variant === 'standalone' ? 'squished' : undefined,
|
|
1144
|
-
...rest,
|
|
1145
|
-
children: children
|
|
1146
|
-
});
|
|
1147
|
-
});
|
|
1148
|
-
Link.displayName = 'Link';
|
|
1149
|
-
|
|
1150
|
-
const Tooltip = /*#__PURE__*/react.forwardRef(function Tooltip({
|
|
1151
|
-
title,
|
|
1152
|
-
placement = 'top',
|
|
1153
|
-
disabled,
|
|
1154
|
-
children,
|
|
1155
|
-
className,
|
|
1156
|
-
onMouseEnter: onMouseEnterProp,
|
|
1157
|
-
onMouseLeave: onMouseLeaveProp,
|
|
1158
|
-
...rest
|
|
1159
|
-
}, ref) {
|
|
1160
|
-
const uid = react.useId();
|
|
1161
|
-
const tooltipId = `eds-tooltip-${uid.replace(/:/g, '')}`;
|
|
1162
|
-
const anchorName = `--${tooltipId}`;
|
|
1163
|
-
const tooltipRef = react.useRef(null);
|
|
1164
|
-
const hideTimer = react.useRef(null);
|
|
1165
|
-
const active = Boolean(title) && !disabled;
|
|
1166
|
-
const show = () => {
|
|
1167
|
-
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
1168
|
-
if (!tooltipRef.current?.matches(':popover-open')) {
|
|
1169
|
-
tooltipRef.current?.showPopover();
|
|
1170
|
-
}
|
|
1171
|
-
};
|
|
1172
|
-
|
|
1173
|
-
// Short delay so mouse can travel from trigger to tooltip (WCAG 1.4.13 — hoverable)
|
|
1174
|
-
const hide = () => {
|
|
1175
|
-
hideTimer.current = setTimeout(() => {
|
|
1176
|
-
if (tooltipRef.current?.matches(':popover-open')) {
|
|
1177
|
-
tooltipRef.current.hidePopover();
|
|
1178
|
-
}
|
|
1179
|
-
}, 100);
|
|
1180
|
-
};
|
|
1181
|
-
|
|
1182
|
-
// Merge forwarded ref with internal ref
|
|
1183
|
-
const setRef = node => {
|
|
1184
|
-
tooltipRef.current = node;
|
|
1185
|
-
if (typeof ref === 'function') ref(node);else if (ref) ref.current = node;
|
|
1186
|
-
};
|
|
1187
|
-
if (!active) return children;
|
|
1188
|
-
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
1189
|
-
className: "eds-tooltip-anchor",
|
|
1190
|
-
style: {
|
|
1191
|
-
'--tooltip-anchor-name': anchorName
|
|
1192
|
-
},
|
|
1193
|
-
onMouseEnter: show,
|
|
1194
|
-
onMouseLeave: hide,
|
|
1195
|
-
onFocus: show,
|
|
1196
|
-
onBlur: hide,
|
|
1197
|
-
children: [/*#__PURE__*/react.cloneElement(children, {
|
|
1198
|
-
'aria-describedby': tooltipId
|
|
1199
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1200
|
-
ref: setRef,
|
|
1201
|
-
id: tooltipId,
|
|
1202
|
-
role: "tooltip"
|
|
1203
|
-
// hint: top-layer + Escape/light-dismiss. Safari falls back to manual (no Escape).
|
|
1204
|
-
,
|
|
1205
|
-
popover: "hint",
|
|
1206
|
-
className: ['eds-tooltip', className].filter(Boolean).join(' '),
|
|
1207
|
-
"data-placement": placement,
|
|
1208
|
-
"data-space-proportions": "squished",
|
|
1209
|
-
...rest,
|
|
1210
|
-
onMouseEnter: e => {
|
|
1211
|
-
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
1212
|
-
onMouseEnterProp?.(e);
|
|
1213
|
-
},
|
|
1214
|
-
onMouseLeave: e => {
|
|
1215
|
-
hide();
|
|
1216
|
-
onMouseLeaveProp?.(e);
|
|
1217
|
-
},
|
|
1218
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1219
|
-
className: "label",
|
|
1220
|
-
"data-font-family": "ui",
|
|
1221
|
-
"data-font-size": "sm",
|
|
1222
|
-
"data-baseline": "center",
|
|
1223
|
-
children: title
|
|
1224
|
-
})
|
|
1225
|
-
})]
|
|
1226
|
-
});
|
|
1227
|
-
});
|
|
1228
|
-
Tooltip.displayName = 'Tooltip';
|
|
1229
|
-
|
|
1230
|
-
const BannerIcon = /*#__PURE__*/react.forwardRef(function BannerIcon({
|
|
1231
|
-
className,
|
|
1232
|
-
children,
|
|
1233
|
-
...rest
|
|
1234
|
-
}, ref) {
|
|
1235
|
-
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1236
|
-
ref: ref,
|
|
1237
|
-
className: ['eds-banner__icon', className].filter(Boolean).join(' '),
|
|
1238
|
-
...rest,
|
|
1239
|
-
children: children
|
|
1240
|
-
});
|
|
1241
|
-
});
|
|
1242
|
-
const BannerMessage = /*#__PURE__*/react.forwardRef(function BannerMessage({
|
|
1243
|
-
className,
|
|
1244
|
-
children,
|
|
1245
|
-
...rest
|
|
1246
|
-
}, ref) {
|
|
1247
|
-
return /*#__PURE__*/jsxRuntime.jsx(TypographyNext, {
|
|
1248
|
-
ref: ref,
|
|
1249
|
-
as: "p",
|
|
1250
|
-
family: "ui",
|
|
1251
|
-
size: "md",
|
|
1252
|
-
baseline: "center",
|
|
1253
|
-
lineHeight: "default",
|
|
1254
|
-
tracking: "normal",
|
|
1255
|
-
className: ['eds-banner__message', className].filter(Boolean).join(' '),
|
|
1256
|
-
...rest,
|
|
1257
|
-
children: children
|
|
1258
|
-
});
|
|
1259
|
-
});
|
|
1260
|
-
const BannerActions = /*#__PURE__*/react.forwardRef(function BannerActions({
|
|
1261
|
-
placement = 'left',
|
|
1262
|
-
className,
|
|
1263
|
-
children,
|
|
1264
|
-
...rest
|
|
1265
|
-
}, ref) {
|
|
1266
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1267
|
-
ref: ref,
|
|
1268
|
-
className: ['eds-banner__actions', className].filter(Boolean).join(' '),
|
|
1269
|
-
"data-placement": placement,
|
|
1270
|
-
...rest,
|
|
1271
|
-
children: children
|
|
1272
|
-
});
|
|
1273
|
-
});
|
|
1274
|
-
const BannerComponent = /*#__PURE__*/react.forwardRef(function Banner({
|
|
1275
|
-
tone = 'info',
|
|
1276
|
-
role = 'status',
|
|
1277
|
-
onDismiss,
|
|
1278
|
-
className,
|
|
1279
|
-
children,
|
|
1280
|
-
...rest
|
|
1281
|
-
}, ref) {
|
|
1282
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1283
|
-
ref: ref,
|
|
1284
|
-
className: ['eds-banner', className].filter(Boolean).join(' '),
|
|
1285
|
-
"data-color-appearance": tone,
|
|
1286
|
-
role: role,
|
|
1287
|
-
...rest,
|
|
1288
|
-
children: [children, onDismiss && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1289
|
-
variant: "ghost",
|
|
1290
|
-
icon: true,
|
|
1291
|
-
size: "small",
|
|
1292
|
-
className: "eds-banner__dismiss",
|
|
1293
|
-
"aria-label": "Dismiss",
|
|
1294
|
-
onClick: onDismiss,
|
|
1295
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1296
|
-
data: edsIcons.close
|
|
1297
|
-
})
|
|
1298
|
-
})]
|
|
1299
|
-
});
|
|
1300
|
-
});
|
|
1301
|
-
BannerIcon.displayName = 'Banner.Icon';
|
|
1302
|
-
BannerMessage.displayName = 'Banner.Message';
|
|
1303
|
-
BannerActions.displayName = 'Banner.Actions';
|
|
1304
|
-
BannerComponent.displayName = 'Banner';
|
|
1305
|
-
const Banner = BannerComponent;
|
|
1306
|
-
Banner.Icon = BannerIcon;
|
|
1307
|
-
Banner.Message = BannerMessage;
|
|
1308
|
-
Banner.Actions = BannerActions;
|
|
1309
|
-
|
|
1310
|
-
exports.Banner = Banner;
|
|
1311
904
|
exports.Button = Button;
|
|
1312
905
|
exports.Checkbox = Checkbox;
|
|
1313
906
|
exports.Field = Field;
|
|
1314
907
|
exports.Icon = Icon;
|
|
1315
908
|
exports.Input = Input;
|
|
1316
|
-
exports.Link = Link;
|
|
1317
909
|
exports.Radio = Radio;
|
|
1318
|
-
exports.Search = Search;
|
|
1319
910
|
exports.Switch = Switch;
|
|
1320
|
-
exports.TextArea = TextArea;
|
|
1321
911
|
exports.TextField = TextField;
|
|
1322
|
-
exports.Tooltip = Tooltip;
|
|
1323
912
|
exports.useFieldIds = useFieldIds;
|
|
@@ -94,7 +94,7 @@ export declare const AutocompleteContext: import("react").Context<{
|
|
|
94
94
|
optionLabel?: (option: unknown) => string;
|
|
95
95
|
} & {
|
|
96
96
|
ref?: React.Ref<HTMLInputElement>;
|
|
97
|
-
}, "disabled" | "className" | "
|
|
97
|
+
}, "disabled" | "className" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "onClear" | "optionLabel">;
|
|
98
98
|
highlightedIndex: number;
|
|
99
99
|
selectedItem: unknown;
|
|
100
100
|
isOpen: boolean;
|
|
@@ -208,7 +208,7 @@ export declare const useAutocompleteContext: () => {
|
|
|
208
208
|
optionLabel?: (option: unknown) => string;
|
|
209
209
|
} & {
|
|
210
210
|
ref?: React.Ref<HTMLInputElement>;
|
|
211
|
-
}, "disabled" | "className" | "
|
|
211
|
+
}, "disabled" | "className" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "onClear" | "optionLabel">;
|
|
212
212
|
highlightedIndex: number;
|
|
213
213
|
selectedItem: unknown;
|
|
214
214
|
isOpen: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DOMAttributes } from 'react';
|
|
2
2
|
import { AutocompleteProps } from './Autocomplete';
|
|
3
3
|
import { AutocompleteToken } from './Autocomplete.tokens';
|
|
4
|
-
export declare const useAutocomplete: <T>({ options, totalOptions, label, meta, className, style, disabled, readOnly, loading, hideClearButton, onOptionsChange, onAddNewOption, onInputChange, selectedOptions: _selectedOptions, selectionDisplay, multiple, itemToKey: _itemToKey, itemCompare: _itemCompare, allowSelectAll, initialSelectedOptions: _initialSelectedOptions, optionDisabled, optionsFilter, autoWidth, placeholder, optionLabel, clearSearchOnChange, multiline, dropdownHeight, optionComponent, helperText, helperIcon, noOptionsText, variant, onClear, ref,
|
|
4
|
+
export declare const useAutocomplete: <T>({ options, totalOptions, label, meta, className, style, disabled, readOnly, loading, hideClearButton, onOptionsChange, onAddNewOption, onInputChange, selectedOptions: _selectedOptions, selectionDisplay, multiple, itemToKey: _itemToKey, itemCompare: _itemCompare, allowSelectAll, initialSelectedOptions: _initialSelectedOptions, optionDisabled, optionsFilter, autoWidth, placeholder, optionLabel, clearSearchOnChange, multiline, dropdownHeight, optionComponent, helperText, helperIcon, noOptionsText, variant, onClear, ref, ...other }: AutocompleteProps<T> & {
|
|
5
5
|
ref?: React.Ref<HTMLInputElement>;
|
|
6
6
|
}) => {
|
|
7
7
|
getDropdownProps: <Options>(options?: import("downshift").UseMultipleSelectionGetDropdownPropsOptions & Options, extraOptions?: import("downshift").GetPropsCommonOptions) => Omit<import("downshift").Overwrite<import("downshift").UseMultipleSelectionGetDropdownReturnValue, Options>, "preventKeyAction">;
|
|
@@ -103,7 +103,7 @@ export declare const useAutocomplete: <T>({ options, totalOptions, label, meta,
|
|
|
103
103
|
optionLabel?: (option: T) => string;
|
|
104
104
|
}) & {
|
|
105
105
|
ref?: React.Ref<HTMLInputElement>;
|
|
106
|
-
}, "disabled" | "className" | "
|
|
106
|
+
}, "disabled" | "className" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "onClear" | "optionLabel">;
|
|
107
107
|
highlightedIndex: number;
|
|
108
108
|
selectedItem: T;
|
|
109
109
|
isOpen: boolean;
|
|
@@ -12,10 +12,7 @@ export type InputProps = {
|
|
|
12
12
|
endText?: string;
|
|
13
13
|
/** Adornment at the end (icons, buttons, etc.) */
|
|
14
14
|
endAdornment?: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Render as input or textarea.
|
|
17
|
-
* @internal Use the TextArea component instead of `as="textarea"`.
|
|
18
|
-
*/
|
|
15
|
+
/** Render as input or textarea */
|
|
19
16
|
as?: 'input' | 'textarea';
|
|
20
17
|
/** Class name applied to the container element */
|
|
21
18
|
containerClassName?: string;
|
|
@@ -14,13 +14,3 @@ export { Input } from './Input';
|
|
|
14
14
|
export type { InputProps } from './Input';
|
|
15
15
|
export { TextField } from './TextField';
|
|
16
16
|
export type { TextFieldProps } from './TextField';
|
|
17
|
-
export { TextArea } from './TextArea';
|
|
18
|
-
export type { TextAreaProps } from './TextArea';
|
|
19
|
-
export { Search } from './Search';
|
|
20
|
-
export type { SearchProps } from './Search';
|
|
21
|
-
export { Link } from './Link';
|
|
22
|
-
export type { LinkProps, LinkVariant } from './Link';
|
|
23
|
-
export { Tooltip } from './Tooltip';
|
|
24
|
-
export type { TooltipPlacement, TooltipProps } from './Tooltip';
|
|
25
|
-
export { Banner } from './Banner';
|
|
26
|
-
export type { BannerProps, BannerTone, BannerIconProps, BannerMessageProps, BannerActionsProps, BannerActionsPlacement, } from './Banner';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/eds-core-react",
|
|
3
|
-
"version": "2.4.0
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "The React implementation of the Equinor Design System",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -31,14 +31,7 @@
|
|
|
31
31
|
"types": "./dist/types/index.d.ts",
|
|
32
32
|
"import": "./dist/esm/index.js",
|
|
33
33
|
"require": "./dist/eds-core-react.cjs"
|
|
34
|
-
}
|
|
35
|
-
"./next": {
|
|
36
|
-
"types": "./dist/types/index.next.d.ts",
|
|
37
|
-
"import": "./dist/esm-next/index.next.js",
|
|
38
|
-
"require": "./dist/index.next.cjs"
|
|
39
|
-
},
|
|
40
|
-
"./next/index.css": "./build/index.css",
|
|
41
|
-
"./next/index.min.css": "./build/index.min.css"
|
|
34
|
+
}
|
|
42
35
|
},
|
|
43
36
|
"keywords": [
|
|
44
37
|
"eds",
|
|
@@ -47,44 +40,44 @@
|
|
|
47
40
|
"react"
|
|
48
41
|
],
|
|
49
42
|
"devDependencies": {
|
|
50
|
-
"@figma/code-connect": "^1.4.
|
|
51
|
-
"@playwright/test": "^1.
|
|
52
|
-
"@rollup/plugin-babel": "^
|
|
53
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
43
|
+
"@figma/code-connect": "^1.4.1",
|
|
44
|
+
"@playwright/test": "^1.58.2",
|
|
45
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
46
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
54
47
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
55
|
-
"@storybook/addon-a11y": "^10.
|
|
56
|
-
"@storybook/addon-docs": "^10.
|
|
57
|
-
"@storybook/addon-links": "^10.
|
|
58
|
-
"@storybook/react-vite": "^10.
|
|
48
|
+
"@storybook/addon-a11y": "^10.2.10",
|
|
49
|
+
"@storybook/addon-docs": "^10.2.10",
|
|
50
|
+
"@storybook/addon-links": "^10.2.10",
|
|
51
|
+
"@storybook/react-vite": "^10.2.14",
|
|
59
52
|
"@testing-library/dom": "^10.4.1",
|
|
60
53
|
"@testing-library/jest-dom": "^6.9.1",
|
|
61
54
|
"@testing-library/react": "16.3.2",
|
|
62
55
|
"@testing-library/user-event": "14.6.1",
|
|
63
56
|
"@types/jest": "^30.0.0",
|
|
64
57
|
"@types/mdx": "^2.0.13",
|
|
65
|
-
"@types/node": "^25.
|
|
58
|
+
"@types/node": "^25.3.3",
|
|
66
59
|
"@types/ramda": "^0.31.1",
|
|
67
60
|
"@types/react": "^19.2.14",
|
|
68
61
|
"@types/react-dom": "^19.2.3",
|
|
69
62
|
"babel-plugin-styled-components": "^2.1.4",
|
|
70
|
-
"eslint-plugin-storybook": "10.
|
|
71
|
-
"jest": "^30.
|
|
72
|
-
"jest-environment-jsdom": "^30.
|
|
73
|
-
"jest-styled-components": "^7.
|
|
63
|
+
"eslint-plugin-storybook": "10.2.10",
|
|
64
|
+
"jest": "^30.2.0",
|
|
65
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
66
|
+
"jest-styled-components": "^7.2.0",
|
|
74
67
|
"js-file-download": "^0.4.12",
|
|
75
|
-
"postcss": "^8.5.
|
|
68
|
+
"postcss": "^8.5.6",
|
|
76
69
|
"postcss-import": "^16.1.1",
|
|
77
70
|
"ramda": "^0.32.0",
|
|
78
71
|
"react": "^19.2.4",
|
|
79
72
|
"react-dom": "^19.2.4",
|
|
80
|
-
"react-hook-form": "^7.
|
|
81
|
-
"react-router-dom": "^7.13.
|
|
82
|
-
"rollup": "^4.
|
|
73
|
+
"react-hook-form": "^7.71.2",
|
|
74
|
+
"react-router-dom": "^7.13.1",
|
|
75
|
+
"rollup": "^4.59.0",
|
|
83
76
|
"rollup-plugin-delete": "^3.0.2",
|
|
84
77
|
"rollup-plugin-postcss": "^4.0.2",
|
|
85
78
|
"rollup-preserve-directives": "^1.1.3",
|
|
86
|
-
"storybook": "^10.
|
|
87
|
-
"styled-components": "6.3.
|
|
79
|
+
"storybook": "^10.2.10",
|
|
80
|
+
"styled-components": "6.3.11",
|
|
88
81
|
"tsc-watch": "^7.2.0",
|
|
89
82
|
"typescript": "^5.9.3"
|
|
90
83
|
},
|
|
@@ -94,19 +87,19 @@
|
|
|
94
87
|
"styled-components": "^6"
|
|
95
88
|
},
|
|
96
89
|
"dependencies": {
|
|
97
|
-
"@babel/runtime": "^7.
|
|
98
|
-
"@floating-ui/react": "^0.27.
|
|
99
|
-
"@internationalized/date": "^3.
|
|
100
|
-
"@react-aria/utils": "^3.33.
|
|
101
|
-
"@react-stately/calendar": "^3.9.
|
|
102
|
-
"@react-stately/datepicker": "^3.16.
|
|
103
|
-
"@react-types/shared": "^3.33.
|
|
104
|
-
"@tanstack/react-virtual": "3.13.
|
|
90
|
+
"@babel/runtime": "^7.28.6",
|
|
91
|
+
"@floating-ui/react": "^0.27.18",
|
|
92
|
+
"@internationalized/date": "^3.11.0",
|
|
93
|
+
"@react-aria/utils": "^3.33.0",
|
|
94
|
+
"@react-stately/calendar": "^3.9.2",
|
|
95
|
+
"@react-stately/datepicker": "^3.16.0",
|
|
96
|
+
"@react-types/shared": "^3.33.0",
|
|
97
|
+
"@tanstack/react-virtual": "3.13.18",
|
|
105
98
|
"downshift": "9.3.2",
|
|
106
|
-
"react-aria": "^3.
|
|
107
|
-
"@equinor/eds-
|
|
99
|
+
"react-aria": "^3.46.0",
|
|
100
|
+
"@equinor/eds-utils": "^2.1.0",
|
|
108
101
|
"@equinor/eds-tokens": "^2.2.0",
|
|
109
|
-
"@equinor/eds-
|
|
102
|
+
"@equinor/eds-icons": "^1.3.0"
|
|
110
103
|
},
|
|
111
104
|
"scripts": {
|
|
112
105
|
"build": "rollup -c && tsc -p tsconfig.build.json",
|