@equinor/eds-core-react 0.28.0 → 0.29.1-DEV03022023
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/dist/eds-core-react.cjs.js +445 -410
- package/dist/esm/components/Accordion/AccordionPanel.js +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/esm/components/Breadcrumbs/Breadcrumb.js +1 -1
- package/dist/esm/components/Button/ToggleButton/ToggleButton.js +14 -2
- package/dist/esm/components/Dialog/Dialog.js +2 -2
- package/dist/esm/components/Dialog/DialogContent.js +2 -2
- package/dist/esm/components/Input/Input.js +1 -1
- package/dist/esm/components/Menu/Menu.js +17 -6
- package/dist/esm/components/Menu/MenuItem.js +4 -2
- package/dist/esm/components/Menu/MenuList.js +11 -3
- package/dist/esm/components/Paper/Paper.js +4 -3
- package/dist/esm/components/Popover/Popover.js +5 -5
- package/dist/esm/components/Scrim/Scrim.js +1 -1
- package/dist/esm/components/SideBar/SideBarToggle.js +2 -1
- package/dist/esm/components/Table/Cell.js +2 -1
- package/dist/esm/components/Table/Row/Row.js +2 -1
- package/dist/esm/components/Tabs/TabPanel.js +2 -1
- package/dist/esm/components/Tooltip/Tooltip.js +5 -5
- package/dist/types/components/Accordion/Accordion.tokens.d.ts +1 -1
- package/dist/types/components/Accordion/Accordion.types.d.ts +1 -1
- package/dist/types/components/Accordion/AccordionHeader.d.ts +1 -1
- package/dist/types/components/Accordion/AccordionHeaderActions.d.ts +1 -1
- package/dist/types/components/Accordion/AccordionHeaderTitle.d.ts +1 -1
- package/dist/types/components/Accordion/AccordionItem.d.ts +1 -1
- package/dist/types/components/Accordion/AccordionPanel.d.ts +1 -1
- package/dist/types/components/Accordion/index.d.ts +1 -1
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +14 -14
- package/dist/types/components/Autocomplete/Option.d.ts +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +1 -1
- package/dist/types/components/Avatar/Avatar.tokens.d.ts +1 -1
- package/dist/types/components/Banner/Banner.d.ts +2 -2
- package/dist/types/components/Banner/Banner.tokens.d.ts +1 -1
- package/dist/types/components/Banner/BannerActions.d.ts +2 -2
- package/dist/types/components/Banner/BannerIcon.d.ts +2 -2
- package/dist/types/components/Banner/BannerMessage.d.ts +1 -1
- package/dist/types/components/Banner/index.d.ts +1 -1
- package/dist/types/components/Breadcrumbs/Breadcrumb.d.ts +2 -2
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/types/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/Button/Button.types.d.ts +2 -2
- package/dist/types/components/Button/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/dist/types/components/Button/ButtonGroup/ButtonGroup.tokens.d.ts +1 -1
- package/dist/types/components/Button/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/types/components/Button/index.d.ts +1 -1
- package/dist/types/components/Button/tokens/index.d.ts +1 -1
- package/dist/types/components/Card/Card.d.ts +2 -2
- package/dist/types/components/Card/Card.tokens.d.ts +1 -1
- package/dist/types/components/Card/CardActions.d.ts +1 -1
- package/dist/types/components/Card/CardContent.d.ts +1 -1
- package/dist/types/components/Card/CardHeader.d.ts +1 -1
- package/dist/types/components/Card/CardHeaderTitle.d.ts +1 -1
- package/dist/types/components/Card/CardMedia.d.ts +1 -1
- package/dist/types/components/Card/index.d.ts +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/Checkbox/Checkbox.tokens.d.ts +1 -1
- package/dist/types/components/Checkbox/Input.d.ts +1 -1
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/Chip/Chip.tokens.d.ts +1 -1
- package/dist/types/components/Chip/Icon.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.tokens.d.ts +1 -1
- package/dist/types/components/Dialog/DialogActions.d.ts +1 -1
- package/dist/types/components/Dialog/DialogContent.d.ts +1 -1
- package/dist/types/components/Dialog/DialogHeader.d.ts +1 -1
- package/dist/types/components/Dialog/DialogTitle.d.ts +1 -1
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/Divider/Divider.d.ts +1 -1
- package/dist/types/components/Divider/Divider.tokens.d.ts +2 -2
- package/dist/types/components/EdsProvider/eds.context.d.ts +4 -4
- package/dist/types/components/Icon/Icon.d.ts +1 -1
- package/dist/types/components/Icon/Icon.types.d.ts +3 -3
- package/dist/types/components/Icon/library.d.ts +1 -1
- package/dist/types/components/Input/Input.d.ts +1 -1
- package/dist/types/components/Input/Input.tokens.d.ts +1 -1
- package/dist/types/components/InputWrapper/HelperText/HelperText.d.ts +1 -1
- package/dist/types/components/InputWrapper/HelperText/HelperText.token.d.ts +1 -1
- package/dist/types/components/InputWrapper/InputWrapper.d.ts +1 -1
- package/dist/types/components/InputWrapper/InputWrapper.tokens.d.ts +1 -1
- package/dist/types/components/Label/Label.d.ts +1 -1
- package/dist/types/components/Label/Label.tokens.d.ts +1 -1
- package/dist/types/components/List/List.d.ts +1 -1
- package/dist/types/components/List/List.tokens.d.ts +1 -1
- package/dist/types/components/List/ListItem.d.ts +1 -1
- package/dist/types/components/List/index.d.ts +1 -1
- package/dist/types/components/Menu/Menu.context.d.ts +3 -3
- package/dist/types/components/Menu/Menu.d.ts +2 -2
- package/dist/types/components/Menu/Menu.tokens.d.ts +1 -1
- package/dist/types/components/Menu/Menu.types.d.ts +1 -1
- package/dist/types/components/Menu/MenuItem.d.ts +5 -1
- package/dist/types/components/Menu/MenuList.d.ts +2 -1
- package/dist/types/components/Menu/MenuSection.d.ts +1 -1
- package/dist/types/components/Menu/index.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/Pagination/PaginationItem.d.ts +1 -1
- package/dist/types/components/Paper/Paper.d.ts +1 -1
- package/dist/types/components/Paper/Paper.tokens.d.ts +1 -1
- package/dist/types/components/Popover/Popover.d.ts +2 -2
- package/dist/types/components/Popover/Popover.tokens.d.ts +1 -1
- package/dist/types/components/Popover/PopoverActions.d.ts +1 -1
- package/dist/types/components/Popover/PopoverContent.d.ts +1 -1
- package/dist/types/components/Popover/PopoverHeader.d.ts +1 -1
- package/dist/types/components/Popover/PopoverTitle.d.ts +1 -1
- package/dist/types/components/Popover/index.d.ts +1 -1
- package/dist/types/components/Progress/Circular/CircularProgress.d.ts +1 -1
- package/dist/types/components/Progress/Circular/CircularProgress.tokens.d.ts +1 -1
- package/dist/types/components/Progress/Dots/DotProgress.d.ts +1 -1
- package/dist/types/components/Progress/Dots/DotProgress.tokens.d.ts +1 -1
- package/dist/types/components/Progress/Linear/LinearProgress.d.ts +1 -1
- package/dist/types/components/Progress/Linear/LinearProgress.tokens.d.ts +1 -1
- package/dist/types/components/Progress/Star/StarProgress.d.ts +1 -1
- package/dist/types/components/Progress/index.d.ts +1 -1
- package/dist/types/components/Radio/Radio.d.ts +1 -1
- package/dist/types/components/Radio/Radio.tokens.d.ts +1 -1
- package/dist/types/components/Scrim/Scrim.d.ts +1 -1
- package/dist/types/components/Search/Search.d.ts +1 -1
- package/dist/types/components/Select/NativeSelect/NativeSelect.d.ts +1 -1
- package/dist/types/components/Select/NativeSelect/NativeSelect.tokens.d.ts +1 -1
- package/dist/types/components/SideBar/SideBar.context.d.ts +3 -3
- package/dist/types/components/SideBar/SideBarButton/index.d.ts +1 -1
- package/dist/types/components/SideBar/SideBarContent.d.ts +1 -1
- package/dist/types/components/SideBar/SideBarFooter.d.ts +1 -1
- package/dist/types/components/SideBar/SideBarToggle.d.ts +1 -1
- package/dist/types/components/SideBar/SidebarLink/index.d.ts +2 -2
- package/dist/types/components/SideBar/index.d.ts +1 -1
- package/dist/types/components/SideSheet/SideSheet.d.ts +1 -1
- package/dist/types/components/SideSheet/SideSheet.tokens.d.ts +1 -1
- package/dist/types/components/Slider/Slider.d.ts +1 -1
- package/dist/types/components/Slider/Slider.tokens.d.ts +1 -1
- package/dist/types/components/Snackbar/Snackbar.d.ts +1 -1
- package/dist/types/components/Snackbar/Snackbar.tokens.d.ts +1 -1
- package/dist/types/components/Snackbar/SnackbarAction.d.ts +1 -1
- package/dist/types/components/Snackbar/index.d.ts +1 -1
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/Switch/Switch.tokens.d.ts +1 -1
- package/dist/types/components/Table/Body.d.ts +1 -1
- package/dist/types/components/Table/Caption.d.ts +1 -1
- package/dist/types/components/Table/Cell.d.ts +1 -1
- package/dist/types/components/Table/DataCell/DataCell.tokens.d.ts +3 -3
- package/dist/types/components/Table/Head/Head.d.ts +1 -1
- package/dist/types/components/Table/HeaderCell/HeaderCell.tokens.d.ts +1 -1
- package/dist/types/components/Table/Inner.context.d.ts +1 -1
- package/dist/types/components/Table/Row/Row.d.ts +1 -1
- package/dist/types/components/Table/Table.d.ts +1 -1
- package/dist/types/components/Table/Table.types.d.ts +2 -2
- package/dist/types/components/Table/index.d.ts +1 -1
- package/dist/types/components/TableOfContents/LinkItem.d.ts +1 -1
- package/dist/types/components/TableOfContents/TableOfContents.d.ts +1 -1
- package/dist/types/components/TableOfContents/TableOfContents.tokens.d.ts +1 -1
- package/dist/types/components/TableOfContents/index.d.ts +1 -1
- package/dist/types/components/Tabs/Tab.d.ts +2 -2
- package/dist/types/components/Tabs/TabList.d.ts +1 -1
- package/dist/types/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/types/components/Tabs/TabPanels.d.ts +1 -1
- package/dist/types/components/Tabs/Tabs.context.d.ts +1 -1
- package/dist/types/components/Tabs/Tabs.d.ts +1 -1
- package/dist/types/components/Tabs/Tabs.types.d.ts +1 -1
- package/dist/types/components/Tabs/index.d.ts +1 -1
- package/dist/types/components/TextField/TextField.d.ts +2 -2
- package/dist/types/components/Textarea/Textarea.d.ts +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/components/Tooltip/Tooltip.tokens.d.ts +1 -1
- package/dist/types/components/TopBar/Actions.d.ts +1 -1
- package/dist/types/components/TopBar/CustomContent.d.ts +1 -1
- package/dist/types/components/TopBar/Header.d.ts +1 -1
- package/dist/types/components/TopBar/TopBar.d.ts +2 -2
- package/dist/types/components/TopBar/TopBar.tokens.d.ts +1 -1
- package/dist/types/components/TopBar/index.d.ts +1 -1
- package/dist/types/components/Typography/Typography.d.ts +1 -1
- package/dist/types/components/Typography/Typography.tokens.d.ts +4 -4
- package/dist/types/components/types.d.ts +1 -1
- package/package.json +26 -26
|
@@ -21,7 +21,7 @@ var StyledAccordionPanel = styled.div.attrs(function (_ref) {
|
|
|
21
21
|
header = _theme$entities.header,
|
|
22
22
|
panel = _theme$entities.panel,
|
|
23
23
|
border = theme.border;
|
|
24
|
-
return css(["", " ", " ", " background:", ";min-height:96px;box-sizing:border-box;"], bordersTemplate(border), spacingsTemplate(panel.spacings), typographyTemplate(panel.typography), header.background);
|
|
24
|
+
return css(["", " border-top:0;", " ", " background:", ";min-height:96px;box-sizing:border-box;"], bordersTemplate(border), spacingsTemplate(panel.spacings), typographyTemplate(panel.typography), header.background);
|
|
25
25
|
});
|
|
26
26
|
var AccordionPanel = /*#__PURE__*/forwardRef(function AccordionPanel(_ref3, ref) {
|
|
27
27
|
var id = _ref3.id,
|
|
@@ -13,7 +13,7 @@ import { close, arrow_drop_up, arrow_drop_down } from '@equinor/eds-icons';
|
|
|
13
13
|
import { multiSelect, selectTokens } from './Autocomplete.tokens.js';
|
|
14
14
|
import { bordersTemplate, useToken, useIsomorphicLayoutEffect } from '@equinor/eds-utils';
|
|
15
15
|
import { AutocompleteOption } from './Option.js';
|
|
16
|
-
import { useFloating, offset, flip, shift, size, useInteractions, autoUpdate, FloatingPortal } from '@floating-ui/react
|
|
16
|
+
import { useFloating, offset, flip, shift, size, useInteractions, autoUpdate, FloatingPortal } from '@floating-ui/react';
|
|
17
17
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
18
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
19
19
|
import { Label } from '../Label/Label.js';
|
|
@@ -4,8 +4,8 @@ import { forwardRef, useMemo } from 'react';
|
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import { breadcrumbs } from './Breadcrumbs.tokens.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
8
7
|
import { Typography } from '../Typography/Typography.js';
|
|
8
|
+
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
9
9
|
|
|
10
10
|
var _excluded = ["children", "maxWidth", "href", "as"];
|
|
11
11
|
var states = breadcrumbs.states,
|
|
@@ -5,6 +5,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
5
5
|
import { forwardRef, useState, useEffect, Children, isValidElement, cloneElement } from 'react';
|
|
6
6
|
import { Button } from '../Button.js';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { Tooltip } from '../../Tooltip/Tooltip.js';
|
|
8
9
|
import { ButtonGroup } from '../ButtonGroup/ButtonGroup.js';
|
|
9
10
|
|
|
10
11
|
var _excluded = ["children", "multiple", "selectedIndexes", "onChange"];
|
|
@@ -23,8 +24,7 @@ var ToggleButton = /*#__PURE__*/forwardRef(function ToggleButton(_ref, ref) {
|
|
|
23
24
|
setPickedIndexes(selectedIndexes);
|
|
24
25
|
}
|
|
25
26
|
}, [selectedIndexes]);
|
|
26
|
-
|
|
27
|
-
var isSelected = pickedIndexes.includes(index);
|
|
27
|
+
function updateProps(child, isSelected, index) {
|
|
28
28
|
var childElement = child;
|
|
29
29
|
if ( /*#__PURE__*/isValidElement(child) && child.type === Button) {
|
|
30
30
|
var buttonProps = {
|
|
@@ -47,6 +47,18 @@ var ToggleButton = /*#__PURE__*/forwardRef(function ToggleButton(_ref, ref) {
|
|
|
47
47
|
};
|
|
48
48
|
return /*#__PURE__*/cloneElement(child, buttonProps);
|
|
49
49
|
}
|
|
50
|
+
}
|
|
51
|
+
var updatedChildren = Children.map(children, function (child, index) {
|
|
52
|
+
var isSelected = pickedIndexes.includes(index);
|
|
53
|
+
var childElement = child;
|
|
54
|
+
if ( /*#__PURE__*/isValidElement(child) && child.type === Tooltip) {
|
|
55
|
+
var updatedGrandChildren = Children.map(childElement.props.children, function (grandChild) {
|
|
56
|
+
return updateProps(grandChild, isSelected, index);
|
|
57
|
+
});
|
|
58
|
+
return /*#__PURE__*/cloneElement(childElement, null, updatedGrandChildren[0]);
|
|
59
|
+
} else {
|
|
60
|
+
return updateProps(childElement, isSelected, index);
|
|
61
|
+
}
|
|
50
62
|
});
|
|
51
63
|
return /*#__PURE__*/jsx(ButtonGroup, _objectSpread(_objectSpread({
|
|
52
64
|
ref: ref
|
|
@@ -4,7 +4,7 @@ import { forwardRef, useMemo } from 'react';
|
|
|
4
4
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
5
5
|
import { typographyTemplate, bordersTemplate, useToken, mergeRefs } from '@equinor/eds-utils';
|
|
6
6
|
import { dialog } from './Dialog.tokens.js';
|
|
7
|
-
import { useFloating, FloatingPortal, FloatingFocusManager } from '@floating-ui/react
|
|
7
|
+
import { useFloating, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import { Scrim } from '../Scrim/Scrim.js';
|
|
10
10
|
import { Paper } from '../Paper/Paper.js';
|
|
@@ -22,7 +22,7 @@ var StyledDialog = styled(Paper).attrs({
|
|
|
22
22
|
componentId: "sc-1mewo3f-0"
|
|
23
23
|
})(function (_ref) {
|
|
24
24
|
var theme = _ref.theme;
|
|
25
|
-
return css(["width:", ";background:", ";display:grid;grid-auto-columns:auto;", "
|
|
25
|
+
return css(["width:", ";background:", ";display:grid;grid-auto-columns:auto;", ";", ";grid-gap:", ";overflow:hidden;"], theme.width, theme.background, typographyTemplate(theme.typography), bordersTemplate(theme.border), theme.spacings.bottom);
|
|
26
26
|
});
|
|
27
27
|
var Dialog = /*#__PURE__*/forwardRef(function Dialog(_ref2, ref) {
|
|
28
28
|
var children = _ref2.children,
|
|
@@ -13,12 +13,12 @@ var StyledDialogContent = styled.div.withConfig({
|
|
|
13
13
|
})(function (_ref) {
|
|
14
14
|
var theme = _ref.theme,
|
|
15
15
|
scrollable = _ref.scrollable;
|
|
16
|
-
return css(["", " min-height:", ";align-self:stretch;justify-self:stretch;padding:0 ", " 0 ", ";&:first-child{padding-top:
|
|
16
|
+
return css(["--content-spacing-top:", ";", " min-height:", ";align-self:stretch;justify-self:stretch;padding:0 ", " 0 ", ";&:first-child{padding-top:var(--content-spacing-top);}&:last-child{padding-bottom:", ";}", ""], theme.entities.children.spacings.top, typographyTemplate(theme.entities.content.typography), theme.entities.content.minHeight, theme.entities.children.spacings.right, theme.entities.children.spacings.left, theme.entities.children.spacings.bottom, scrollable && css(["&:not(:first-child){margin-top:calc(var(--content-spacing-top) * -1);}padding-top:var(--content-spacing-top);margin-bottom:calc(var(--content-spacing-top) * -1);padding-bottom:var(--content-spacing-top);min-height:initial;height:", ";overflow-y:auto;"], theme.entities.content.height));
|
|
17
17
|
});
|
|
18
18
|
var StyledDivider = styled(Divider).withConfig({
|
|
19
19
|
displayName: "DialogContent__StyledDivider",
|
|
20
20
|
componentId: "sc-1tze18k-1"
|
|
21
|
-
})(["width:100%;margin
|
|
21
|
+
})(["width:100%;margin:0;"]);
|
|
22
22
|
var DialogContent = /*#__PURE__*/forwardRef(function DialogContent(_ref2, ref) {
|
|
23
23
|
var children = _ref2.children,
|
|
24
24
|
_ref2$scrollable = _ref2.scrollable,
|
|
@@ -19,7 +19,7 @@ var Container = styled.div.withConfig({
|
|
|
19
19
|
readOnly = _ref.readOnly;
|
|
20
20
|
var states = token.states,
|
|
21
21
|
entities = token.entities;
|
|
22
|
-
return css(["--eds-input-adornment-color:", ";--eds-input-color:", ";position:relative;height:", ";width:", ";display:flex;flex-direction:row;border:none;box-sizing:border-box;box-shadow:", ";background:", ";", " &:focus-within{--eds-input-adornment-color:", ";box-shadow:none;", "}", " ", ""], entities.adornment.typography.color, token.typography.color, token.height, token.width, token.boxShadow, token.background, outlineTemplate(token.outline), (_entities$adornment = entities.adornment) === null || _entities$adornment === void 0 ? void 0 : (_entities$adornment$s = _entities$adornment.states.focus) === null || _entities$adornment$s === void 0 ? void 0 : _entities$adornment$s.outline.color, outlineTemplate(states.focus.outline), disabled && css(["--eds-input-adornment-color:", ";--eds-input-color:", ";cursor:not-allowed;box-shadow:none;"], states.disabled.typography.color, states.disabled.typography.color), readOnly && css({
|
|
22
|
+
return css(["--eds-input-adornment-color:", ";--eds-input-color:", ";position:relative;height:", ";width:", ";display:flex;flex-direction:row;border:none;box-sizing:border-box;box-shadow:", ";background:var(--eds-input-background,", ");", " &:focus-within{--eds-input-adornment-color:", ";box-shadow:none;", "}", " ", ""], entities.adornment.typography.color, token.typography.color, token.height, token.width, token.boxShadow, token.background, outlineTemplate(token.outline), (_entities$adornment = entities.adornment) === null || _entities$adornment === void 0 ? void 0 : (_entities$adornment$s = _entities$adornment.states.focus) === null || _entities$adornment$s === void 0 ? void 0 : _entities$adornment$s.outline.color, outlineTemplate(states.focus.outline), disabled && css(["--eds-input-adornment-color:", ";--eds-input-color:", ";cursor:not-allowed;box-shadow:none;"], states.disabled.typography.color, states.disabled.typography.color), readOnly && css({
|
|
23
23
|
background: states.readOnly.background,
|
|
24
24
|
boxShadow: states.readOnly.boxShadow
|
|
25
25
|
}));
|
|
@@ -4,9 +4,9 @@ import { forwardRef, useEffect, useMemo } from 'react';
|
|
|
4
4
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
5
5
|
import { MenuProvider, useMenu } from './Menu.context.js';
|
|
6
6
|
import { MenuList } from './MenuList.js';
|
|
7
|
-
import { bordersTemplate, useToken, mergeRefs, useGlobalKeyPress } from '@equinor/eds-utils';
|
|
7
|
+
import { bordersTemplate, useToken, mergeRefs, useIsomorphicLayoutEffect, useGlobalKeyPress } from '@equinor/eds-utils';
|
|
8
8
|
import { menu } from './Menu.tokens.js';
|
|
9
|
-
import { useFloating, offset, flip, shift, autoUpdate, useInteractions, useDismiss, FloatingPortal } from '@floating-ui/react
|
|
9
|
+
import { useFloating, offset, flip, shift, autoUpdate, useInteractions, useDismiss, FloatingPortal } from '@floating-ui/react';
|
|
10
10
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import { Paper } from '../Paper/Paper.js';
|
|
12
12
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
@@ -32,7 +32,11 @@ var MenuContainer = /*#__PURE__*/forwardRef(function MenuContainer(_ref2, ref) {
|
|
|
32
32
|
var _useMenu = useMenu(),
|
|
33
33
|
setOnClose = _useMenu.setOnClose,
|
|
34
34
|
onClose = _useMenu.onClose,
|
|
35
|
-
setInitialFocus = _useMenu.setInitialFocus
|
|
35
|
+
setInitialFocus = _useMenu.setInitialFocus,
|
|
36
|
+
focusedIndex = _useMenu.focusedIndex;
|
|
37
|
+
var closeMenuOnClickIndexes = useMemo(function () {
|
|
38
|
+
return [];
|
|
39
|
+
}, []);
|
|
36
40
|
useEffect(function () {
|
|
37
41
|
if (onClose === null && onCloseCallback) {
|
|
38
42
|
setOnClose(onCloseCallback);
|
|
@@ -72,7 +76,7 @@ var MenuContainer = /*#__PURE__*/forwardRef(function MenuContainer(_ref2, ref) {
|
|
|
72
76
|
}
|
|
73
77
|
});
|
|
74
78
|
useGlobalKeyPress('Enter', function () {
|
|
75
|
-
if (open && onClose !== null) {
|
|
79
|
+
if (open && onClose !== null && closeMenuOnClickIndexes.includes(focusedIndex)) {
|
|
76
80
|
setTimeout(function () {
|
|
77
81
|
if (window.document.contains(anchorEl)) {
|
|
78
82
|
anchorEl.focus();
|
|
@@ -80,7 +84,14 @@ var MenuContainer = /*#__PURE__*/forwardRef(function MenuContainer(_ref2, ref) {
|
|
|
80
84
|
}, 0);
|
|
81
85
|
}
|
|
82
86
|
});
|
|
83
|
-
|
|
87
|
+
var addCloseMenuOnClickIndex = function addCloseMenuOnClickIndex(index) {
|
|
88
|
+
if (closeMenuOnClickIndexes.indexOf(index) < 0) {
|
|
89
|
+
closeMenuOnClickIndexes.push(index);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
return /*#__PURE__*/jsx(MenuList, _objectSpread(_objectSpread({
|
|
93
|
+
addCloseMenuOnClickIndex: addCloseMenuOnClickIndex
|
|
94
|
+
}, rest), {}, {
|
|
84
95
|
ref: ref,
|
|
85
96
|
children: children
|
|
86
97
|
}));
|
|
@@ -121,7 +132,7 @@ var Menu = /*#__PURE__*/forwardRef(function Menu(_ref3, ref) {
|
|
|
121
132
|
var popoverRef = useMemo(function () {
|
|
122
133
|
return mergeRefs(floating, ref);
|
|
123
134
|
}, [floating, ref]);
|
|
124
|
-
|
|
135
|
+
useIsomorphicLayoutEffect(function () {
|
|
125
136
|
if (refs.reference.current && refs.floating.current && open) {
|
|
126
137
|
return autoUpdate(refs.reference.current, refs.floating.current, update);
|
|
127
138
|
}
|
|
@@ -7,7 +7,7 @@ import { typographyTemplate, spacingsTemplate, outlineTemplate, mergeRefs } from
|
|
|
7
7
|
import { useMenu } from './Menu.context.js';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
|
-
var _excluded = ["children", "disabled", "index", "onClick"];
|
|
10
|
+
var _excluded = ["children", "disabled", "index", "onClick", "closeMenuOnClick"];
|
|
11
11
|
var typography = menu.typography,
|
|
12
12
|
_tokens$entities = menu.entities,
|
|
13
13
|
_tokens$entities$item = _tokens$entities.item.states,
|
|
@@ -45,6 +45,8 @@ var MenuItem = /*#__PURE__*/forwardRef(function MenuItem(_ref5, ref) {
|
|
|
45
45
|
_ref5$index = _ref5.index,
|
|
46
46
|
index = _ref5$index === void 0 ? 0 : _ref5$index,
|
|
47
47
|
_onClick = _ref5.onClick,
|
|
48
|
+
_ref5$closeMenuOnClic = _ref5.closeMenuOnClick,
|
|
49
|
+
closeMenuOnClick = _ref5$closeMenuOnClic === void 0 ? true : _ref5$closeMenuOnClic,
|
|
48
50
|
rest = _objectWithoutProperties(_ref5, _excluded);
|
|
49
51
|
var _useMenu = useMenu(),
|
|
50
52
|
focusedIndex = _useMenu.focusedIndex,
|
|
@@ -74,7 +76,7 @@ var MenuItem = /*#__PURE__*/forwardRef(function MenuItem(_ref5, ref) {
|
|
|
74
76
|
onClick: function onClick(e) {
|
|
75
77
|
if (_onClick) {
|
|
76
78
|
_onClick(e);
|
|
77
|
-
if (onClose !== null) {
|
|
79
|
+
if (onClose !== null && closeMenuOnClick) {
|
|
78
80
|
onClose(e);
|
|
79
81
|
}
|
|
80
82
|
}
|
|
@@ -9,7 +9,7 @@ import { menu } from './Menu.tokens.js';
|
|
|
9
9
|
import { spacingsTemplate } from '@equinor/eds-utils';
|
|
10
10
|
import { jsx } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
|
-
var _excluded = ["children"];
|
|
12
|
+
var _excluded = ["addCloseMenuOnClickIndex", "children"];
|
|
13
13
|
var List = styled.div.withConfig({
|
|
14
14
|
displayName: "MenuList__List",
|
|
15
15
|
componentId: "sc-104rzof-0"
|
|
@@ -18,8 +18,13 @@ function isIndexable(item) {
|
|
|
18
18
|
if ( /*#__PURE__*/isValidElement(item) && !item.props.disabled && item.type === MenuItem) return true;
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
+
function closeMenuOnClick(item) {
|
|
22
|
+
if ( /*#__PURE__*/isValidElement(item) && item.type === MenuItem && item.props.closeMenuOnClick !== false) return true;
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
21
25
|
var MenuList = /*#__PURE__*/forwardRef(function MenuList(_ref, ref) {
|
|
22
|
-
var
|
|
26
|
+
var addCloseMenuOnClickIndex = _ref.addCloseMenuOnClickIndex,
|
|
27
|
+
children = _ref.children,
|
|
23
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
29
|
var _useMenu = useMenu(),
|
|
25
30
|
focusedIndex = _useMenu.focusedIndex,
|
|
@@ -48,12 +53,15 @@ var MenuList = /*#__PURE__*/forwardRef(function MenuList(_ref, ref) {
|
|
|
48
53
|
} else {
|
|
49
54
|
index++;
|
|
50
55
|
if (isIndexable(child)) focusableIndexs.push(index);
|
|
56
|
+
if (closeMenuOnClick(child)) {
|
|
57
|
+
addCloseMenuOnClickIndex(index);
|
|
58
|
+
}
|
|
51
59
|
return /*#__PURE__*/cloneElement(child, {
|
|
52
60
|
index: index
|
|
53
61
|
});
|
|
54
62
|
}
|
|
55
63
|
});
|
|
56
|
-
}, [children, focusableIndexs, index]);
|
|
64
|
+
}, [children, focusableIndexs, index, addCloseMenuOnClickIndex]);
|
|
57
65
|
var firstFocusIndex = focusableIndexs[0];
|
|
58
66
|
var lastFocusIndex = focusableIndexs[focusableIndexs.length - 1];
|
|
59
67
|
useEffect(function () {
|
|
@@ -10,14 +10,15 @@ var StyledPaper = styled.div.withConfig({
|
|
|
10
10
|
displayName: "Paper__StyledPaper",
|
|
11
11
|
componentId: "sc-6ncnv9-0"
|
|
12
12
|
})(["background:", ";box-shadow:", ";"], paper.background, function (_ref) {
|
|
13
|
-
var elevation = _ref
|
|
14
|
-
return elevation;
|
|
13
|
+
var $elevation = _ref.$elevation;
|
|
14
|
+
return $elevation;
|
|
15
15
|
});
|
|
16
16
|
var Paper = /*#__PURE__*/forwardRef(function Paper(_ref2, ref) {
|
|
17
|
+
var _elevationToken$eleva;
|
|
17
18
|
var elevation$1 = _ref2.elevation,
|
|
18
19
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
19
20
|
var props = _objectSpread(_objectSpread({}, rest), {}, {
|
|
20
|
-
elevation: elevation[elevation$1]
|
|
21
|
+
$elevation: (_elevationToken$eleva = elevation[elevation$1]) !== null && _elevationToken$eleva !== void 0 ? _elevationToken$eleva : 'none'
|
|
21
22
|
});
|
|
22
23
|
return /*#__PURE__*/jsx(StyledPaper, _objectSpread(_objectSpread({}, props), {}, {
|
|
23
24
|
ref: ref
|
|
@@ -5,7 +5,7 @@ import { forwardRef, useRef, useEffect, useMemo } from 'react';
|
|
|
5
5
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
6
6
|
import { typographyTemplate, bordersTemplate, outlineTemplate, mergeRefs, useToken } from '@equinor/eds-utils';
|
|
7
7
|
import { popover } from './Popover.tokens.js';
|
|
8
|
-
import { useFloating, offset, flip, shift, arrow, autoUpdate, useInteractions, useDismiss, FloatingPortal, FloatingFocusManager } from '@floating-ui/react
|
|
8
|
+
import { useFloating, offset, flip, shift, arrow, autoUpdate, useInteractions, useDismiss, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import { Paper } from '../Paper/Paper.js';
|
|
11
11
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
@@ -69,10 +69,10 @@ var Popover = /*#__PURE__*/forwardRef(function Popover(_ref5, ref) {
|
|
|
69
69
|
floating = _useFloating.floating,
|
|
70
70
|
strategy = _useFloating.strategy,
|
|
71
71
|
context = _useFloating.context,
|
|
72
|
-
_useFloating$middlewa = _useFloating.middlewareData.arrow
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
arrowY = _useFloating$
|
|
72
|
+
_useFloating$middlewa = _useFloating.middlewareData.arrow,
|
|
73
|
+
_useFloating$middlewa2 = _useFloating$middlewa === void 0 ? {} : _useFloating$middlewa,
|
|
74
|
+
arrowX = _useFloating$middlewa2.x,
|
|
75
|
+
arrowY = _useFloating$middlewa2.y,
|
|
76
76
|
finalPlacement = _useFloating.placement;
|
|
77
77
|
useEffect(function () {
|
|
78
78
|
reference(anchorEl);
|
|
@@ -4,7 +4,7 @@ import { forwardRef, useRef, useMemo } from 'react';
|
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { scrim } from './Scrim.tokens.js';
|
|
6
6
|
import { mergeRefs, useGlobalKeyPress } from '@equinor/eds-utils';
|
|
7
|
-
import { FloatingOverlay } from '@floating-ui/react
|
|
7
|
+
import { FloatingOverlay } from '@floating-ui/react';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
var _excluded = ["children", "onClose", "open", "isDismissable"];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
2
3
|
import _extends from '@babel/runtime/helpers/extends';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { Button } from '../Button/index.js';
|
|
@@ -23,7 +24,7 @@ var ToggleContainer = styled.div.withConfig({
|
|
|
23
24
|
return css(["width:", ";display:grid;place-items:center;margin-block-start:", ";margin-block-end:", ";"], minWidth, top, bottom);
|
|
24
25
|
});
|
|
25
26
|
var SideBarToggle = /*#__PURE__*/forwardRef(function SideBarToggle(_ref2, ref) {
|
|
26
|
-
var rest = _extends({}, _ref2);
|
|
27
|
+
var rest = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
27
28
|
var props = _objectSpread(_objectSpread({}, rest), {}, {
|
|
28
29
|
ref: ref
|
|
29
30
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
2
3
|
import _extends from '@babel/runtime/helpers/extends';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { InnerContext } from './Inner.context.js';
|
|
@@ -7,7 +8,7 @@ import { TableDataCell } from './DataCell/DataCell.js';
|
|
|
7
8
|
import { TableHeaderCell } from './HeaderCell/HeaderCell.js';
|
|
8
9
|
|
|
9
10
|
var Cell = /*#__PURE__*/forwardRef(function Cell(_ref, ref) {
|
|
10
|
-
var rest = _extends({}, _ref);
|
|
11
|
+
var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
11
12
|
return /*#__PURE__*/jsx(InnerContext.Consumer, {
|
|
12
13
|
children: function children(_ref2) {
|
|
13
14
|
var variant = _ref2.variant,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
2
3
|
import _extends from '@babel/runtime/helpers/extends';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import styled from 'styled-components';
|
|
@@ -21,7 +22,7 @@ var StyledRow = styled.tr.withConfig({
|
|
|
21
22
|
};
|
|
22
23
|
});
|
|
23
24
|
var Row = /*#__PURE__*/forwardRef(function Row(_ref2, ref) {
|
|
24
|
-
var props = _extends({}, _ref2);
|
|
25
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
25
26
|
var children = props.children;
|
|
26
27
|
return /*#__PURE__*/jsx(StyledRow, _objectSpread(_objectSpread({}, props), {}, {
|
|
27
28
|
ref: ref,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
2
3
|
import _extends from '@babel/runtime/helpers/extends';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import styled, { css } from 'styled-components';
|
|
@@ -19,7 +20,7 @@ var StyledTabPanel = styled.div.attrs(function () {
|
|
|
19
20
|
return css(["", " ", " &:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}"], spacingsTemplate(panel.spacings), typographyTemplate(panel.typography), outlineTemplate(panel.states.focus.outline), outlineTemplate(panel.states.focus.outline));
|
|
20
21
|
});
|
|
21
22
|
var TabPanel = /*#__PURE__*/forwardRef(function TabPanel(_ref2, ref) {
|
|
22
|
-
var props = _extends({}, _ref2);
|
|
23
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
23
24
|
return /*#__PURE__*/jsx(StyledTabPanel, _objectSpread(_objectSpread({
|
|
24
25
|
ref: ref
|
|
25
26
|
}, props), {}, {
|
|
@@ -6,7 +6,7 @@ import { forwardRef, useRef, useState, useMemo, useEffect, cloneElement } from '
|
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import { typographyTemplate, spacingsTemplate, bordersTemplate, mergeRefs } from '@equinor/eds-utils';
|
|
8
8
|
import { tooltip } from './Tooltip.tokens.js';
|
|
9
|
-
import { useFloating, offset, flip, shift, arrow, autoUpdate, useInteractions, useHover, useFocus, useRole, useDismiss, FloatingPortal } from '@floating-ui/react
|
|
9
|
+
import { useFloating, offset, flip, shift, arrow, autoUpdate, useInteractions, useHover, useFocus, useRole, useDismiss, FloatingPortal } from '@floating-ui/react';
|
|
10
10
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
12
|
var _excluded = ["title", "placement", "children", "style", "enterDelay"];
|
|
@@ -54,10 +54,10 @@ var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(_ref, ref) {
|
|
|
54
54
|
floating = _useFloating.floating,
|
|
55
55
|
strategy = _useFloating.strategy,
|
|
56
56
|
context = _useFloating.context,
|
|
57
|
-
_useFloating$middlewa = _useFloating.middlewareData.arrow
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
arrowY = _useFloating$
|
|
57
|
+
_useFloating$middlewa = _useFloating.middlewareData.arrow,
|
|
58
|
+
_useFloating$middlewa2 = _useFloating$middlewa === void 0 ? {} : _useFloating$middlewa,
|
|
59
|
+
arrowX = _useFloating$middlewa2.x,
|
|
60
|
+
arrowY = _useFloating$middlewa2.y,
|
|
61
61
|
finalPlacement = _useFloating.placement;
|
|
62
62
|
var anchorRef = useMemo(function () {
|
|
63
63
|
return mergeRefs(reference, children === null || children === void 0 ? void 0 : children.ref);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import type { AccordionProps } from './Accordion.types';
|
|
3
|
-
export
|
|
3
|
+
export type AccordionHeaderProps = {
|
|
4
4
|
/** The id of the button that toggles expansion */
|
|
5
5
|
id?: string;
|
|
6
6
|
/** Is AccordionItem expanded */
|
|
@@ -5,7 +5,7 @@ import { AccordionHeaderTitle, AccordionHeaderTitleProps } from './AccordionHead
|
|
|
5
5
|
import { AccordionHeaderActions, AccordionHeaderActionsProps } from './AccordionHeaderActions';
|
|
6
6
|
import { AccordionPanel, AccordionPanelProps } from './AccordionPanel';
|
|
7
7
|
import type { AccordionProps } from './Accordion.types';
|
|
8
|
-
|
|
8
|
+
type AccordionCompoundProps = typeof BaseAccordion & {
|
|
9
9
|
Item: typeof AccordionItem;
|
|
10
10
|
Header: typeof AccordionHeader;
|
|
11
11
|
HeaderTitle: typeof AccordionHeaderTitle;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type AutocompleteChanges<T> = {
|
|
3
3
|
selectedItems: T[];
|
|
4
4
|
};
|
|
5
|
-
export
|
|
6
|
-
/** List of options
|
|
5
|
+
export type AutocompleteProps<T> = {
|
|
6
|
+
/** List of options in dropdown */
|
|
7
7
|
options: T[];
|
|
8
8
|
/** Label for the select element */
|
|
9
9
|
label: string;
|
|
@@ -18,8 +18,8 @@ export declare type AutocompleteProps<T> = {
|
|
|
18
18
|
/** Hide clear button even when items are selected */
|
|
19
19
|
hideClearButton?: boolean;
|
|
20
20
|
/** If this prop is used, the select will become a controlled component. Use an empty
|
|
21
|
-
* array [] if there will be no initial selected items
|
|
22
|
-
* Note that this prop replaces the need for ```
|
|
21
|
+
* array [] if there will be no initial selected items.
|
|
22
|
+
* Note that this prop replaces the need for ```initialSelectedOptions```
|
|
23
23
|
* The items that should be selected. */
|
|
24
24
|
selectedOptions?: T[];
|
|
25
25
|
/** Callback for the selected item change
|
|
@@ -34,20 +34,20 @@ export declare type AutocompleteProps<T> = {
|
|
|
34
34
|
disablePortal?: boolean;
|
|
35
35
|
/** Disable option */
|
|
36
36
|
optionDisabled?: (option: T) => boolean;
|
|
37
|
-
/**
|
|
37
|
+
/** Custom filter function for options */
|
|
38
38
|
optionsFilter?: (option: T, inputValue: string) => boolean;
|
|
39
|
-
/** If `true` the width of the dropdown will adjust
|
|
39
|
+
/** If `true` the width of the dropdown will adjust to the width of the input */
|
|
40
40
|
autoWidth?: boolean;
|
|
41
41
|
/** Descriptive text for whats selected or about to be selected */
|
|
42
42
|
placeholder?: string;
|
|
43
|
-
/** Toggle if input is cleared when an
|
|
43
|
+
/** Toggle if input is cleared when an option is selected when `multiple` is `true`*/
|
|
44
44
|
clearSearchOnChange?: boolean;
|
|
45
45
|
/** Will wrap overflowing text at the expence of some performance overhead to calculate item heigths. Mostly relevant in combination with autoWidth */
|
|
46
46
|
multiline?: boolean;
|
|
47
47
|
} & HTMLAttributes<HTMLDivElement>;
|
|
48
48
|
declare function AutocompleteInner<T>(props: AutocompleteProps<T>, ref: React.ForwardedRef<HTMLDivElement>): JSX.Element;
|
|
49
49
|
export declare const Autocomplete: <T>(props: {
|
|
50
|
-
/** List of options
|
|
50
|
+
/** List of options in dropdown */
|
|
51
51
|
options: T[];
|
|
52
52
|
/** Label for the select element */
|
|
53
53
|
label: string;
|
|
@@ -62,8 +62,8 @@ export declare const Autocomplete: <T>(props: {
|
|
|
62
62
|
/** Hide clear button even when items are selected */
|
|
63
63
|
hideClearButton?: boolean;
|
|
64
64
|
/** If this prop is used, the select will become a controlled component. Use an empty
|
|
65
|
-
* array [] if there will be no initial selected items
|
|
66
|
-
* Note that this prop replaces the need for ```
|
|
65
|
+
* array [] if there will be no initial selected items.
|
|
66
|
+
* Note that this prop replaces the need for ```initialSelectedOptions```
|
|
67
67
|
* The items that should be selected. */
|
|
68
68
|
selectedOptions?: T[];
|
|
69
69
|
/** Callback for the selected item change
|
|
@@ -78,13 +78,13 @@ export declare const Autocomplete: <T>(props: {
|
|
|
78
78
|
disablePortal?: boolean;
|
|
79
79
|
/** Disable option */
|
|
80
80
|
optionDisabled?: (option: T) => boolean;
|
|
81
|
-
/**
|
|
81
|
+
/** Custom filter function for options */
|
|
82
82
|
optionsFilter?: (option: T, inputValue: string) => boolean;
|
|
83
|
-
/** If `true` the width of the dropdown will adjust
|
|
83
|
+
/** If `true` the width of the dropdown will adjust to the width of the input */
|
|
84
84
|
autoWidth?: boolean;
|
|
85
85
|
/** Descriptive text for whats selected or about to be selected */
|
|
86
86
|
placeholder?: string;
|
|
87
|
-
/** Toggle if input is cleared when an
|
|
87
|
+
/** Toggle if input is cleared when an option is selected when `multiple` is `true`*/
|
|
88
88
|
clearSearchOnChange?: boolean;
|
|
89
89
|
/** Will wrap overflowing text at the expence of some performance overhead to calculate item heigths. Mostly relevant in combination with autoWidth */
|
|
90
90
|
multiline?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { Elevations } from '@equinor/eds-tokens';
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
type AvailableElevations = keyof Pick<Elevations, 'none' | 'raised' | 'overlay'>;
|
|
4
|
+
export type BannerProps = {
|
|
5
5
|
elevation?: AvailableElevations;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
} & HTMLAttributes<HTMLDivElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
type BannerActionsPlacement = 'bottom' | 'left';
|
|
3
|
+
export type BannerActionsProps = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
placement?: BannerActionsPlacement;
|
|
6
6
|
} & HTMLAttributes<HTMLDivElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
type BannerIconVariant = 'info' | 'warning';
|
|
3
|
+
export type BannerIconProps = {
|
|
4
4
|
/** Which icon background and fill color to use. Info = green, warning = red */
|
|
5
5
|
variant?: BannerIconVariant;
|
|
6
6
|
/** @ignore */
|
|
@@ -2,7 +2,7 @@ import { Banner as BaseBanner, BannerProps } from './Banner';
|
|
|
2
2
|
import { BannerIcon, BannerIconProps } from './BannerIcon';
|
|
3
3
|
import { BannerMessage, BannerMessageProps } from './BannerMessage';
|
|
4
4
|
import { BannerActions, BannerActionsProps } from './BannerActions';
|
|
5
|
-
|
|
5
|
+
type BannerCompoundProps = typeof BaseBanner & {
|
|
6
6
|
Icon: typeof BannerIcon;
|
|
7
7
|
Message: typeof BannerMessage;
|
|
8
8
|
Actions: typeof BannerActions;
|