Skip to content

Commit 8af1058

Browse files
beatrice94Beatrice Parfaitjkaho
authored
fix: upgrade downshift and remove breaking changes (#858)
* fix: update downshift and remove breaking changes * added changeset * fix: update MenuKeyDown calls * Update package.json Co-authored-by: Jessica <[email protected]> * Update packages/components/package.json Co-authored-by: Jessica <[email protected]> * fix: remove yalc from package files * updated yarn lock file * fix: adjusted padding and text size for combobox * Update packages/components/src/Combobox/styles.ts Co-authored-by: Jessica <[email protected]> * fix: update changeset * Delete healthy-books-own.md Co-authored-by: Beatrice Parfait <[email protected]> Co-authored-by: Jessica <[email protected]>
1 parent 46debd6 commit 8af1058

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

.changeset/fuzzy-rice-switch.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sajari/react-components': minor
3+
---
4+
5+
Upgrade Downshift to v7.0.1 and changes to default Combobox styling

packages/components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"body-scroll-lock": "^3.1.5",
4242
"classnames": "^2.2.6",
4343
"color": "^3.1.3",
44-
"downshift": "^6.1.0",
44+
"downshift": "7.0.1",
4545
"react-focus-lock": "^2.5.0",
4646
"react-ranger": "^2.1.0",
4747
"smoothscroll-polyfill": "^0.4.4",

packages/components/src/Combobox/index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ const Combobox = React.forwardRef(function ComboboxInner<T>(
7979
getMenuProps,
8080
getItemProps,
8181
getInputProps,
82-
getComboboxProps,
8382
selectedItem,
8483
highlightedIndex,
8584
inputValue,
@@ -383,7 +382,7 @@ const Combobox = React.forwardRef(function ComboboxInner<T>(
383382
renderInAttachMode()
384383
) : (
385384
<Box css={[styles.container, stylesProp]} className={className}>
386-
<Box css={styles.inputContainer} {...getComboboxProps()}>
385+
<Box css={styles.inputContainer}>
387386
<Box as="label" css={tw`sr-only`} {...getLabelProps({ htmlFor: id })}>
388387
{label ?? placeholder}
389388
</Box>

packages/components/src/Combobox/styles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function getInputSpacingStyles(size?: ComboboxSize) {
2727

2828
case 'md':
2929
default:
30-
return tw`pl-9`;
30+
return tw`pl-9 text-base`;
3131
}
3232
}
3333

packages/components/src/Select/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const Select = React.forwardRef((props: SelectProps, ref?: React.Ref<HTMLDivElem
4343
const { changes, type } = actionAndChanges;
4444

4545
switch (type) {
46-
case useSelect.stateChangeTypes.MenuKeyDownEnter:
47-
case useSelect.stateChangeTypes.MenuKeyDownSpaceButton:
46+
case useSelect.stateChangeTypes.ToggleButtonKeyDownEnter:
47+
case useSelect.stateChangeTypes.ToggleButtonKeyDownSpaceButton:
4848
case useSelect.stateChangeTypes.ItemClick:
4949
return {
5050
...changes,

yarn.lock

+9-15
Original file line numberDiff line numberDiff line change
@@ -5241,7 +5241,7 @@ __metadata:
52415241
body-scroll-lock: ^3.1.5
52425242
classnames: ^2.2.6
52435243
color: ^3.1.3
5244-
downshift: ^6.1.0
5244+
downshift: 7.0.1
52455245
jest: ^26.6.3
52465246
react-focus-lock: ^2.5.0
52475247
react-ranger: ^2.1.0
@@ -8441,13 +8441,6 @@ __metadata:
84418441
languageName: node
84428442
linkType: hard
84438443

8444-
"compute-scroll-into-view@npm:^1.0.16":
8445-
version: 1.0.16
8446-
resolution: "compute-scroll-into-view@npm:1.0.16"
8447-
checksum: 4334db6397e52911397922d3778c56513eca97c26f669a7d35e38739aadb3340d04133f26cb5830df25dab0687c9ce934953f3e9b27556042b1af99fb15b7c7a
8448-
languageName: node
8449-
linkType: hard
8450-
84518444
"compute-scroll-into-view@npm:^1.0.17":
84528445
version: 1.0.17
84538446
resolution: "compute-scroll-into-view@npm:1.0.17"
@@ -9289,17 +9282,18 @@ __metadata:
92899282
languageName: node
92909283
linkType: hard
92919284

9292-
"downshift@npm:^6.1.0":
9293-
version: 6.1.0
9294-
resolution: "downshift@npm:6.1.0"
9285+
"downshift@npm:7.0.1":
9286+
version: 7.0.1
9287+
resolution: "downshift@npm:7.0.1"
92959288
dependencies:
9296-
"@babel/runtime": ^7.12.5
9297-
compute-scroll-into-view: ^1.0.16
9289+
"@babel/runtime": ^7.14.8
9290+
compute-scroll-into-view: ^1.0.17
92989291
prop-types: ^15.7.2
9299-
react-is: ^17.0.1
9292+
react-is: ^17.0.2
9293+
tslib: ^2.3.0
93009294
peerDependencies:
93019295
react: ">=16.12.0"
9302-
checksum: c07fc6d9d9115eb92d1cabae51b3c6abff28054ab9e434af4f062e6c9ffb8d942d5770094e05f3eea3f122b4444e7a9e0f5cb4e621f747f706a4fc3548b70282
9296+
checksum: f2dc82171ee64777e82ad86ab8e08f1015bef289ab26799337f43a8465bd55f6b484cad4ab40030b57891e99ed3a7d41b27dd560a0929635133c41cee802bc32
93039297
languageName: node
93049298
linkType: hard
93059299

0 commit comments

Comments
 (0)