@equinor/eds-core-react 1.1.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/eds-core-react.cjs +272 -150
- package/dist/esm/components/Accordion/Accordion.js +4 -3
- package/dist/esm/components/Autocomplete/Autocomplete.js +88 -21
- package/dist/esm/components/Datepicker/fields/FieldWrapper.js +8 -2
- package/dist/esm/components/Icon/Icon.js +2 -3
- package/dist/esm/components/InputWrapper/useInputField.js +61 -0
- package/dist/esm/components/SideBar/SideBarAccordion/index.js +4 -3
- package/dist/esm/components/Slider/Slider.js +8 -5
- package/dist/esm/components/Tabs/Tabs.js +4 -3
- package/dist/esm/components/TextField/TextField.js +23 -56
- package/dist/esm/components/Textarea/Textarea.js +64 -33
- package/dist/esm/components/Typography/Typography.js +1 -15
- package/dist/esm/index.js +2 -0
- package/dist/types/components/InputWrapper/index.d.ts +5 -0
- package/dist/types/components/InputWrapper/types.d.ts +21 -0
- package/dist/types/components/InputWrapper/useInputField.d.ts +31 -0
- package/dist/types/components/TextField/TextField.d.ts +11 -0
- package/dist/types/components/Textarea/Textarea.d.ts +9 -0
- package/dist/types/{src/components → components}/Typography/Typography.d.ts +0 -13
- package/dist/types/{src/components → components}/Typography/Typography.new.d.ts +2 -6
- package/dist/types/{src/components → components}/Typography/Typography.new.types.d.ts +2 -2
- package/dist/types/{src/components → components}/Typography/Typography.stories.shared.d.ts +1 -22
- package/dist/types/{src/index.d.ts → index.d.ts} +1 -0
- package/package.json +6 -7
- package/dist/style.css +0 -81
- package/dist/style.js +0 -3
- package/dist/types/playwright.config.d.ts +0 -6
- package/dist/types/src/components/InputWrapper/index.d.ts +0 -2
- package/dist/types/src/components/TextField/TextField.d.ts +0 -31
- package/dist/types/src/components/Textarea/Textarea.d.ts +0 -30
- /package/dist/types/{src/components → components}/Accordion/Accordion.d.ts +0 -0
- /package/dist/types/{src/components → components}/Accordion/Accordion.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Accordion/Accordion.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Accordion/AccordionHeader.d.ts +0 -0
- /package/dist/types/{src/components → components}/Accordion/AccordionHeaderActions.d.ts +0 -0
- /package/dist/types/{src/components → components}/Accordion/AccordionHeaderTitle.d.ts +0 -0
- /package/dist/types/{src/components → components}/Accordion/AccordionItem.d.ts +0 -0
- /package/dist/types/{src/components → components}/Accordion/AccordionPanel.d.ts +0 -0
- /package/dist/types/{src/components → components}/Accordion/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Autocomplete/AddNewOption.d.ts +0 -0
- /package/dist/types/{src/components → components}/Autocomplete/Autocomplete.d.ts +0 -0
- /package/dist/types/{src/components → components}/Autocomplete/Autocomplete.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Autocomplete/Option.d.ts +0 -0
- /package/dist/types/{src/components → components}/Autocomplete/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Avatar/Avatar.d.ts +0 -0
- /package/dist/types/{src/components → components}/Avatar/Avatar.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Avatar/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Banner/Banner.d.ts +0 -0
- /package/dist/types/{src/components → components}/Banner/Banner.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Banner/BannerActions.d.ts +0 -0
- /package/dist/types/{src/components → components}/Banner/BannerIcon.d.ts +0 -0
- /package/dist/types/{src/components → components}/Banner/BannerMessage.d.ts +0 -0
- /package/dist/types/{src/components → components}/Banner/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Breadcrumbs/Breadcrumb.d.ts +0 -0
- /package/dist/types/{src/components → components}/Breadcrumbs/Breadcrumbs.d.ts +0 -0
- /package/dist/types/{src/components → components}/Breadcrumbs/Breadcrumbs.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Breadcrumbs/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/Button.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/Button.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/ButtonGroup/ButtonGroup.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/ButtonGroup/ButtonGroup.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/ButtonGroup/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/InnerFullWidth.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/ToggleButton/ToggleButton.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/ToggleButton/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/tokens/button.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/tokens/contained.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/tokens/contained_icon.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/tokens/ghost.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/tokens/icon.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/tokens/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Button/tokens/outlined.d.ts +0 -0
- /package/dist/types/{src/components → components}/Card/Card.d.ts +0 -0
- /package/dist/types/{src/components → components}/Card/Card.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Card/CardActions.d.ts +0 -0
- /package/dist/types/{src/components → components}/Card/CardContent.d.ts +0 -0
- /package/dist/types/{src/components → components}/Card/CardHeader.d.ts +0 -0
- /package/dist/types/{src/components → components}/Card/CardHeaderTitle.d.ts +0 -0
- /package/dist/types/{src/components → components}/Card/CardMedia.d.ts +0 -0
- /package/dist/types/{src/components → components}/Card/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Checkbox/Checkbox.d.ts +0 -0
- /package/dist/types/{src/components → components}/Checkbox/Checkbox.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Checkbox/Input.d.ts +0 -0
- /package/dist/types/{src/components → components}/Checkbox/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Chip/Chip.d.ts +0 -0
- /package/dist/types/{src/components → components}/Chip/Chip.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Chip/Icon.d.ts +0 -0
- /package/dist/types/{src/components → components}/Chip/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/DatePicker.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/DateRangePicker.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/calendars/Calendar.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/calendars/CalendarCell.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/calendars/CalendarGrid.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/calendars/CalendarHeader.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/calendars/CalendarWrapper.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/calendars/RangeCalendar.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/calendars/YearGrid.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/fields/DateField.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/fields/DateFieldSegments.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/fields/DateRangeField.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/fields/DateSegment.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/fields/FieldWrapper.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/fields/Toggle.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/props.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/utils/context.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/utils/get-calendar-date.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/utils/getPageYears.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/utils/types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/utils/useConvertedValidationFunctions.d.ts +0 -0
- /package/dist/types/{src/components → components}/Datepicker/utils/useGetLocale.d.ts +0 -0
- /package/dist/types/{src/components → components}/Dialog/Dialog.d.ts +0 -0
- /package/dist/types/{src/components → components}/Dialog/Dialog.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Dialog/DialogActions.d.ts +0 -0
- /package/dist/types/{src/components → components}/Dialog/DialogContent.d.ts +0 -0
- /package/dist/types/{src/components → components}/Dialog/DialogHeader.d.ts +0 -0
- /package/dist/types/{src/components → components}/Dialog/DialogTitle.d.ts +0 -0
- /package/dist/types/{src/components → components}/Dialog/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Divider/Divider.d.ts +0 -0
- /package/dist/types/{src/components → components}/Divider/Divider.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Divider/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/EdsProvider/eds.context.d.ts +0 -0
- /package/dist/types/{src/components → components}/EdsProvider/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Icon/Icon.d.ts +0 -0
- /package/dist/types/{src/components → components}/Icon/Icon.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Icon/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Icon/library.d.ts +0 -0
- /package/dist/types/{src/components → components}/Input/Input.d.ts +0 -0
- /package/dist/types/{src/components → components}/Input/Input.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Input/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/InputWrapper/HelperText/HelperText.d.ts +0 -0
- /package/dist/types/{src/components → components}/InputWrapper/HelperText/HelperText.token.d.ts +0 -0
- /package/dist/types/{src/components → components}/InputWrapper/HelperText/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/InputWrapper/InputWrapper.d.ts +0 -0
- /package/dist/types/{src/components → components}/InputWrapper/InputWrapper.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Label/Label.d.ts +0 -0
- /package/dist/types/{src/components → components}/Label/Label.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Label/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/List/List.d.ts +0 -0
- /package/dist/types/{src/components → components}/List/List.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/List/ListItem.d.ts +0 -0
- /package/dist/types/{src/components → components}/List/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Menu/Menu.context.d.ts +0 -0
- /package/dist/types/{src/components → components}/Menu/Menu.d.ts +0 -0
- /package/dist/types/{src/components → components}/Menu/Menu.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Menu/Menu.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Menu/MenuItem.d.ts +0 -0
- /package/dist/types/{src/components → components}/Menu/MenuList.d.ts +0 -0
- /package/dist/types/{src/components → components}/Menu/MenuSection.d.ts +0 -0
- /package/dist/types/{src/components → components}/Menu/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Pagination/Pagination.d.ts +0 -0
- /package/dist/types/{src/components → components}/Pagination/Pagination.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Pagination/PaginationItem.d.ts +0 -0
- /package/dist/types/{src/components → components}/Pagination/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Pagination/paginationControl.d.ts +0 -0
- /package/dist/types/{src/components → components}/Paper/Paper.d.ts +0 -0
- /package/dist/types/{src/components → components}/Paper/Paper.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Paper/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Popover/Popover.d.ts +0 -0
- /package/dist/types/{src/components → components}/Popover/Popover.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Popover/PopoverActions.d.ts +0 -0
- /package/dist/types/{src/components → components}/Popover/PopoverContent.d.ts +0 -0
- /package/dist/types/{src/components → components}/Popover/PopoverHeader.d.ts +0 -0
- /package/dist/types/{src/components → components}/Popover/PopoverTitle.d.ts +0 -0
- /package/dist/types/{src/components → components}/Popover/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/Circular/CircularProgress.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/Circular/CircularProgress.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/Dots/DotProgress.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/Dots/DotProgress.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/Linear/LinearProgress.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/Linear/LinearProgress.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/Star/StarProgress.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/Star/StarProgress.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Progress/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Radio/Radio.d.ts +0 -0
- /package/dist/types/{src/components → components}/Radio/Radio.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Radio/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Scrim/Scrim.d.ts +0 -0
- /package/dist/types/{src/components → components}/Scrim/Scrim.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Scrim/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Search/Search.d.ts +0 -0
- /package/dist/types/{src/components → components}/Search/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Select/NativeSelect.d.ts +0 -0
- /package/dist/types/{src/components → components}/Select/NativeSelect.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Select/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBar.context.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBar.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBar.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBarAccordion/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBarAccordionItem/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBarButton/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBarContent.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBarFooter.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SideBarToggle.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/SidebarLink/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideBar/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideSheet/SideSheet.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideSheet/SideSheet.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/SideSheet/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Slider/MinMax.d.ts +0 -0
- /package/dist/types/{src/components → components}/Slider/Output.d.ts +0 -0
- /package/dist/types/{src/components → components}/Slider/Slider.d.ts +0 -0
- /package/dist/types/{src/components → components}/Slider/Slider.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Slider/SliderInput.d.ts +0 -0
- /package/dist/types/{src/components → components}/Slider/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Snackbar/Snackbar.d.ts +0 -0
- /package/dist/types/{src/components → components}/Snackbar/Snackbar.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Snackbar/SnackbarAction.d.ts +0 -0
- /package/dist/types/{src/components → components}/Snackbar/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Switch/Switch.d.ts +0 -0
- /package/dist/types/{src/components → components}/Switch/Switch.styles.d.ts +0 -0
- /package/dist/types/{src/components → components}/Switch/Switch.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Switch/SwitchDefault.d.ts +0 -0
- /package/dist/types/{src/components → components}/Switch/SwitchSmall.d.ts +0 -0
- /package/dist/types/{src/components → components}/Switch/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Body.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Caption.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Cell.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/DataCell/DataCell.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/DataCell/DataCell.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/DataCell/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Foot/Foot.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Foot/Foot.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Foot/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/FooterCell/FooterCell.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/FooterCell/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Head/Head.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Head/Head.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Head/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/HeaderCell/HeaderCell.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/HeaderCell/HeaderCell.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/HeaderCell/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Inner.context.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Row/Row.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Row/Row.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Row/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Table.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/Table.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Table/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/TableOfContents/LinkItem.d.ts +0 -0
- /package/dist/types/{src/components → components}/TableOfContents/TableOfContents.d.ts +0 -0
- /package/dist/types/{src/components → components}/TableOfContents/TableOfContents.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/TableOfContents/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/Tab.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/TabList.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/TabPanel.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/TabPanels.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/Tabs.context.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/Tabs.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/Tabs.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/Tabs.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tabs/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/TextField/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Textarea/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tooltip/Tooltip.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tooltip/Tooltip.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Tooltip/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/TopBar/Actions.d.ts +0 -0
- /package/dist/types/{src/components → components}/TopBar/CustomContent.d.ts +0 -0
- /package/dist/types/{src/components → components}/TopBar/Header.d.ts +0 -0
- /package/dist/types/{src/components → components}/TopBar/TopBar.d.ts +0 -0
- /package/dist/types/{src/components → components}/TopBar/TopBar.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/TopBar/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Typography/Heading.d.ts +0 -0
- /package/dist/types/{src/components → components}/Typography/Heading.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Typography/Paragraph.d.ts +0 -0
- /package/dist/types/{src/components → components}/Typography/Paragraph.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Typography/Typography.tokens.d.ts +0 -0
- /package/dist/types/{src/components → components}/Typography/index.d.ts +0 -0
- /package/dist/types/{src/components → components}/Typography/types.d.ts +0 -0
- /package/dist/types/{src/components → components}/Typography/utils.d.ts +0 -0
- /package/dist/types/{src/components → components}/types.d.ts +0 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Read the [changelog](https://github.com/equinor/design-system/blob/main/packages
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
|
-
npm install @equinor/eds-core-react styled-components
|
|
11
|
+
npm install @equinor/eds-core-react @equinor/eds-tokens styled-components
|
|
12
12
|
```
|
|
13
13
|
If you use Typescript, make sure you have typescript >= 3.8 as a devDependency:
|
|
14
14
|
```sh
|
|
@@ -20,9 +20,18 @@ npm install typescript --save-dev
|
|
|
20
20
|
The Equinor typeface is not included and needs to be added to the head of your project. Its available from the EDS CDN:
|
|
21
21
|
|
|
22
22
|
```html
|
|
23
|
-
<link rel="stylesheet" href="https://cdn.eds.equinor.com/font/
|
|
23
|
+
<link rel="stylesheet" href="https://cdn.eds.equinor.com/font/eds-uprights-vf.css" />
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
### Required Stylesheets
|
|
27
|
+
|
|
28
|
+
EDS Core React components require css variables (colors, spacing and typography).
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
@import '@equinor/eds-tokens/css/variables';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
26
35
|
## Usage
|
|
27
36
|
|
|
28
37
|
```jsx
|
package/dist/eds-core-react.cjs
CHANGED
|
@@ -1443,19 +1443,6 @@ const StyledTypography$1 = styled__default.default.p.withConfig({
|
|
|
1443
1443
|
}) => $lines && styled.css(["display:-webkit-box;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;"], $lines), ({
|
|
1444
1444
|
$link
|
|
1445
1445
|
}) => $link && styled.css(["&:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}"], edsUtils.outlineTemplate(link.states.focus.outline), edsUtils.outlineTemplate(link.states.focus.outline)));
|
|
1446
|
-
/**
|
|
1447
|
-
* @deprecated Typography component is deprecated and will be removed in a future version.
|
|
1448
|
-
* Please use the new Typography, Heading, or Paragraph components instead.
|
|
1449
|
-
*
|
|
1450
|
-
* Migration guide:
|
|
1451
|
-
* - For headings: Use `<Heading as="h1|h2|h3|h4|h5|h6">` instead of `<Typography variant="h1|h2|h3|h4|h5|h6">`
|
|
1452
|
-
* - For paragraphs: Use `<Paragraph>` instead of `<Typography variant="body_short|body_long">`
|
|
1453
|
-
* - For inline text: Use `<Typography>` for more flexible text styling
|
|
1454
|
-
*
|
|
1455
|
-
* @see {@link TypographyNext}
|
|
1456
|
-
* @see {@link Heading}
|
|
1457
|
-
* @see {@link Paragraph}
|
|
1458
|
-
*/
|
|
1459
1446
|
const Typography = /*#__PURE__*/react.forwardRef(function Typography({
|
|
1460
1447
|
variant = 'body_short',
|
|
1461
1448
|
children,
|
|
@@ -1469,7 +1456,6 @@ const Typography = /*#__PURE__*/react.forwardRef(function Typography({
|
|
|
1469
1456
|
as: providedAs,
|
|
1470
1457
|
...other
|
|
1471
1458
|
}, ref) {
|
|
1472
|
-
edsUtils.useDeprecationWarning('The Typography component is deprecated and will be removed in a future version. ' + 'Please migrate to the new TypographyNext, Heading, or Paragraph component. ' + 'See the documentation for migration details.', 'Typography');
|
|
1473
1459
|
const as = providedAs ? providedAs : getElementType(variant, link);
|
|
1474
1460
|
const variantName = toVariantName(variant, bold, italic, link);
|
|
1475
1461
|
const typography = findTypography(variantName, group);
|
|
@@ -2747,6 +2733,64 @@ const InputWrapper$2 = /*#__PURE__*/react.forwardRef(function InputWrapper({
|
|
|
2747
2733
|
});
|
|
2748
2734
|
});
|
|
2749
2735
|
|
|
2736
|
+
/**
|
|
2737
|
+
* Shared hook for TextField and Textarea that handles common logic
|
|
2738
|
+
* for IDs, labels, helper text, and ARIA attributes
|
|
2739
|
+
*/
|
|
2740
|
+
const useInputField = ({
|
|
2741
|
+
id,
|
|
2742
|
+
label,
|
|
2743
|
+
meta,
|
|
2744
|
+
helperText,
|
|
2745
|
+
helperIcon,
|
|
2746
|
+
variant,
|
|
2747
|
+
disabled,
|
|
2748
|
+
className,
|
|
2749
|
+
style
|
|
2750
|
+
}) => {
|
|
2751
|
+
const generatedFieldId = react.useId();
|
|
2752
|
+
const generatedHelperTextId = react.useId();
|
|
2753
|
+
|
|
2754
|
+
// Use provided ID or fall back to generated one
|
|
2755
|
+
const fieldId = id ?? generatedFieldId;
|
|
2756
|
+
const helperTextId = generatedHelperTextId;
|
|
2757
|
+
const hasHelperText = Boolean(helperText);
|
|
2758
|
+
const containerProps = {
|
|
2759
|
+
className,
|
|
2760
|
+
style: {
|
|
2761
|
+
width: '100%',
|
|
2762
|
+
...style
|
|
2763
|
+
},
|
|
2764
|
+
color: variant
|
|
2765
|
+
};
|
|
2766
|
+
const labelProps = {
|
|
2767
|
+
htmlFor: fieldId,
|
|
2768
|
+
label,
|
|
2769
|
+
meta,
|
|
2770
|
+
disabled
|
|
2771
|
+
};
|
|
2772
|
+
const helperProps = {
|
|
2773
|
+
id: hasHelperText ? helperTextId : null,
|
|
2774
|
+
text: helperText,
|
|
2775
|
+
icon: helperIcon
|
|
2776
|
+
};
|
|
2777
|
+
const ariaProps = {
|
|
2778
|
+
id: fieldId,
|
|
2779
|
+
'aria-invalid': variant === 'error' || undefined,
|
|
2780
|
+
...(hasHelperText && {
|
|
2781
|
+
'aria-describedby': helperTextId
|
|
2782
|
+
})
|
|
2783
|
+
};
|
|
2784
|
+
return {
|
|
2785
|
+
fieldId,
|
|
2786
|
+
helperTextId: hasHelperText ? helperTextId : null,
|
|
2787
|
+
containerProps,
|
|
2788
|
+
labelProps,
|
|
2789
|
+
helperProps,
|
|
2790
|
+
ariaProps
|
|
2791
|
+
};
|
|
2792
|
+
};
|
|
2793
|
+
|
|
2750
2794
|
const {
|
|
2751
2795
|
colors: {
|
|
2752
2796
|
ui: {
|
|
@@ -3088,148 +3132,145 @@ const Input$4 = /*#__PURE__*/react.forwardRef(function Input({
|
|
|
3088
3132
|
);
|
|
3089
3133
|
});
|
|
3090
3134
|
|
|
3091
|
-
const {
|
|
3092
|
-
input
|
|
3093
|
-
} = tokens$5;
|
|
3094
|
-
const Textarea = /*#__PURE__*/react.forwardRef(function Textarea({
|
|
3095
|
-
variant,
|
|
3096
|
-
disabled = false,
|
|
3097
|
-
type = 'text',
|
|
3098
|
-
rowsMax,
|
|
3099
|
-
...other
|
|
3100
|
-
}, ref) {
|
|
3101
|
-
const [textareaEl, setTextareaEl] = react.useState(null);
|
|
3102
|
-
const {
|
|
3103
|
-
density
|
|
3104
|
-
} = useEds();
|
|
3105
|
-
const spacings = density === 'compact' ? input.modes.compact.spacings : input.spacings;
|
|
3106
|
-
const {
|
|
3107
|
-
lineHeight
|
|
3108
|
-
} = input$1.typography;
|
|
3109
|
-
const {
|
|
3110
|
-
top,
|
|
3111
|
-
bottom
|
|
3112
|
-
} = spacings;
|
|
3113
|
-
let fontSize = 16;
|
|
3114
|
-
if (textareaEl) {
|
|
3115
|
-
fontSize = parseInt(window.getComputedStyle(textareaEl).fontSize);
|
|
3116
|
-
}
|
|
3117
|
-
const padding = parseInt(top) + parseInt(bottom);
|
|
3118
|
-
const maxHeight = parseFloat(lineHeight) * fontSize * rowsMax + padding;
|
|
3119
|
-
edsUtils.useAutoResize(textareaEl, rowsMax ? maxHeight : null);
|
|
3120
|
-
const combinedRef = react.useCallback(() => edsUtils.mergeRefs(ref, setTextareaEl), [setTextareaEl, ref])();
|
|
3121
|
-
const inputProps = {
|
|
3122
|
-
ref: combinedRef,
|
|
3123
|
-
type,
|
|
3124
|
-
disabled,
|
|
3125
|
-
variant,
|
|
3126
|
-
...other
|
|
3127
|
-
};
|
|
3128
|
-
const leftAdornmentStyles = {
|
|
3129
|
-
style: {
|
|
3130
|
-
alignItems: 'flex-start'
|
|
3131
|
-
}
|
|
3132
|
-
};
|
|
3133
|
-
const rigthAdornmentStyles = {
|
|
3134
|
-
style: {
|
|
3135
|
-
alignItems: 'flex-start',
|
|
3136
|
-
pointerEvents: 'none'
|
|
3137
|
-
}
|
|
3138
|
-
};
|
|
3139
|
-
return /*#__PURE__*/jsxRuntime.jsx(Input$4, {
|
|
3140
|
-
as: "textarea",
|
|
3141
|
-
rightAdornmentsProps: rigthAdornmentStyles,
|
|
3142
|
-
leftAdornmentsProps: leftAdornmentStyles,
|
|
3143
|
-
style: {
|
|
3144
|
-
height: 'auto'
|
|
3145
|
-
},
|
|
3146
|
-
...inputProps
|
|
3147
|
-
});
|
|
3148
|
-
});
|
|
3149
|
-
|
|
3150
|
-
/** Proxy component for working around typescript and element type switching */
|
|
3151
|
-
const Field = /*#__PURE__*/react.forwardRef(function Field(props, ref) {
|
|
3152
|
-
return props.$multiline ? /*#__PURE__*/jsxRuntime.jsx(Textarea, {
|
|
3153
|
-
ref: ref,
|
|
3154
|
-
...props
|
|
3155
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(Input$4, {
|
|
3156
|
-
ref: ref,
|
|
3157
|
-
...props
|
|
3158
|
-
});
|
|
3159
|
-
});
|
|
3160
3135
|
const TextField = /*#__PURE__*/react.forwardRef(function TextField({
|
|
3161
|
-
id
|
|
3136
|
+
id,
|
|
3162
3137
|
label,
|
|
3163
3138
|
meta,
|
|
3164
3139
|
unit,
|
|
3165
3140
|
helperText,
|
|
3166
3141
|
placeholder,
|
|
3167
3142
|
disabled,
|
|
3168
|
-
multiline = false,
|
|
3169
3143
|
className,
|
|
3170
3144
|
variant,
|
|
3171
3145
|
inputIcon,
|
|
3172
3146
|
helperIcon,
|
|
3173
3147
|
style,
|
|
3174
|
-
rowsMax,
|
|
3175
|
-
textareaRef,
|
|
3176
3148
|
inputRef,
|
|
3177
3149
|
...other
|
|
3178
3150
|
}, ref) {
|
|
3179
|
-
const
|
|
3180
|
-
|
|
3151
|
+
const {
|
|
3152
|
+
ariaProps,
|
|
3153
|
+
containerProps,
|
|
3154
|
+
labelProps,
|
|
3155
|
+
helperProps
|
|
3156
|
+
} = useInputField({
|
|
3157
|
+
id,
|
|
3158
|
+
label,
|
|
3159
|
+
meta,
|
|
3160
|
+
helperText,
|
|
3161
|
+
helperIcon,
|
|
3162
|
+
variant,
|
|
3163
|
+
disabled,
|
|
3164
|
+
className,
|
|
3165
|
+
style
|
|
3166
|
+
});
|
|
3181
3167
|
const hasRightAdornments = Boolean(unit || inputIcon);
|
|
3182
|
-
|
|
3183
|
-
|
|
3168
|
+
const fieldProps = {
|
|
3169
|
+
...ariaProps,
|
|
3184
3170
|
disabled,
|
|
3185
3171
|
placeholder,
|
|
3186
|
-
id,
|
|
3187
3172
|
variant,
|
|
3188
3173
|
rightAdornments: hasRightAdornments && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3189
3174
|
children: [inputIcon, /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3190
3175
|
children: unit
|
|
3191
3176
|
})]
|
|
3192
3177
|
}),
|
|
3193
|
-
|
|
3194
|
-
ref: ref || inputRef || textareaRef,
|
|
3195
|
-
$multiline: multiline,
|
|
3178
|
+
ref: ref || inputRef,
|
|
3196
3179
|
...other
|
|
3197
3180
|
};
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3181
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputWrapper$2, {
|
|
3182
|
+
helperProps: helperProps,
|
|
3183
|
+
labelProps: labelProps,
|
|
3184
|
+
...containerProps,
|
|
3185
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Input$4, {
|
|
3186
|
+
...fieldProps
|
|
3187
|
+
})
|
|
3188
|
+
});
|
|
3189
|
+
});
|
|
3190
|
+
|
|
3191
|
+
const {
|
|
3192
|
+
input
|
|
3193
|
+
} = tokens$5;
|
|
3194
|
+
const leftAdornmentStyles = {
|
|
3195
|
+
style: {
|
|
3196
|
+
alignItems: 'flex-start'
|
|
3197
|
+
}
|
|
3198
|
+
};
|
|
3199
|
+
const rightAdornmentStyles = {
|
|
3200
|
+
style: {
|
|
3201
|
+
alignItems: 'flex-start',
|
|
3202
|
+
pointerEvents: 'none'
|
|
3203
|
+
}
|
|
3204
|
+
};
|
|
3205
|
+
const Textarea = /*#__PURE__*/react.forwardRef(function Textarea({
|
|
3206
|
+
id,
|
|
3207
|
+
label,
|
|
3208
|
+
meta,
|
|
3209
|
+
helperText,
|
|
3210
|
+
placeholder,
|
|
3211
|
+
disabled,
|
|
3212
|
+
className,
|
|
3213
|
+
variant,
|
|
3214
|
+
inputIcon,
|
|
3215
|
+
helperIcon,
|
|
3216
|
+
style,
|
|
3217
|
+
rowsMax,
|
|
3218
|
+
...other
|
|
3219
|
+
}, ref) {
|
|
3220
|
+
const {
|
|
3221
|
+
ariaProps,
|
|
3222
|
+
containerProps,
|
|
3223
|
+
labelProps,
|
|
3224
|
+
helperProps
|
|
3225
|
+
} = useInputField({
|
|
3226
|
+
id,
|
|
3227
|
+
label,
|
|
3228
|
+
meta,
|
|
3229
|
+
helperText,
|
|
3230
|
+
helperIcon,
|
|
3231
|
+
variant,
|
|
3232
|
+
disabled,
|
|
3205
3233
|
className,
|
|
3234
|
+
style
|
|
3235
|
+
});
|
|
3236
|
+
const {
|
|
3237
|
+
density
|
|
3238
|
+
} = useEds();
|
|
3239
|
+
const spacings = density === 'compact' ? input.modes.compact.spacings : input.spacings;
|
|
3240
|
+
const {
|
|
3241
|
+
lineHeight
|
|
3242
|
+
} = input$1.typography;
|
|
3243
|
+
const {
|
|
3244
|
+
top,
|
|
3245
|
+
bottom
|
|
3246
|
+
} = spacings;
|
|
3247
|
+
|
|
3248
|
+
// Calculate maxHeight if rowsMax is provided
|
|
3249
|
+
// Using default fontSize of 16px for initial calculation
|
|
3250
|
+
// useAutoResize will handle actual resizing based on element's scrollHeight
|
|
3251
|
+
const maxHeight = rowsMax ? parseFloat(lineHeight) * 16 * rowsMax + parseInt(top) + parseInt(bottom) : null;
|
|
3252
|
+
const autoResizeRef = edsUtils.useAutoResize(maxHeight);
|
|
3253
|
+
const combinedRef = react.useMemo(() => edsUtils.mergeRefs(ref, autoResizeRef), [ref, autoResizeRef]);
|
|
3254
|
+
const fieldProps = {
|
|
3255
|
+
...ariaProps,
|
|
3256
|
+
disabled,
|
|
3257
|
+
placeholder,
|
|
3258
|
+
variant,
|
|
3259
|
+
rightAdornments: inputIcon,
|
|
3260
|
+
rightAdornmentsProps: rightAdornmentStyles,
|
|
3261
|
+
leftAdornmentsProps: leftAdornmentStyles,
|
|
3262
|
+
as: 'textarea',
|
|
3263
|
+
ref: combinedRef,
|
|
3206
3264
|
style: {
|
|
3207
|
-
|
|
3208
|
-
...style
|
|
3265
|
+
height: 'auto'
|
|
3209
3266
|
},
|
|
3210
|
-
|
|
3211
|
-
};
|
|
3212
|
-
const labelProps = {
|
|
3213
|
-
htmlFor: id,
|
|
3214
|
-
label,
|
|
3215
|
-
meta,
|
|
3216
|
-
disabled
|
|
3267
|
+
...other
|
|
3217
3268
|
};
|
|
3218
|
-
if (helperText) {
|
|
3219
|
-
fieldProps = {
|
|
3220
|
-
'aria-describedby': helperTextId,
|
|
3221
|
-
...fieldProps
|
|
3222
|
-
};
|
|
3223
|
-
helperProps = {
|
|
3224
|
-
...helperProps,
|
|
3225
|
-
id: helperTextId
|
|
3226
|
-
};
|
|
3227
|
-
}
|
|
3228
3269
|
return /*#__PURE__*/jsxRuntime.jsx(InputWrapper$2, {
|
|
3229
3270
|
helperProps: helperProps,
|
|
3230
3271
|
labelProps: labelProps,
|
|
3231
3272
|
...containerProps,
|
|
3232
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
3273
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Input$4, {
|
|
3233
3274
|
...fieldProps
|
|
3234
3275
|
})
|
|
3235
3276
|
});
|
|
@@ -3316,7 +3357,7 @@ const Icon$2 = /*#__PURE__*/react.forwardRef(function Icon({
|
|
|
3316
3357
|
};
|
|
3317
3358
|
|
|
3318
3359
|
// Accessibility
|
|
3319
|
-
const titleId =
|
|
3360
|
+
const titleId = react.useId();
|
|
3320
3361
|
if (title) {
|
|
3321
3362
|
svgProps = {
|
|
3322
3363
|
...svgProps,
|
|
@@ -3532,7 +3573,8 @@ const Accordion$1 = /*#__PURE__*/react.forwardRef(function Accordion({
|
|
|
3532
3573
|
id,
|
|
3533
3574
|
...props
|
|
3534
3575
|
}, ref) {
|
|
3535
|
-
const
|
|
3576
|
+
const generatedAccordionId = react.useId();
|
|
3577
|
+
const accordionId = id ?? generatedAccordionId;
|
|
3536
3578
|
const {
|
|
3537
3579
|
density
|
|
3538
3580
|
} = useEds();
|
|
@@ -4044,7 +4086,8 @@ const Tabs$1 = /*#__PURE__*/react.forwardRef(function Tabs({
|
|
|
4044
4086
|
id,
|
|
4045
4087
|
...props
|
|
4046
4088
|
}, ref) {
|
|
4047
|
-
const
|
|
4089
|
+
const generatedTabsId = react.useId();
|
|
4090
|
+
const tabsId = id ?? generatedTabsId;
|
|
4048
4091
|
const tabsRef = react.useRef(null);
|
|
4049
4092
|
const combinedTabsRef = react.useMemo(() => edsUtils.mergeRefs(tabsRef, ref), [tabsRef, ref]);
|
|
4050
4093
|
const [tabsFocused, setTabsFocused] = react.useState(false);
|
|
@@ -6152,9 +6195,12 @@ const Slider = /*#__PURE__*/react.forwardRef(function Slider({
|
|
|
6152
6195
|
setMousePressed(false);
|
|
6153
6196
|
}
|
|
6154
6197
|
};
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6198
|
+
const generatedInputIdA = react.useId();
|
|
6199
|
+
const generatedInputIdB = react.useId();
|
|
6200
|
+
const generatedInputId = react.useId();
|
|
6201
|
+
let inputIdA = generatedInputIdA;
|
|
6202
|
+
let inputIdB = generatedInputIdB;
|
|
6203
|
+
let inputId = generatedInputId;
|
|
6158
6204
|
if (rest['id']) {
|
|
6159
6205
|
const overrideId = rest['id'];
|
|
6160
6206
|
inputIdA = `${overrideId}-thumb-a`;
|
|
@@ -9849,6 +9895,8 @@ const defaultOptionDisabled = () => false;
|
|
|
9849
9895
|
|
|
9850
9896
|
// MARK: component
|
|
9851
9897
|
function AutocompleteInner(props, ref) {
|
|
9898
|
+
const [controlledHighlightedIndex, setControlledHighlightedIndex] = react.useState(0);
|
|
9899
|
+
const [lastScrollOffset, setLastScrollOffset] = react.useState(0);
|
|
9852
9900
|
const {
|
|
9853
9901
|
options = [],
|
|
9854
9902
|
totalOptions,
|
|
@@ -9920,6 +9968,7 @@ function AutocompleteInner(props, ref) {
|
|
|
9920
9968
|
if (onAddNewOption) return [AddSymbol, ..._availableItems];
|
|
9921
9969
|
return _availableItems;
|
|
9922
9970
|
}, [_availableItems, showSelectAll, onAddNewOption]);
|
|
9971
|
+
const getSelectedIndex = react.useCallback(selectedItem => availableItems.findIndex(item => itemCompare ? itemCompare(item, selectedItem) : item === selectedItem), [availableItems, itemCompare]);
|
|
9923
9972
|
|
|
9924
9973
|
//issue 2304, update dataset when options are added dynamically
|
|
9925
9974
|
react.useEffect(() => {
|
|
@@ -10057,20 +10106,18 @@ function AutocompleteInner(props, ref) {
|
|
|
10057
10106
|
}));
|
|
10058
10107
|
},
|
|
10059
10108
|
onHighlightedIndexChange({
|
|
10060
|
-
highlightedIndex
|
|
10061
|
-
type
|
|
10109
|
+
highlightedIndex
|
|
10062
10110
|
}) {
|
|
10063
|
-
if (
|
|
10064
|
-
|
|
10065
|
-
|
|
10111
|
+
if (highlightedIndex >= 0 && rowVirtualizer.getVirtualItems) {
|
|
10112
|
+
const visibleIndexes = rowVirtualizer.getVirtualItems().map(v => v.index);
|
|
10113
|
+
if (!visibleIndexes.includes(highlightedIndex)) {
|
|
10066
10114
|
rowVirtualizer.scrollToIndex(highlightedIndex, {
|
|
10067
10115
|
align: allowSelectAll ? 'center' : 'auto'
|
|
10068
10116
|
});
|
|
10069
|
-
}
|
|
10070
|
-
}
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
});
|
|
10117
|
+
}
|
|
10118
|
+
}
|
|
10119
|
+
if (typeof rowVirtualizer.scrollOffset === 'number') {
|
|
10120
|
+
setLastScrollOffset(rowVirtualizer.scrollOffset);
|
|
10074
10121
|
}
|
|
10075
10122
|
},
|
|
10076
10123
|
onIsOpenChange: ({
|
|
@@ -10078,6 +10125,19 @@ function AutocompleteInner(props, ref) {
|
|
|
10078
10125
|
}) => {
|
|
10079
10126
|
if (!multiple && selectedItem !== null) {
|
|
10080
10127
|
setAvailableItems(options);
|
|
10128
|
+
setTimeout(() => {
|
|
10129
|
+
if (controlledHighlightedIndex === 0) {
|
|
10130
|
+
rowVirtualizer.scrollToOffset?.(0);
|
|
10131
|
+
} else if (rowVirtualizer.scrollToOffset && lastScrollOffset > 0) {
|
|
10132
|
+
rowVirtualizer.scrollToOffset(lastScrollOffset);
|
|
10133
|
+
}
|
|
10134
|
+
const visibleIndexes = rowVirtualizer.getVirtualItems?.().map(v => v.index) || [];
|
|
10135
|
+
if (!visibleIndexes.includes(controlledHighlightedIndex)) {
|
|
10136
|
+
rowVirtualizer.scrollToIndex(controlledHighlightedIndex, {
|
|
10137
|
+
align: allowSelectAll ? 'center' : 'auto'
|
|
10138
|
+
});
|
|
10139
|
+
}
|
|
10140
|
+
}, 10);
|
|
10081
10141
|
}
|
|
10082
10142
|
},
|
|
10083
10143
|
onStateChange: ({
|
|
@@ -10117,6 +10177,8 @@ function AutocompleteInner(props, ref) {
|
|
|
10117
10177
|
...comboBoxProps,
|
|
10118
10178
|
onSelectedItemChange: changes => {
|
|
10119
10179
|
if (changes.selectedItem === AddSymbol) return;
|
|
10180
|
+
const idx = getSelectedIndex(changes.selectedItem);
|
|
10181
|
+
setControlledHighlightedIndex(idx >= 0 ? idx : 0);
|
|
10120
10182
|
if (onOptionsChange) {
|
|
10121
10183
|
let {
|
|
10122
10184
|
selectedItem
|
|
@@ -10129,7 +10191,7 @@ function AutocompleteInner(props, ref) {
|
|
|
10129
10191
|
});
|
|
10130
10192
|
}
|
|
10131
10193
|
},
|
|
10132
|
-
stateReducer: (
|
|
10194
|
+
stateReducer: (state, actionAndChanges) => {
|
|
10133
10195
|
const {
|
|
10134
10196
|
changes,
|
|
10135
10197
|
type
|
|
@@ -10138,19 +10200,25 @@ function AutocompleteInner(props, ref) {
|
|
|
10138
10200
|
case downshift.useCombobox.stateChangeTypes.InputClick:
|
|
10139
10201
|
return {
|
|
10140
10202
|
...changes,
|
|
10141
|
-
isOpen: !(disabled || readOnly)
|
|
10203
|
+
isOpen: !(disabled || readOnly),
|
|
10204
|
+
highlightedIndex: controlledHighlightedIndex
|
|
10142
10205
|
};
|
|
10143
10206
|
case downshift.useCombobox.stateChangeTypes.InputKeyDownEnter:
|
|
10144
10207
|
case downshift.useCombobox.stateChangeTypes.ItemClick:
|
|
10145
|
-
|
|
10208
|
+
{
|
|
10209
|
+
if (changes.selectedItem === AddSymbol) {
|
|
10210
|
+
return {
|
|
10211
|
+
...changes,
|
|
10212
|
+
inputValue: ''
|
|
10213
|
+
};
|
|
10214
|
+
}
|
|
10215
|
+
const idx = getSelectedIndex(changes.selectedItem);
|
|
10216
|
+
setControlledHighlightedIndex(idx >= 0 ? idx : 0);
|
|
10146
10217
|
return {
|
|
10147
10218
|
...changes,
|
|
10148
|
-
|
|
10219
|
+
highlightedIndex: idx >= 0 ? idx : 0
|
|
10149
10220
|
};
|
|
10150
10221
|
}
|
|
10151
|
-
return {
|
|
10152
|
-
...changes
|
|
10153
|
-
};
|
|
10154
10222
|
case downshift.useCombobox.stateChangeTypes.InputBlur:
|
|
10155
10223
|
return {
|
|
10156
10224
|
...changes,
|
|
@@ -10162,13 +10230,19 @@ function AutocompleteInner(props, ref) {
|
|
|
10162
10230
|
...changes
|
|
10163
10231
|
};
|
|
10164
10232
|
case downshift.useCombobox.stateChangeTypes.InputKeyDownArrowDown:
|
|
10165
|
-
case downshift.useCombobox.stateChangeTypes.InputKeyDownHome:
|
|
10166
10233
|
if (readOnly) {
|
|
10167
10234
|
return {
|
|
10168
10235
|
...changes,
|
|
10169
10236
|
isOpen: false
|
|
10170
10237
|
};
|
|
10171
10238
|
}
|
|
10239
|
+
if (state.isOpen === false) {
|
|
10240
|
+
return {
|
|
10241
|
+
...changes,
|
|
10242
|
+
isOpen: true,
|
|
10243
|
+
highlightedIndex: controlledHighlightedIndex
|
|
10244
|
+
};
|
|
10245
|
+
}
|
|
10172
10246
|
return {
|
|
10173
10247
|
...changes,
|
|
10174
10248
|
highlightedIndex: findNextIndex({
|
|
@@ -10178,14 +10252,36 @@ function AutocompleteInner(props, ref) {
|
|
|
10178
10252
|
allDisabled
|
|
10179
10253
|
})
|
|
10180
10254
|
};
|
|
10255
|
+
case downshift.useCombobox.stateChangeTypes.InputKeyDownHome:
|
|
10256
|
+
if (readOnly) {
|
|
10257
|
+
return {
|
|
10258
|
+
...changes,
|
|
10259
|
+
isOpen: false
|
|
10260
|
+
};
|
|
10261
|
+
}
|
|
10262
|
+
return {
|
|
10263
|
+
...changes,
|
|
10264
|
+
highlightedIndex: findNextIndex({
|
|
10265
|
+
index: 0,
|
|
10266
|
+
availableItems,
|
|
10267
|
+
optionDisabled,
|
|
10268
|
+
allDisabled
|
|
10269
|
+
})
|
|
10270
|
+
};
|
|
10181
10271
|
case downshift.useCombobox.stateChangeTypes.InputKeyDownArrowUp:
|
|
10182
|
-
case downshift.useCombobox.stateChangeTypes.InputKeyDownEnd:
|
|
10183
10272
|
if (readOnly) {
|
|
10184
10273
|
return {
|
|
10185
10274
|
...changes,
|
|
10186
10275
|
isOpen: false
|
|
10187
10276
|
};
|
|
10188
10277
|
}
|
|
10278
|
+
if (state.isOpen === false) {
|
|
10279
|
+
return {
|
|
10280
|
+
...changes,
|
|
10281
|
+
isOpen: true,
|
|
10282
|
+
highlightedIndex: controlledHighlightedIndex
|
|
10283
|
+
};
|
|
10284
|
+
}
|
|
10189
10285
|
return {
|
|
10190
10286
|
...changes,
|
|
10191
10287
|
highlightedIndex: findPrevIndex({
|
|
@@ -10195,10 +10291,27 @@ function AutocompleteInner(props, ref) {
|
|
|
10195
10291
|
allDisabled
|
|
10196
10292
|
})
|
|
10197
10293
|
};
|
|
10294
|
+
case downshift.useCombobox.stateChangeTypes.InputKeyDownEnd:
|
|
10295
|
+
if (readOnly) {
|
|
10296
|
+
return {
|
|
10297
|
+
...changes,
|
|
10298
|
+
isOpen: false
|
|
10299
|
+
};
|
|
10300
|
+
}
|
|
10301
|
+
return {
|
|
10302
|
+
...changes,
|
|
10303
|
+
highlightedIndex: findPrevIndex({
|
|
10304
|
+
index: availableItems.length - 1,
|
|
10305
|
+
availableItems,
|
|
10306
|
+
optionDisabled,
|
|
10307
|
+
allDisabled
|
|
10308
|
+
})
|
|
10309
|
+
};
|
|
10198
10310
|
case downshift.useCombobox.stateChangeTypes.ControlledPropUpdatedSelectedItem:
|
|
10199
10311
|
setSelectedItems([changes.selectedItem]);
|
|
10200
10312
|
return {
|
|
10201
|
-
...changes
|
|
10313
|
+
...changes,
|
|
10314
|
+
highlightedIndex: controlledHighlightedIndex
|
|
10202
10315
|
};
|
|
10203
10316
|
default:
|
|
10204
10317
|
return changes;
|
|
@@ -11201,7 +11314,8 @@ const SideBarAccordion = /*#__PURE__*/react.forwardRef(function SideBarAccordion
|
|
|
11201
11314
|
disabled,
|
|
11202
11315
|
...rest
|
|
11203
11316
|
}, ref) {
|
|
11204
|
-
const
|
|
11317
|
+
const generatedAccordionId = react.useId();
|
|
11318
|
+
const accordionId = id ?? generatedAccordionId;
|
|
11205
11319
|
const [menuIsOpen, setMenuIsOpen] = react.useState(false);
|
|
11206
11320
|
const [accordionIsOpen, setAccordionIsOpen] = react.useState(isExpanded);
|
|
11207
11321
|
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
@@ -12020,6 +12134,12 @@ const FieldWrapper = /*#__PURE__*/react.forwardRef(({
|
|
|
12020
12134
|
readonly,
|
|
12021
12135
|
...props
|
|
12022
12136
|
}, ref) => {
|
|
12137
|
+
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
12138
|
+
react.useEffect(() => {
|
|
12139
|
+
if (ref && typeof ref !== 'function' && ref.current) {
|
|
12140
|
+
setAnchorEl(ref.current);
|
|
12141
|
+
}
|
|
12142
|
+
}, [ref]);
|
|
12023
12143
|
react.useEffect(() => {
|
|
12024
12144
|
if (isOpen === false) {
|
|
12025
12145
|
// Focus the first segment in the input field
|
|
@@ -12042,7 +12162,7 @@ const FieldWrapper = /*#__PURE__*/react.forwardRef(({
|
|
|
12042
12162
|
}), /*#__PURE__*/jsxRuntime.jsx(Popover, {
|
|
12043
12163
|
open: isOpen ?? false,
|
|
12044
12164
|
onClose: () => setIsOpen(false),
|
|
12045
|
-
anchorEl:
|
|
12165
|
+
anchorEl: anchorEl,
|
|
12046
12166
|
placement: 'bottom-start',
|
|
12047
12167
|
children: calendar
|
|
12048
12168
|
})]
|
|
@@ -12799,6 +12919,7 @@ exports.TableOfContentsLinkItem = LinkItem;
|
|
|
12799
12919
|
exports.TableRow = Row;
|
|
12800
12920
|
exports.Tabs = Tabs;
|
|
12801
12921
|
exports.TextField = TextField;
|
|
12922
|
+
exports.Textarea = Textarea;
|
|
12802
12923
|
exports.ToggleButton = ToggleButton;
|
|
12803
12924
|
exports.Tooltip = Tooltip$2;
|
|
12804
12925
|
exports.TopBar = TopBar;
|
|
@@ -12808,4 +12929,5 @@ exports.TopbarHeader = Header$2;
|
|
|
12808
12929
|
exports.Typography = Typography;
|
|
12809
12930
|
exports.TypographyNext = TypographyNext;
|
|
12810
12931
|
exports.useEds = useEds;
|
|
12932
|
+
exports.useInputField = useInputField;
|
|
12811
12933
|
exports.useSideBar = useSideBar;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { forwardRef, Children, cloneElement } from 'react';
|
|
1
|
+
import { forwardRef, useId, Children, cloneElement } from 'react';
|
|
2
2
|
import { ThemeProvider } from 'styled-components';
|
|
3
3
|
import { accordion } from './Accordion.tokens.js';
|
|
4
|
-
import {
|
|
4
|
+
import { useToken } from '@equinor/eds-utils';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
7
7
|
|
|
@@ -12,7 +12,8 @@ const Accordion = /*#__PURE__*/forwardRef(function Accordion({
|
|
|
12
12
|
id,
|
|
13
13
|
...props
|
|
14
14
|
}, ref) {
|
|
15
|
-
const
|
|
15
|
+
const generatedAccordionId = useId();
|
|
16
|
+
const accordionId = id ?? generatedAccordionId;
|
|
16
17
|
const {
|
|
17
18
|
density
|
|
18
19
|
} = useEds();
|