Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/design-system-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"@docusaurus/plugin-content-docs": "^3.9.2",
"@docusaurus/preset-classic": "3.9.2",
"@docusaurus/theme-common": "^3.9.2",
"@easyops-cn/docusaurus-search-local": "^0.52.1",
"@easyops-cn/docusaurus-search-local": "^0.54.1",
"@equinor/eds-core-react": "workspace:^",
"@equinor/eds-tokens": "workspace:^",
"@mdx-js/react": "^3.1.1",
"clsx": "^2.1.1",
"prism-react-renderer": "^2.4.1",
"react": "^19.2.0",
"react-dom": "^19.2.0"
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.9.2",
Expand Down
34 changes: 17 additions & 17 deletions apps/eds-color-palette-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@
"@equinor/eds-tailwind": "workspace:^",
"@equinor/eds-tokens": "workspace:^",
"@equinor/eds-utils": "workspace:^",
"colorjs.io": "^0.5.2",
"lucide-react": "^0.546.0",
"next": "16.0.9",
"react": "^19.2.0",
"react-dom": "^19.2.0"
"colorjs.io": "^0.6.1",
"lucide-react": "^0.563.0",
"next": "16.1.6",
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
"@next/eslint-plugin-next": "16.0.7",
"@playwright/test": "^1.57.0",
"@tailwindcss/postcss": "^4.1.16",
"@eslint/eslintrc": "^3.3.3",
"@next/eslint-plugin-next": "16.1.6",
"@playwright/test": "^1.58.2",
"@tailwindcss/postcss": "^4.1.18",
"@types/node": "^25.2.3",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"dotenv": "^17.2.3",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"dotenv": "^17.2.4",
"eslint": "^9.38.0",
"eslint-config-next": "16.0.7",
"tailwindcss": "^4.1.16",
"tsx": "^4.20.6",
"eslint-config-next": "16.1.6",
"tailwindcss": "^4.1.18",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"vite": "^7.1.12",
"vite": "^7.3.1",
"vite-plugin-dts": "^4.5.4",
"vitest": "^4.0.2"
"vitest": "^4.0.18"
}
}
2 changes: 1 addition & 1 deletion apps/eds-color-palette-generator/src/utils/color.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ describe('generateColorScale', () => {
)

scale.forEach((color) => {
expect(color).toMatch(/oklch\([0-9.]+\s+0\.000\s+[0-9.]+\)/)
expect(color).toMatch(/oklch\([0-9.]+\s+0\.?0*\s+[0-9.]+\)/)
})
})
})
Expand Down
24 changes: 12 additions & 12 deletions apps/eds-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@
"@equinor/eds-tokens": "workspace:^",
"@mdx-js/loader": "^3.1.1",
"@mdx-js/react": "^3.1.1",
"@next/mdx": "^16.0.7",
"@next/mdx": "^16.1.6",
"@types/mdx": "^2.0.13",
"github-markdown-css": "^5.8.1",
"next": "16.0.9",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"github-markdown-css": "^5.9.0",
"next": "16.1.6",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"remark-gfm": "^4.0.1"
},
"devDependencies": {
"@playwright/test": "^1.57.0",
"@tailwindcss/postcss": "^4.1.16",
"@playwright/test": "^1.58.2",
"@tailwindcss/postcss": "^4.1.18",
"@types/node": "^25.2.3",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"autoprefixer": "^10.4.21",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"autoprefixer": "^10.4.24",
"eslint": "^9.38.0",
"eslint-config-next": "16.0.7",
"eslint-config-next": "16.1.6",
"postcss": "^8.5.6",
"tailwindcss": "^4.1.16",
"tailwindcss": "^4.1.18",
"typescript": "^5.9.3"
},
"prettier": {
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,29 @@
"types": "pnpm --filter @equinor/eds-tokens types && pnpm --filter @equinor/eds-utils types && pnpm --filter @equinor/eds-icons types && pnpm --filter @equinor/eds-core-react types && pnpm --filter @equinor/eds-lab-react types && pnpm --filter @equinor/eds-data-grid-react types"
},
"devDependencies": {
"@babel/core": "^7.28.5",
"@babel/eslint-parser": "^7.28.5",
"@babel/plugin-transform-runtime": "^7.28.5",
"@babel/preset-env": "^7.28.5",
"@babel/core": "^7.29.0",
"@babel/eslint-parser": "^7.28.6",
"@babel/plugin-transform-runtime": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@babel/runtime": "^7.28.4",
"@babel/runtime": "^7.28.6",
"@types/jest": "^30.0.0",
"@types/jest-axe": "^3.5.9",
"@typescript-eslint/eslint-plugin": "^8.46.2",
"@typescript-eslint/parser": "^8.46.2",
"@typescript-eslint/eslint-plugin": "^8.55.0",
"@typescript-eslint/parser": "^8.55.0",
"babel-plugin-styled-components": "^2.1.4",
"eslint": "^8.57.1",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-testing-library": "^7.13.3",
"eslint-plugin-testing-library": "^7.15.4",
"jest-axe": "^10.0.0",
"prettier": "3.6.2",
"prettier": "3.8.1",
"typescript": "^5.9.3"
},
"browserslist": "last 2 Chrome versions, last 2 firefox versions, last 2 safari versions, last 2 edge versions, not dead",
Expand Down
44 changes: 22 additions & 22 deletions packages/eds-core-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"react"
],
"devDependencies": {
"@figma/code-connect": "^1.3.12",
"@playwright/test": "^1.57.0",
"@figma/code-connect": "^1.3.13",
"@playwright/test": "^1.58.2",
"@rollup/plugin-babel": "^6.1.0",
"@rollup/plugin-commonjs": "^28.0.8",
"@rollup/plugin-node-resolve": "^16.0.3",
Expand All @@ -64,14 +64,14 @@
"@storybook/react-vite": "^9.1.13",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "16.3.0",
"@testing-library/react": "16.3.2",
"@testing-library/user-event": "14.6.1",
"@types/jest": "^30.0.0",
"@types/mdx": "^2.0.13",
"@types/node": "^25.2.3",
"@types/ramda": "^0.31.1",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"babel-plugin-styled-components": "^2.1.4",
"eslint-plugin-storybook": "10.2.8",
"jest": "^30.2.0",
Expand All @@ -81,16 +81,16 @@
"postcss": "^8.5.6",
"postcss-import": "^16.1.1",
"ramda": "^0.32.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-hook-form": "^7.65.0",
"react-router-dom": "^7.9.4",
"rollup": "^4.52.5",
"rollup-plugin-delete": "^3.0.1",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-hook-form": "^7.71.1",
"react-router-dom": "^7.13.0",
"rollup": "^4.57.1",
"rollup-plugin-delete": "^3.0.2",
"rollup-plugin-postcss": "^4.0.2",
"rollup-preserve-directives": "^1.1.3",
"storybook": "^9.1.13",
"styled-components": "6.1.19",
"styled-components": "6.3.9",
"tsc-watch": "^7.2.0",
"typescript": "^5.9.3"
},
Expand All @@ -100,18 +100,18 @@
"styled-components": "^6"
},
"dependencies": {
"@babel/runtime": "^7.28.4",
"@babel/runtime": "^7.28.6",
"@equinor/eds-icons": "workspace:^",
"@equinor/eds-tokens": "workspace:^",
"@equinor/eds-utils": "workspace:^",
"@floating-ui/react": "^0.27.16",
"@internationalized/date": "^3.10.0",
"@react-aria/utils": "^3.31.0",
"@react-stately/calendar": "^3.9.0",
"@react-stately/datepicker": "^3.15.2",
"@react-types/shared": "^3.32.1",
"@tanstack/react-virtual": "3.13.12",
"downshift": "9.0.10",
"react-aria": "^3.44.0"
"@floating-ui/react": "^0.27.17",
"@internationalized/date": "^3.11.0",
"@react-aria/utils": "^3.33.0",
"@react-stately/calendar": "^3.9.2",
"@react-stately/datepicker": "^3.16.0",
"@react-types/shared": "^3.33.0",
"@tanstack/react-virtual": "3.13.18",
"downshift": "9.3.0",
"react-aria": "^3.46.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function AddNewOption({ index, item }: AutocompleteOptionProps) {
ref: rowVirtualizer.measureElement,
}),
item,
index: index,
index,
})
return (
<StyledListItem
Expand Down
37 changes: 24 additions & 13 deletions packages/eds-core-react/src/components/Autocomplete/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,30 @@ export function Option({
const highlighted =
highlightedIndex === index && !isDisabled ? 'true' : 'false'

const itemProps = getItemProps({
...(multiline && {
ref: rowVirtualizer.measureElement,
}),
item,
index,
style: {
transform: `translateY(${virtualItem.start}px)`,
...(!multiline && {
height: `${virtualItem.size}px`,
}),
},
})
// Guard: downshift 9.x validates that item exists in the items array
const itemProps =
item !== undefined
? getItemProps({
...(multiline && {
ref: rowVirtualizer.measureElement,
}),
item,
index,
style: {
transform: `translateY(${virtualItem.start}px)`,
...(!multiline && {
height: `${virtualItem.size}px`,
}),
},
})
: {
style: {
transform: `translateY(${virtualItem.start}px)`,
...(!multiline && {
height: `${virtualItem.size}px`,
}),
},
}
return (
<StyledListItem
$isdisabled={isDisabled ? 'true' : 'false'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function SelectAllOption({ item, index, ref }: AutocompleteOptionProps) {
ref: rowVirtualizer.measureElement,
}),
item,
index: index,
index,
})

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Autocomplete Matches snapshot 1`] = `"<div class="Autocomplete__Container-sc-yvif0e-0 ccfbvl"><label id="downshift-test-id" for="downshift-test-id" class="Label__LabelBase-sc-1gi2bcn-0 dTVIwR"><span class="Label__Text-sc-1gi2bcn-1 fVvDte">Select label test</span></label><div class="Autocomplete__Container-sc-yvif0e-0 ccfbvl"><div class="Input__Container-sc-1ykv024-0 iitNWd"><input style="resize: none;" aria-activedescendant="downshift-test-id-item-0" aria-autocomplete="list" aria-controls="downshift-test-controls" aria-expanded="true" aria-labelledby="downshift-test-label-id" autocomplete="off" id="downshift-test-id" role="combobox" class="Input__StyledInput-sc-1ykv024-1 dGAzVC" type="text" value=""><div class="Input__Adornments-sc-1ykv024-2 Input__RightAdornments-sc-1ykv024-4 fkEjwr bNHKTP"><button type="button" tabindex="-1" aria-controls="downshift-test-controls" aria-expanded="true" id="downshift-test-id" aria-label="toggle options" title="open" class="Button__ButtonBase-sc-1hs0myn-1 hBwAOj Autocomplete__StyledButton-sc-yvif0e-2 gVfqPg"><span class="Button__Inner-sc-1hs0myn-0 iqdiwb"><svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" class="Icon__StyledSvg-sc-6evbi1-0 lbBamK"><path data-testid="eds-icon-path" d="m7 14.5 5-5 5 5z" fill-rule="evenodd" clip-rule="evenodd" class="Icon__StyledPath-sc-6evbi1-1"></path></svg></span></button></div></div></div><div popover="manual" tabindex="-1" data-floating-ui-focusable="" style="position: absolute; top: -4px; left: 0px; width: auto;" class="OptionList__StyledPopover-sc-t6tp7k-0 losWRn"><ul id="downshift-test-id" role="listbox" aria-labelledby="downshift-test-label-id" style="max-height: 300px;" class="List__StyledList-sc-v9d2hy-0 wiNjg OptionList__StyledList-sc-t6tp7k-1 lbBbIY"><li role="presentation" style="height: 144px; margin: 0px; grid-area: 1 / -1;"></li><li aria-hidden="false" aria-setsize="3" data-index="0" aria-posinset="1" aria-disabled="false" aria-selected="true" id="downshift-test-id" role="option" style="transform: translateY(0px); height: 48px;" class="Option__StyledListItem-sc-1ly11zu-0 gxijQd"><span class="Option__AutocompleteOptionLabel-sc-1ly11zu-1 cNKcWo">One</span></li><li aria-hidden="false" aria-setsize="3" data-index="1" aria-posinset="2" aria-disabled="false" aria-selected="false" id="downshift-test-id" role="option" style="transform: translateY(48px); height: 48px;" class="Option__StyledListItem-sc-1ly11zu-0 imWtlZ"><span class="Option__AutocompleteOptionLabel-sc-1ly11zu-1 cNKcWo">Two</span></li><li aria-hidden="false" aria-setsize="3" data-index="2" aria-posinset="3" aria-disabled="false" aria-selected="false" id="downshift-test-id" role="option" style="transform: translateY(96px); height: 48px;" class="Option__StyledListItem-sc-1ly11zu-0 imWtlZ"><span class="Option__AutocompleteOptionLabel-sc-1ly11zu-1 cNKcWo">Three</span></li></ul></div></div>"`;
exports[`Autocomplete Matches snapshot 1`] = `"<div class="Autocomplete__Container-sc-yvif0e-0 hXBcaS"><label id="downshift-test-id" for="downshift-test-id" class="Label__LabelBase-sc-1gi2bcn-0 leQLyG"><span class="Label__Text-sc-1gi2bcn-1 kkPsUR">Select label test</span></label><div class="Autocomplete__Container-sc-yvif0e-0 hXBcaS"><div class="Input__Container-sc-1ykv024-0 ejtZhe"><input style="resize: none;" aria-activedescendant="downshift-test-id-item-0" aria-autocomplete="list" aria-controls="downshift-test-controls" aria-expanded="true" aria-labelledby="downshift-test-label-id" autocomplete="off" id="downshift-test-id" role="combobox" class="Input__StyledInput-sc-1ykv024-1 kSKvBF" type="text" value=""><div class="Input__Adornments-sc-1ykv024-2 Input__RightAdornments-sc-1ykv024-4 gJZMvM jLuuyE"><button type="button" tabindex="-1" aria-controls="downshift-test-controls" aria-expanded="true" id="downshift-test-id" aria-label="toggle options" title="open" class="Button__ButtonBase-sc-1hs0myn-1 ehrVWk Autocomplete__StyledButton-sc-yvif0e-2 iKjvKj"><span class="Button__Inner-sc-1hs0myn-0 bsNTss"><svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" class="Icon__StyledSvg-sc-6evbi1-0 kTpWxB"><path data-testid="eds-icon-path" d="m7 14.5 5-5 5 5z" fill-rule="evenodd" clip-rule="evenodd" class="Icon__StyledPath-sc-6evbi1-1"></path></svg></span></button></div></div></div><div popover="manual" tabindex="-1" data-floating-ui-focusable="" style="position: absolute; top: -4px; left: 0px; width: auto;" class="OptionList__StyledPopover-sc-t6tp7k-0 hruqVU"><ul id="downshift-test-id" role="listbox" aria-labelledby="downshift-test-label-id" style="max-height: 300px;" class="List__StyledList-sc-v9d2hy-0 bdrlRT OptionList__StyledList-sc-t6tp7k-1 dtCUgH"><li role="presentation" style="height: 144px; margin: 0px; grid-area: 1 / -1;"></li><li aria-hidden="false" aria-setsize="3" data-index="0" aria-posinset="1" aria-disabled="false" aria-selected="true" id="downshift-test-id" role="option" style="transform: translateY(0px); height: 48px;" class="Option__StyledListItem-sc-1ly11zu-0 fxvzTu"><span class="Option__AutocompleteOptionLabel-sc-1ly11zu-1 cXGLin">One</span></li><li aria-hidden="false" aria-setsize="3" data-index="1" aria-posinset="2" aria-disabled="false" aria-selected="false" id="downshift-test-id" role="option" style="transform: translateY(48px); height: 48px;" class="Option__StyledListItem-sc-1ly11zu-0 hUKzoe"><span class="Option__AutocompleteOptionLabel-sc-1ly11zu-1 cXGLin">Two</span></li><li aria-hidden="false" aria-setsize="3" data-index="2" aria-posinset="3" aria-disabled="false" aria-selected="false" id="downshift-test-id" role="option" style="transform: translateY(96px); height: 48px;" class="Option__StyledListItem-sc-1ly11zu-0 hUKzoe"><span class="Option__AutocompleteOptionLabel-sc-1ly11zu-1 cXGLin">Three</span></li></ul></div></div>"`;
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
useImperativeHandle,
useEffect,
} from 'react'
import type { DOMAttributes } from 'react'
import { useEds } from '../EdsProvider'
import {
defaultOptionDisabled,
Expand Down Expand Up @@ -172,9 +173,17 @@ export const useAutocomplete = <T>({
...multipleSelectionProps,
onSelectedItemsChange: (changes) => {
if (onOptionsChange) {
let selectedItems = changes.selectedItems.filter(
(item) => item !== AllSymbol || item !== AddSymbol,
)
// AddSymbol/AllSymbol are handled manually in onStateChange,
// so skip propagating when they appear in selectedItems
// (downshift 9.x propagates selectedItem to useMultipleSelection)
if (
changes.selectedItems.some(
(item) => item === AllSymbol || item === AddSymbol,
)
) {
return
}
let selectedItems = changes.selectedItems
if (itemCompare) {
selectedItems = inputOptions.filter((item) =>
selectedItems.some((compare) => itemCompare(item, compare)),
Expand Down Expand Up @@ -353,6 +362,9 @@ export const useAutocomplete = <T>({
toggleAllSelected()
} else if (selectedItem === AddSymbol && typedInputValue.trim()) {
onAddNewOption?.(typedInputValue)
if (clearSearchOnChange) {
setTypedInputValue('')
}
} else if (multiple) {
const shouldRemove = itemCompare
? selectedItems.some((i) => itemCompare(selectedItem, i))
Expand Down Expand Up @@ -583,7 +595,9 @@ export const useAutocomplete = <T>({
}
case useCombobox.stateChangeTypes.InputKeyDownEnter:
case useCombobox.stateChangeTypes.ItemClick:
if (clearSearchOnChange) {
// Don't clear typedInputValue for AddSymbol — onStateChange needs
// it to call onAddNewOption (downshift 9.x runs onStateChange after re-render)
if (clearSearchOnChange && changes.selectedItem !== AddSymbol) {
setTypedInputValue('')
}
return {
Expand Down Expand Up @@ -635,7 +649,10 @@ export const useAutocomplete = <T>({
}),
)

const consolidatedEvents = mergeEventsFromRight(other, inputProps)
const consolidatedEvents = mergeEventsFromRight(
other,
inputProps as unknown as DOMAttributes<unknown>,
)

const selectedItemsLabels = useMemo(
() => selectedItems.map(getLabel),
Expand Down
4 changes: 2 additions & 2 deletions packages/eds-core-react/src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ export const Chip = forwardRef<HTMLDivElement, ChipProps>(function Chip(

const resizedChildren = ReactChildren.map(
children,
(child: React.ReactElement<Record<string, unknown>>) => {
(child: React.ReactElement<Record<string, unknown>> | null) => {
// We force size on Icon & Avatar component
if (child.props) {
if (child?.props) {
return cloneElement(child, {
size: 16,
disabled,
Expand Down
Loading
Loading