From d17812156d98503bbf57ab6257d4c17744633be5 Mon Sep 17 00:00:00 2001 From: Gravity UI Bot <111915794+gravity-ui-bot@users.noreply.github.com> Date: Tue, 2 Jul 2024 13:51:17 +0300 Subject: [PATCH 1/4] chore(main): release 6.20.1 (#1683) Co-authored-by: Mr.Dr.Professor Patrick --- CHANGELOG.md | 8 ++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 542f0bec0b..225fb9de03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [6.20.1](https://github.com/gravity-ui/uikit/compare/v6.20.0...v6.20.1) (2024-07-01) + + +### Bug Fixes + +* **Dialog:** move QA props to DialogOwnProps ([#1691](https://github.com/gravity-ui/uikit/issues/1691)) ([fc33ba7](https://github.com/gravity-ui/uikit/commit/fc33ba716559db6bfe532b64684f439e930daa89)) +* **Text:** style property ([#1681](https://github.com/gravity-ui/uikit/issues/1681)) ([89048e4](https://github.com/gravity-ui/uikit/commit/89048e45e6f2d3512c5a70ed75ece530885e72da)) + ## [6.20.0](https://github.com/gravity-ui/uikit/compare/v6.19.0...v6.20.0) (2024-06-26) diff --git a/package-lock.json b/package-lock.json index c9a50cdebf..b31f868100 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gravity-ui/uikit", - "version": "6.20.0", + "version": "6.20.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gravity-ui/uikit", - "version": "6.20.0", + "version": "6.20.1", "license": "MIT", "dependencies": { "@bem-react/classname": "^1.6.0", diff --git a/package.json b/package.json index fad7b952c1..90859c437f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gravity-ui/uikit", - "version": "6.20.0", + "version": "6.20.1", "description": "Gravity UI base styling and components", "keywords": [ "component", From 4a087e17f11902aa9607f485948d8bf000232f43 Mon Sep 17 00:00:00 2001 From: Valerii Sidorenko Date: Tue, 2 Jul 2024 13:14:01 +0200 Subject: [PATCH 2/4] docs(Select): add filter prop (#1689) --- src/components/Select/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Select/README.md b/src/components/Select/README.md index d60f3ed295..cd5031273b 100644 --- a/src/components/Select/README.md +++ b/src/components/Select/README.md @@ -1136,6 +1136,7 @@ LANDING_BLOCK--> | [multiple](#selecting-multiple-options) | Indicates that multiple options can be selected in the list | `boolean` | `false` | | name | Name of the control | `string` | | | onBlur | Handler that is called when the element loses focus. | `function` | | +| filter | Controlled filter value | `string` | `''` | | onFilterChange | Fires every time after changing filter | `function` | | | onFocus | Handler that is called when the element receives focus. | `function` | | | onLoadMore | Fires when loading indicator gets visible. | `function` | | From a178dffefb2d1cfa481417a2dea6297034ae22a0 Mon Sep 17 00:00:00 2001 From: Valerii Sidorenko Date: Tue, 2 Jul 2024 13:14:14 +0200 Subject: [PATCH 3/4] feat(useResizeObserver): support box option (#1687) --- src/hooks/useResizeObserver/useResizeObserver.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hooks/useResizeObserver/useResizeObserver.ts b/src/hooks/useResizeObserver/useResizeObserver.ts index c95193d741..3c247768c4 100644 --- a/src/hooks/useResizeObserver/useResizeObserver.ts +++ b/src/hooks/useResizeObserver/useResizeObserver.ts @@ -3,9 +3,14 @@ import React from 'react'; interface UseResizeObserverProps { ref: React.RefObject | undefined; onResize: () => void; + box?: ResizeObserverBoxOptions; } -export function useResizeObserver({ref, onResize}: UseResizeObserverProps) { +export function useResizeObserver({ + ref, + onResize, + box, +}: UseResizeObserverProps) { React.useEffect(() => { const element = ref?.current; if (!element) { @@ -26,9 +31,9 @@ export function useResizeObserver({ref, onResize}: UseResizeO onResize(); }); - observer.observe(element); + observer.observe(element, {box}); return () => { observer.disconnect(); }; - }, [ref, onResize]); + }, [ref, onResize, box]); } From 8bff8821b4e8bb20e1bedb01c07a3ba8f22dfe16 Mon Sep 17 00:00:00 2001 From: Valerii Sidorenko Date: Tue, 2 Jul 2024 13:14:38 +0200 Subject: [PATCH 4/4] feat(useControlledState): support update callback with additional params (#1688) --- .../useControlledState/useControlledState.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hooks/useControlledState/useControlledState.ts b/src/hooks/useControlledState/useControlledState.ts index 60a8555b7a..67fbdb8283 100644 --- a/src/hooks/useControlledState/useControlledState.ts +++ b/src/hooks/useControlledState/useControlledState.ts @@ -1,19 +1,19 @@ import React from 'react'; -export function useControlledState( +export function useControlledState( value: Exclude, defaultValue: Exclude | undefined, - onChange?: (v: C, ...args: any[]) => void, -): [T, (value: C) => void]; -export function useControlledState( + onChange?: (v: C, ...args: Args) => void, +): [T, (value: C, ...args: Args) => void]; +export function useControlledState( value: Exclude | undefined, defaultValue: Exclude, - onChange?: (v: C, ...args: any[]) => void, -): [T, (value: C) => void]; -export function useControlledState( + onChange?: (v: C, ...args: Args) => void, +): [T, (value: C, ...args: Args) => void]; +export function useControlledState( value: T, defaultValue: T, - onUpdate?: (value: C, ...args: any[]) => void, + onUpdate?: (value: C, ...args: Args) => void, ) { const [innerValue, setInnerValue] = React.useState(value ?? defaultValue); @@ -37,7 +37,7 @@ export function useControlledState( // that we call `onUpdate` inside the callback function and onUpdate // in a controlling component frequently calls setState itself, // therefore we call `setState` while we're rendering a different component. - (newValue: C, ...args: any[]) => { + (newValue: C, ...args: Args) => { if (!Object.is(currentValue, newValue)) { onUpdate?.(newValue, ...args); }