@equinor/eds-core-react 2.4.1 → 2.5.0-beta.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.
Files changed (36) hide show
  1. package/build/index.css +871 -103
  2. package/build/index.min.css +1 -1
  3. package/dist/eds-core-react.cjs +19 -9
  4. package/dist/esm/components/Autocomplete/MultipleInput.js +17 -3
  5. package/dist/esm/components/Autocomplete/useAutocomplete.js +2 -1
  6. package/dist/esm/components/Banner/Banner.tokens.js +0 -1
  7. package/dist/esm/components/Icon/Icon.js +0 -2
  8. package/dist/esm/components/Pagination/Pagination.js +0 -1
  9. package/dist/esm/components/Tabs/Tabs.js +0 -1
  10. package/dist/esm-next/components/next/Button/Button.js +52 -25
  11. package/dist/esm-next/components/next/Chip/Chip.js +77 -0
  12. package/dist/esm-next/components/next/Link/Link.js +19 -7
  13. package/dist/esm-next/components/next/Slot/Slot.js +47 -0
  14. package/dist/esm-next/index.next.js +2 -0
  15. package/dist/index.next.cjs +244 -90
  16. package/dist/types/components/Autocomplete/Autocomplete.d.ts +16 -2
  17. package/dist/types/components/Autocomplete/AutocompleteContext.d.ts +6 -2
  18. package/dist/types/components/Autocomplete/Option.d.ts +5 -3
  19. package/dist/types/components/Autocomplete/useAutocomplete.d.ts +4 -2
  20. package/dist/types/components/Chip/Icon.d.ts +18 -2
  21. package/dist/types/components/Datepicker/calendars/CalendarWrapper.d.ts +1 -1
  22. package/dist/types/components/Switch/Switch.styles.d.ts +3 -3
  23. package/dist/types/components/Typography/Typography.stories.shared.d.ts +18 -16
  24. package/dist/types/components/next/Button/Button.d.ts +4 -1
  25. package/dist/types/components/next/Button/Button.types.d.ts +13 -2
  26. package/dist/types/components/next/Chip/Chip.d.ts +8 -0
  27. package/dist/types/components/next/Chip/Chip.figma.d.ts +1 -0
  28. package/dist/types/components/next/Chip/Chip.types.d.ts +68 -0
  29. package/dist/types/components/next/Chip/index.d.ts +2 -0
  30. package/dist/types/components/next/Link/Link.d.ts +2 -2
  31. package/dist/types/components/next/Link/Link.types.d.ts +5 -3
  32. package/dist/types/components/next/Slot/Slot.d.ts +3 -0
  33. package/dist/types/components/next/Slot/Slot.types.d.ts +4 -0
  34. package/dist/types/components/next/Slot/index.d.ts +2 -0
  35. package/dist/types/components/next/index.d.ts +4 -0
  36. package/package.json +23 -15
@@ -13,75 +13,54 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
13
 
14
14
  var styled__default = /*#__PURE__*/_interopDefault(styled);
15
15
 
16
- /**
17
- * TypographyNext component for flexible typography with baseline grid support.
18
- *
19
- * Provides full control over typography properties including family, size,
20
- * lineHeight, baseline alignment, weight, and tracking.
21
- *
22
- * **Display behavior:** Elements render as `display: block` by default for
23
- * text-box trimming and baseline grid alignment. Override with CSS if needed.
24
- *
25
- * @example
26
- * ```tsx
27
- * import { TypographyNext as Typography } from '@equinor/eds-core-react'
28
- *
29
- * <Typography
30
- * family="ui"
31
- * size="md"
32
- * lineHeight="default"
33
- * baseline="grid"
34
- * weight="normal"
35
- * tracking="normal"
36
- * >
37
- * Text content (renders as block-level by default)
38
- * </Typography>
39
- *
40
- * <Typography
41
- * as="h1"
42
- * family="header"
43
- * size="3xl"
44
- * lineHeight="squished"
45
- * baseline="grid"
46
- * weight="bolder"
47
- * tracking="tight"
48
- * >
49
- * Page heading
50
- * </Typography>
51
- * ```
52
- */
53
- const TypographyNext = /*#__PURE__*/react.forwardRef(({
54
- as = 'span',
55
- family,
56
- size,
57
- baseline,
58
- lineHeight,
59
- weight,
60
- tracking,
61
- debug,
62
- ...rest
63
- }, ref) => {
64
- const Component = as;
65
- return /*#__PURE__*/jsxRuntime.jsx(Component, {
66
- ref: ref,
67
- "data-font-family": family,
68
- "data-font-size": size,
69
- "data-baseline": baseline || undefined,
70
- "data-line-height": lineHeight || undefined,
71
- "data-font-weight": weight || undefined,
72
- "data-tracking": tracking || undefined,
73
- "data-debug": debug ? '' : undefined,
74
- ...rest
16
+ function mergeClassNames(...classNames) {
17
+ return classNames.filter(Boolean).join(' ');
18
+ }
19
+ function mergeProps(slotProps, childProps) {
20
+ const merged = {
21
+ ...childProps
22
+ };
23
+ for (const key of Object.keys(slotProps)) {
24
+ const slotValue = slotProps[key];
25
+ const childValue = childProps[key];
26
+ if (key === 'className') {
27
+ merged[key] = mergeClassNames(slotValue, childValue);
28
+ } else if (key === 'style') {
29
+ merged[key] = {
30
+ ...slotValue,
31
+ ...childValue
32
+ };
33
+ } else if (typeof slotValue === 'function' && typeof childValue === 'function') {
34
+ merged[key] = (...args) => {
35
+ childValue(...args);
36
+ slotValue(...args);
37
+ };
38
+ } else if (slotValue !== undefined) {
39
+ merged[key] = slotValue;
40
+ }
41
+ }
42
+ return merged;
43
+ }
44
+ const Slot = /*#__PURE__*/react.forwardRef(function Slot({
45
+ children,
46
+ ...slotProps
47
+ }, ref) {
48
+ if (! /*#__PURE__*/react.isValidElement(children)) {
49
+ return null;
50
+ }
51
+ const child = children;
52
+ const merged = mergeProps(slotProps, child.props);
53
+ return /*#__PURE__*/react.cloneElement(child, {
54
+ ...merged,
55
+ ref
75
56
  });
76
57
  });
77
- TypographyNext.displayName = 'TypographyNext';
58
+ Slot.displayName = 'Slot';
78
59
 
79
60
  const SIZE_MAPPING = {
80
61
  small: 'sm',
81
- default: 'md',
82
- large: 'lg'
62
+ default: 'md'
83
63
  };
84
- const sizeToTypography = SIZE_MAPPING;
85
64
  const sizeToSelectableSpace = SIZE_MAPPING;
86
65
  const Button = /*#__PURE__*/react.forwardRef(function Button({
87
66
  variant = 'primary',
@@ -89,6 +68,8 @@ const Button = /*#__PURE__*/react.forwardRef(function Button({
89
68
  tone = 'accent',
90
69
  icon = false,
91
70
  round = false,
71
+ multiline = false,
72
+ asChild,
92
73
  children,
93
74
  className,
94
75
  disabled,
@@ -96,29 +77,56 @@ const Button = /*#__PURE__*/react.forwardRef(function Button({
96
77
  ...rest
97
78
  }, ref) {
98
79
  const classes = ['eds-button', className].filter(Boolean).join(' ');
99
- const typographySize = sizeToTypography[size];
100
80
  const selectableSpace = sizeToSelectableSpace[size];
101
- return /*#__PURE__*/jsxRuntime.jsx("button", {
102
- ref: ref,
103
- type: type,
81
+ const sharedProps = {
82
+ ref,
104
83
  className: classes,
105
- disabled: disabled,
106
- "data-variant": variant,
107
- "data-selectable-space": selectableSpace,
108
- "data-space-proportions": "squished",
109
- "data-color-appearance": disabled ? 'neutral' : tone,
110
- "data-icon-only": icon || undefined,
111
- "data-round": icon && round ? true : undefined,
112
- ...rest,
113
- children: icon ? children : /*#__PURE__*/jsxRuntime.jsx(TypographyNext, {
114
- as: "span",
115
- className: "eds-button__label",
116
- family: "ui",
117
- size: typographySize,
118
- lineHeight: "squished",
119
- baseline: "center",
84
+ disabled,
85
+ 'data-variant': variant,
86
+ 'data-selectable-space': selectableSpace,
87
+ 'data-space-proportions': 'squished',
88
+ 'data-color-appearance': disabled ? 'neutral' : tone,
89
+ 'data-icon-only': icon || undefined,
90
+ 'data-round': icon && round ? true : undefined,
91
+ 'data-multiline': multiline || undefined,
92
+ ...rest
93
+ };
94
+ if (asChild) {
95
+ return /*#__PURE__*/jsxRuntime.jsx(Slot, {
96
+ ...sharedProps,
120
97
  children: children
121
- })
98
+ });
99
+ }
100
+ return /*#__PURE__*/jsxRuntime.jsx("button", {
101
+ type: type,
102
+ ...sharedProps,
103
+ children: (() => {
104
+ const out = [];
105
+ let buf = [];
106
+ let labelGroupIndex = 0;
107
+ react.Children.toArray(children).forEach(child => {
108
+ const isLabelNode = typeof child === 'string' || typeof child === 'number' || /*#__PURE__*/react.isValidElement(child) && child.type === 'br';
109
+ if (isLabelNode) {
110
+ buf.push(child);
111
+ } else {
112
+ if (buf.length) {
113
+ out.push(/*#__PURE__*/jsxRuntime.jsx("span", {
114
+ className: "label",
115
+ children: buf
116
+ }, `label-${labelGroupIndex++}`));
117
+ buf = [];
118
+ }
119
+ out.push(child);
120
+ }
121
+ });
122
+ if (buf.length) {
123
+ out.push(/*#__PURE__*/jsxRuntime.jsx("span", {
124
+ className: "label",
125
+ children: buf
126
+ }, "label-end"));
127
+ }
128
+ return out;
129
+ })()
122
130
  });
123
131
  });
124
132
  Button.displayName = 'Button';
@@ -201,6 +209,69 @@ const Icon = /*#__PURE__*/react.forwardRef(function Icon({
201
209
  });
202
210
  });
203
211
 
212
+ /**
213
+ * TypographyNext component for flexible typography with baseline grid support.
214
+ *
215
+ * Provides full control over typography properties including family, size,
216
+ * lineHeight, baseline alignment, weight, and tracking.
217
+ *
218
+ * **Display behavior:** Elements render as `display: block` by default for
219
+ * text-box trimming and baseline grid alignment. Override with CSS if needed.
220
+ *
221
+ * @example
222
+ * ```tsx
223
+ * import { TypographyNext as Typography } from '@equinor/eds-core-react'
224
+ *
225
+ * <Typography
226
+ * family="ui"
227
+ * size="md"
228
+ * lineHeight="default"
229
+ * baseline="grid"
230
+ * weight="normal"
231
+ * tracking="normal"
232
+ * >
233
+ * Text content (renders as block-level by default)
234
+ * </Typography>
235
+ *
236
+ * <Typography
237
+ * as="h1"
238
+ * family="header"
239
+ * size="3xl"
240
+ * lineHeight="squished"
241
+ * baseline="grid"
242
+ * weight="bolder"
243
+ * tracking="tight"
244
+ * >
245
+ * Page heading
246
+ * </Typography>
247
+ * ```
248
+ */
249
+ const TypographyNext = /*#__PURE__*/react.forwardRef(({
250
+ as = 'span',
251
+ family,
252
+ size,
253
+ baseline,
254
+ lineHeight,
255
+ weight,
256
+ tracking,
257
+ debug,
258
+ ...rest
259
+ }, ref) => {
260
+ const Component = as;
261
+ return /*#__PURE__*/jsxRuntime.jsx(Component, {
262
+ ref: ref,
263
+ "data-font-family": family,
264
+ "data-font-size": size,
265
+ "data-baseline": baseline || undefined,
266
+ "data-line-height": lineHeight || undefined,
267
+ "data-font-weight": weight || undefined,
268
+ "data-tracking": tracking || undefined,
269
+ "data-debug": debug ? '' : undefined,
270
+ ...rest
271
+ });
272
+ });
273
+ TypographyNext.displayName = 'TypographyNext';
274
+
204
275
  const FieldDescription = /*#__PURE__*/react.forwardRef(function FieldDescription({
205
276
  children,
206
277
  className,
@@ -1129,19 +1200,30 @@ Search.displayName = 'Search';
1129
1200
 
1130
1201
  const Link = /*#__PURE__*/react.forwardRef(function Link({
1131
1202
  variant = 'inline',
1203
+ asChild,
1132
1204
  className,
1133
1205
  children,
1134
1206
  ...rest
1135
1207
  }, ref) {
1136
1208
  const classes = ['eds-link', className].filter(Boolean).join(' ');
1137
- return /*#__PURE__*/jsxRuntime.jsx("a", {
1138
- ref: ref,
1209
+ const sharedProps = {
1210
+ ref,
1139
1211
  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,
1212
+ 'data-variant': variant,
1213
+ 'data-color-appearance': 'info',
1214
+ 'data-font-family': variant === 'standalone' ? 'ui' : undefined,
1215
+ 'data-font-size': variant === 'standalone' ? 'md' : undefined,
1216
+ 'data-line-height': variant === 'standalone' ? 'squished' : undefined,
1217
+ ...rest
1218
+ };
1219
+ if (asChild) {
1220
+ return /*#__PURE__*/jsxRuntime.jsx(Slot, {
1221
+ ...sharedProps,
1222
+ children: children
1223
+ });
1224
+ }
1225
+ return /*#__PURE__*/jsxRuntime.jsx("a", {
1226
+ ...sharedProps,
1145
1227
  children: children
1146
1228
  });
1147
1229
  });
@@ -1307,15 +1389,87 @@ Banner.Icon = BannerIcon;
1307
1389
  Banner.Message = BannerMessage;
1308
1390
  Banner.Actions = BannerActions;
1309
1391
 
1392
+ const Chip = /*#__PURE__*/react.forwardRef(function Chip({
1393
+ tone = 'neutral',
1394
+ variant = 'default',
1395
+ selected = false,
1396
+ onDelete,
1397
+ dropdown = false,
1398
+ onClick,
1399
+ children,
1400
+ className,
1401
+ onKeyDown,
1402
+ ...rest
1403
+ }, ref) {
1404
+ const classes = ['eds-chip', className].filter(Boolean).join(' ');
1405
+ const deletable = typeof onDelete === 'function';
1406
+ const toggleable = !deletable && !dropdown;
1407
+ const handleClick = event => {
1408
+ if (deletable) {
1409
+ onDelete?.(event);
1410
+ } else {
1411
+ onClick?.(event);
1412
+ }
1413
+ };
1414
+ const handleKeyDown = event => {
1415
+ if (deletable && (event.key === 'Backspace' || event.key === 'Delete')) {
1416
+ event.preventDefault();
1417
+ onDelete?.(event);
1418
+ }
1419
+ onKeyDown?.(event);
1420
+ };
1421
+ return /*#__PURE__*/jsxRuntime.jsxs("button", {
1422
+ ref: ref,
1423
+ type: "button",
1424
+ className: classes,
1425
+ "data-variant": variant,
1426
+ "data-color-appearance": tone,
1427
+ "data-font-family": "ui",
1428
+ "data-font-size": "md",
1429
+ "data-selectable-space": "sm",
1430
+ "data-space-proportions": "squished",
1431
+ "data-selected": selected || undefined,
1432
+ "aria-pressed": toggleable ? selected : undefined,
1433
+ "aria-expanded": dropdown ? selected : undefined,
1434
+ onClick: handleClick,
1435
+ onKeyDown: handleKeyDown,
1436
+ ...rest,
1437
+ children: [selected && !dropdown && !deletable && /*#__PURE__*/jsxRuntime.jsx(Icon, {
1438
+ data: edsIcons.check,
1439
+ "aria-hidden": true,
1440
+ className: "icon"
1441
+ }), /*#__PURE__*/jsxRuntime.jsx(TypographyNext, {
1442
+ as: "span",
1443
+ className: "label",
1444
+ family: "ui",
1445
+ size: "md",
1446
+ lineHeight: "squished",
1447
+ baseline: "center",
1448
+ children: children
1449
+ }), deletable && /*#__PURE__*/jsxRuntime.jsx(Icon, {
1450
+ data: edsIcons.close,
1451
+ title: "Remove",
1452
+ className: "icon"
1453
+ }), !deletable && dropdown && /*#__PURE__*/jsxRuntime.jsx(Icon, {
1454
+ data: selected ? edsIcons.arrow_drop_up : edsIcons.arrow_drop_down,
1455
+ "aria-hidden": true,
1456
+ className: "icon"
1457
+ })]
1458
+ });
1459
+ });
1460
+ Chip.displayName = 'Chip';
1461
+
1310
1462
  exports.Banner = Banner;
1311
1463
  exports.Button = Button;
1312
1464
  exports.Checkbox = Checkbox;
1465
+ exports.Chip = Chip;
1313
1466
  exports.Field = Field;
1314
1467
  exports.Icon = Icon;
1315
1468
  exports.Input = Input;
1316
1469
  exports.Link = Link;
1317
1470
  exports.Radio = Radio;
1318
1471
  exports.Search = Search;
1472
+ exports.Slot = Slot;
1319
1473
  exports.Switch = Switch;
1320
1474
  exports.TextArea = TextArea;
1321
1475
  exports.TextField = TextField;
@@ -6,12 +6,21 @@ export declare const StyledButton: import("styled-components/dist/types").IStyle
6
6
  as?: import("react").ElementType;
7
7
  } & {
8
8
  color?: "primary" | "secondary" | "danger";
9
- variant?: "ghost" | "contained" | "contained_icon" | "outlined" | "ghost_icon";
9
+ variant?: "ghost" | "outlined" | "contained" | "contained_icon" | "ghost_icon";
10
10
  href?: string;
11
11
  disabled?: boolean;
12
12
  type?: string;
13
13
  fullWidth?: boolean;
14
- } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Omit<any, keyof import("react").ButtonHTMLAttributes<HTMLButtonElement> | "variant" | "href" | "fullWidth">, never>> & string & Omit<import("@equinor/eds-utils").OverridableComponent<import("../Button").ButtonProps, HTMLButtonElement> & {
14
+ } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Omit<any, keyof import("react").ButtonHTMLAttributes<HTMLButtonElement> | "variant" | "href" | "fullWidth">, never> & Partial<Pick<{
15
+ as?: import("react").ElementType;
16
+ } & {
17
+ color?: "primary" | "secondary" | "danger";
18
+ variant?: "ghost" | "outlined" | "contained" | "contained_icon" | "ghost_icon";
19
+ href?: string;
20
+ disabled?: boolean;
21
+ type?: string;
22
+ fullWidth?: boolean;
23
+ } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Omit<any, keyof import("react").ButtonHTMLAttributes<HTMLButtonElement> | "variant" | "href" | "fullWidth">, never>>> & string & Omit<import("@equinor/eds-utils").OverridableComponent<import("../Button").ButtonProps, HTMLButtonElement> & {
15
24
  Group: typeof import("../Button").ButtonGroup;
16
25
  Toggle: typeof import("../Button").ToggleButton;
17
26
  }, keyof import("react").Component<any, {}, any>>;
@@ -67,6 +76,11 @@ export type AutocompleteProps<T = string> = {
67
76
  * @default 'summary'
68
77
  */
69
78
  selectionDisplay?: 'chips' | 'summary';
79
+ /** Amount of values to list in chips (only relevant if selectionDisplay = 'chips')
80
+ * When left blank, all values will be shown as chips
81
+ * @default undefined
82
+ */
83
+ chipCount?: number;
70
84
  /** Callback for the selected item change
71
85
  * changes.selectedItems gives the selected items
72
86
  */
@@ -39,6 +39,7 @@ export declare const AutocompleteContext: import("react").Context<{
39
39
  onInputChange: (text: string) => void;
40
40
  selectedOptions: unknown[];
41
41
  selectionDisplay: "summary" | "chips";
42
+ chipCount: number;
42
43
  itemToKey: (item: unknown) => unknown;
43
44
  itemCompare: (value: unknown, compare: unknown) => boolean;
44
45
  allowSelectAll: boolean;
@@ -73,6 +74,7 @@ export declare const AutocompleteContext: import("react").Context<{
73
74
  hideClearButton?: boolean;
74
75
  selectedOptions?: unknown[];
75
76
  selectionDisplay?: "chips" | "summary";
77
+ chipCount?: number;
76
78
  onOptionsChange?: (changes: import("./Autocomplete").AutocompleteChanges<unknown>) => void;
77
79
  onInputChange?: (text: string) => void;
78
80
  onAddNewOption?: (text: string) => void;
@@ -94,7 +96,7 @@ export declare const AutocompleteContext: import("react").Context<{
94
96
  optionLabel?: (option: unknown) => string;
95
97
  } & {
96
98
  ref?: React.Ref<HTMLInputElement>;
97
- }, "disabled" | "className" | "id" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "onClear" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "optionLabel">;
99
+ }, "disabled" | "className" | "id" | "style" | "ref" | "label" | "meta" | "variant" | "multiline" | "multiple" | "placeholder" | "readOnly" | "options" | "onClear" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "chipCount" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "dropdownHeight" | "itemToKey" | "itemCompare" | "optionLabel">;
98
100
  highlightedIndex: number;
99
101
  selectedItem: unknown;
100
102
  isOpen: boolean;
@@ -153,6 +155,7 @@ export declare const useAutocompleteContext: () => {
153
155
  onInputChange: (text: string) => void;
154
156
  selectedOptions: unknown[];
155
157
  selectionDisplay: "summary" | "chips";
158
+ chipCount: number;
156
159
  itemToKey: (item: unknown) => unknown;
157
160
  itemCompare: (value: unknown, compare: unknown) => boolean;
158
161
  allowSelectAll: boolean;
@@ -187,6 +190,7 @@ export declare const useAutocompleteContext: () => {
187
190
  hideClearButton?: boolean;
188
191
  selectedOptions?: unknown[];
189
192
  selectionDisplay?: "chips" | "summary";
193
+ chipCount?: number;
190
194
  onOptionsChange?: (changes: import("./Autocomplete").AutocompleteChanges<unknown>) => void;
191
195
  onInputChange?: (text: string) => void;
192
196
  onAddNewOption?: (text: string) => void;
@@ -208,7 +212,7 @@ export declare const useAutocompleteContext: () => {
208
212
  optionLabel?: (option: unknown) => string;
209
213
  } & {
210
214
  ref?: React.Ref<HTMLInputElement>;
211
- }, "disabled" | "className" | "id" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "onClear" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "optionLabel">;
215
+ }, "disabled" | "className" | "id" | "style" | "ref" | "label" | "meta" | "variant" | "multiline" | "multiple" | "placeholder" | "readOnly" | "options" | "onClear" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "chipCount" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "dropdownHeight" | "itemToKey" | "itemCompare" | "optionLabel">;
212
216
  highlightedIndex: number;
213
217
  selectedItem: unknown;
214
218
  isOpen: boolean;
@@ -4,10 +4,12 @@ type StyledListItemType = {
4
4
  $active?: string;
5
5
  $isdisabled?: string;
6
6
  };
7
- export declare const StyledListItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, StyledListItemType>> & string;
8
- export declare const AutocompleteOptionLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
7
+ export declare const StyledListItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, keyof StyledListItemType> & StyledListItemType, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, keyof StyledListItemType> & StyledListItemType, never>>> & string;
8
+ export declare const AutocompleteOptionLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$multiline"> & {
9
9
  $multiline: boolean;
10
- }>> & string;
10
+ }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$multiline"> & {
11
+ $multiline: boolean;
12
+ }, never>>> & string;
11
13
  export type AutocompleteOptionProps = {
12
14
  index: number;
13
15
  virtualItem: VirtualItem;
@@ -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, id, ...other }: AutocompleteProps<T> & {
4
+ export declare const useAutocomplete: <T>({ options, totalOptions, label, meta, className, style, disabled, readOnly, loading, hideClearButton, onOptionsChange, onAddNewOption, onInputChange, selectedOptions: _selectedOptions, selectionDisplay, chipCount, multiple, itemToKey: _itemToKey, itemCompare: _itemCompare, allowSelectAll, initialSelectedOptions: _initialSelectedOptions, optionDisabled, optionsFilter, autoWidth, placeholder, optionLabel, clearSearchOnChange, multiline, dropdownHeight, optionComponent, helperText, helperIcon, noOptionsText, variant, onClear, ref, id, ...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">;
@@ -44,6 +44,7 @@ export declare const useAutocomplete: <T>({ options, totalOptions, label, meta,
44
44
  onInputChange: (text: string) => void;
45
45
  selectedOptions: T[];
46
46
  selectionDisplay: "summary" | "chips";
47
+ chipCount: number;
47
48
  itemToKey: (item: T) => unknown;
48
49
  itemCompare: (value: T, compare: T) => boolean;
49
50
  allowSelectAll: boolean;
@@ -78,6 +79,7 @@ export declare const useAutocomplete: <T>({ options, totalOptions, label, meta,
78
79
  hideClearButton?: boolean;
79
80
  selectedOptions?: T[];
80
81
  selectionDisplay?: "chips" | "summary";
82
+ chipCount?: number;
81
83
  onOptionsChange?: (changes: import("./Autocomplete").AutocompleteChanges<T>) => void;
82
84
  onInputChange?: (text: string) => void;
83
85
  onAddNewOption?: (text: string) => void;
@@ -103,7 +105,7 @@ export declare const useAutocomplete: <T>({ options, totalOptions, label, meta,
103
105
  optionLabel?: (option: T) => string;
104
106
  }) & {
105
107
  ref?: React.Ref<HTMLInputElement>;
106
- }, "disabled" | "className" | "id" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "onClear" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "optionLabel">;
108
+ }, "disabled" | "className" | "id" | "style" | "ref" | "label" | "meta" | "variant" | "multiline" | "multiple" | "placeholder" | "readOnly" | "options" | "onClear" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "chipCount" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "dropdownHeight" | "itemToKey" | "itemCompare" | "optionLabel">;
107
109
  highlightedIndex: number;
108
110
  selectedItem: T;
109
111
  isOpen: boolean;
@@ -2,7 +2,7 @@ type IconProps = {
2
2
  $variant: 'active' | 'error' | 'default';
3
3
  $disabled: boolean;
4
4
  };
5
- export declare const Icon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(Omit<{
5
+ export declare const Icon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<(Omit<{
6
6
  title?: string;
7
7
  color?: string;
8
8
  size?: 16 | 18 | 24 | 32 | 40 | 48;
@@ -18,5 +18,21 @@ export declare const Icon: import("styled-components/dist/types").IStyledCompone
18
18
  name?: import("../Icon/Icon.types").Name;
19
19
  data: import("@equinor/eds-icons").IconData;
20
20
  ref?: import("react").Ref<SVGSVGElement>;
21
- } & import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>), IconProps>> & string & Omit<import("../Icon/Icon.types").IconType, keyof import("react").Component<any, {}, any>>;
21
+ } & import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>), keyof IconProps> & IconProps, never> & Partial<Pick<import("styled-components").FastOmit<(Omit<{
22
+ title?: string;
23
+ color?: string;
24
+ size?: 16 | 18 | 24 | 32 | 40 | 48;
25
+ rotation?: 0 | 90 | 180 | 270;
26
+ name: import("../Icon/Icon.types").Name;
27
+ data?: import("@equinor/eds-icons").IconData;
28
+ ref?: import("react").Ref<SVGSVGElement>;
29
+ } & import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>) | (Omit<{
30
+ title?: string;
31
+ color?: string;
32
+ size?: 16 | 18 | 24 | 32 | 40 | 48;
33
+ rotation?: 0 | 90 | 180 | 270;
34
+ name?: import("../Icon/Icon.types").Name;
35
+ data: import("@equinor/eds-icons").IconData;
36
+ ref?: import("react").Ref<SVGSVGElement>;
37
+ } & import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>), keyof IconProps> & IconProps, never>>> & string & Omit<import("../Icon/Icon.types").IconType, keyof import("react").Component<any, {}, any>>;
22
38
  export {};
@@ -1 +1 @@
1
- export declare const CalendarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
1
+ export declare const CalendarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
@@ -1,3 +1,3 @@
1
- export declare const BaseInputWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
2
- export declare const BaseInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>, never>, never>> & string;
3
- export declare const GridWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
1
+ export declare const BaseInputWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
2
+ export declare const BaseInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof import("react").InputHTMLAttributes<HTMLInputElement> | keyof import("react").ClassAttributes<HTMLInputElement>> & import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, "type"> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof import("react").InputHTMLAttributes<HTMLInputElement> | keyof import("react").ClassAttributes<HTMLInputElement>> & import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, "type">>> & string;
3
+ export declare const GridWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;