Skip to content

Commit

Permalink
Merge branch 'main' into select/UXRFC-453_to-major
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeraS authored Nov 26, 2024
2 parents 0d03ba4 + 704f53b commit 0d4c06f
Show file tree
Hide file tree
Showing 585 changed files with 5,077 additions and 311 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"import/no-extraneous-dependencies": "off",
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/consistent-type-imports": ["error", {"prefer": "type-imports", "fixStyle": "separate-type-imports"}]
"@typescript-eslint/consistent-type-imports": ["error", {"prefer": "type-imports", "fixStyle": "separate-type-imports"}],
"complexity": "off"
},
"overrides": [
{
Expand Down
87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,92 @@
# Changelog

## [6.36.0](https://github.com/gravity-ui/uikit/compare/v6.35.2...v6.36.0) (2024-11-25)


### Features

* **PasswordInput:** add component ([#1745](https://github.com/gravity-ui/uikit/issues/1745)) ([2e7f2c7](https://github.com/gravity-ui/uikit/commit/2e7f2c731c8cb2fd08993fc30ffed8b06a5f0ea2))


### Bug Fixes

* **Select:** do not reserve space for clear if empty ([#1956](https://github.com/gravity-ui/uikit/issues/1956)) ([11dd537](https://github.com/gravity-ui/uikit/commit/11dd537feaa230133f8051fd6c370e6e3ec7d54f))
* **Toc:** correctly display content of no items.length and add event forward ([#1939](https://github.com/gravity-ui/uikit/issues/1939)) ([8d456c3](https://github.com/gravity-ui/uikit/commit/8d456c3d77d63674f20ebac82913d8a26c14f997))

## [6.35.2](https://github.com/gravity-ui/uikit/compare/v6.35.1...v6.35.2) (2024-11-14)


### Bug Fixes

* **PlaceholderContainer:** remove href attribute fallback in actions ([#1947](https://github.com/gravity-ui/uikit/issues/1947)) ([60a8b92](https://github.com/gravity-ui/uikit/commit/60a8b9240b51d78f0aa5e711a6bed8e30e049814))
* **useBodyScrollLock:** correctly restore styles ([#1950](https://github.com/gravity-ui/uikit/issues/1950)) ([b41a53a](https://github.com/gravity-ui/uikit/commit/b41a53a477d479b925331bbc227862942da04d00))

## [6.35.1](https://github.com/gravity-ui/uikit/compare/v6.35.0...v6.35.1) (2024-11-13)


### Bug Fixes

* fix incorrect scss "use" ([#1943](https://github.com/gravity-ui/uikit/issues/1943)) ([c9506dd](https://github.com/gravity-ui/uikit/commit/c9506dd5cfb78f155ea4e38f09e060233c4f691b))

## [6.35.0](https://github.com/gravity-ui/uikit/compare/v6.34.0...v6.35.0) (2024-11-11)


### Features

* **FilePreview:** add component ([#1880](https://github.com/gravity-ui/uikit/issues/1880)) ([b5de671](https://github.com/gravity-ui/uikit/commit/b5de67126a76467853957df6d8e5436cc460886e))
* **NumberInput:** add new component ([#1826](https://github.com/gravity-ui/uikit/issues/1826)) ([75be05e](https://github.com/gravity-ui/uikit/commit/75be05e42c95226592cdd2139894e9ff791280af))
* **PlaceholderContainer:** add qa prop ([#1925](https://github.com/gravity-ui/uikit/issues/1925)) ([77ad28d](https://github.com/gravity-ui/uikit/commit/77ad28d8aa0af910999e0ed54fce806767241946))


### Bug Fixes

* **PlaceholderContainer:** add component to index file ([#1924](https://github.com/gravity-ui/uikit/issues/1924)) ([cdce171](https://github.com/gravity-ui/uikit/commit/cdce1715a6fe5ceebff7b43c9146c3c1bef9f093))
* **Popover:** use visible title for popup a11y label ([#1941](https://github.com/gravity-ui/uikit/issues/1941)) ([f9d75e8](https://github.com/gravity-ui/uikit/commit/f9d75e8b1d902fd526b4a089d7bf6675299f2584))
* **Toaster:** reveal animation lag ([#1927](https://github.com/gravity-ui/uikit/issues/1927)) ([e16fa1c](https://github.com/gravity-ui/uikit/commit/e16fa1ccc7e1f053f4ff696d24ee6d4bbfd35a6a))

## [6.34.0](https://github.com/gravity-ui/uikit/compare/v6.33.0...v6.34.0) (2024-10-25)


### Features

* **ListItemExandIcon:** added new list component for expanded icon view ([#1762](https://github.com/gravity-ui/uikit/issues/1762)) ([b6516f4](https://github.com/gravity-ui/uikit/commit/b6516f46ce157a1297a5887e25487f621da07b43))


### Bug Fixes

* react 19 compatibility ([#1916](https://github.com/gravity-ui/uikit/issues/1916)) ([29f2558](https://github.com/gravity-ui/uikit/commit/29f255803582d9b6791f11b080b80d36626dd03b))
* **styles:** rules order in block ([#1912](https://github.com/gravity-ui/uikit/issues/1912)) ([2d9c88e](https://github.com/gravity-ui/uikit/commit/2d9c88ee6a7040d33369c1a47d2022ec9f129d7c))

## [6.33.0](https://github.com/gravity-ui/uikit/compare/v6.32.0...v6.33.0) (2024-10-22)


### Features

* **Dialog:** add className property to DialogFooter ([#1909](https://github.com/gravity-ui/uikit/issues/1909)) ([679c537](https://github.com/gravity-ui/uikit/commit/679c537a0a34add7e6dca4a3ba649934a68342e6))
* **Table:** add width property ([#1907](https://github.com/gravity-ui/uikit/issues/1907)) ([7eb5e1e](https://github.com/gravity-ui/uikit/commit/7eb5e1e38cb9e79afaf988480b1b2d5dc998ff04))
* **Toaster:** added onClose callback ([#1902](https://github.com/gravity-ui/uikit/issues/1902)) ([3069194](https://github.com/gravity-ui/uikit/commit/30691949ccce25e54614b5a0b49c7b11f7abf3e9))


### Bug Fixes

* **DefinitionList:** layout fixes ([#1910](https://github.com/gravity-ui/uikit/issues/1910)) ([e5cde3a](https://github.com/gravity-ui/uikit/commit/e5cde3ad58cfb1d8436c2a4ad75e074dfb94a741))

## [6.32.0](https://github.com/gravity-ui/uikit/compare/v6.31.0...v6.32.0) (2024-10-17)


### Features

* add DefinitionList and HelpMark ([#1731](https://github.com/gravity-ui/uikit/issues/1731)) ([c587116](https://github.com/gravity-ui/uikit/commit/c587116b40e79c1ad7a2427f73d031b6efa4109c))
* **AvatarStack:** forward ref to root element of component ([#1904](https://github.com/gravity-ui/uikit/issues/1904)) ([469d935](https://github.com/gravity-ui/uikit/commit/469d93586d6bb82b93a865541d8a974caa67d3b1))


### Bug Fixes

* **ListItemView:** fix type ListItemViewProps ([#1897](https://github.com/gravity-ui/uikit/issues/1897)) ([e49779a](https://github.com/gravity-ui/uikit/commit/e49779a4e519a6e89db3cecfe12ea66e0c720d3f))
* **Toaster:** change spacing before actions ([#1891](https://github.com/gravity-ui/uikit/issues/1891)) ([235ea21](https://github.com/gravity-ui/uikit/commit/235ea21a548d39b6ebf22e31d9037abc83eb9fcd))
* **types:** fix i18n types ([#1898](https://github.com/gravity-ui/uikit/issues/1898)) ([21954db](https://github.com/gravity-ui/uikit/commit/21954db04c9edc5d5068007fd4f137e0732e2b47))
* **useBodyScrollLock:** avoid settings unrelated styles ([#1832](https://github.com/gravity-ui/uikit/issues/1832)) ([9d7fd36](https://github.com/gravity-ui/uikit/commit/9d7fd3649c7c82a1c3d68af7d2f8ceffe7172eef))

## [6.31.0](https://github.com/gravity-ui/uikit/compare/v6.30.1...v6.31.0) (2024-10-09)


Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
/src/components/ClipboardIcon @Raubzeug
/src/components/ControlLabel @korvin89
/src/components/CopyToClipboard @SeqviriouM
/src/components/DefinitionList @Raubzeug
#/src/components/Dialog
/src/components/Disclosure @Raubzeug
/src/components/Divider @v4dyar4
/src/components/DropdownMenu @axtk
/src/components/HelpMark @Raubzeug
/src/components/Hotkey @d3m1d0v
/src/components/Icon @amje
/src/components/Label @goshander
Expand Down Expand Up @@ -68,5 +70,6 @@
/src/hooks/useUniqId @ValeraS

# Allow everyone to update dependencies

/package.json
/package-lock.json
14 changes: 12 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,23 @@ task('copy-i18n', () => {

task('styles-global', () => {
return src(['styles/styles.scss', 'styles/fonts.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(
sass().on('error', function (error) {
sass.logError.call(this, error);
process.exit(1);
}),
)
.pipe(dest('styles'));
});

task('styles-components', () => {
return src(['src/components/**/*.scss', '!src/components/**/__stories__/**/*'])
.pipe(sass().on('error', sass.logError))
.pipe(
sass().on('error', function (error) {
sass.logError.call(this, error);
process.exit(1);
}),
)
.pipe(dest(path.resolve(BUILD_DIR, 'esm', 'components')))
.pipe(dest(path.resolve(BUILD_DIR, 'cjs', 'components')));
});
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gravity-ui/uikit",
"version": "6.31.0",
"version": "6.36.0",
"description": "Gravity UI base styling and components",
"keywords": [
"component",
Expand Down Expand Up @@ -71,7 +71,7 @@
"./build/esm/toaster-singleton-react-18.d.ts"
],
"i18n": [
"./build/esm/components/utils/addComponentKeysets.d.ts"
"./build/esm/i18n/index.d.ts"
],
"unstable": [
"./build/esm/unstable.d.ts"
Expand Down Expand Up @@ -204,8 +204,8 @@
"typescript": "^5.3.3"
},
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"nano-staged": {
"*.{scss}": [
Expand Down
31 changes: 21 additions & 10 deletions playwright/core/expectScreenshotFixture.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import {expect} from '@playwright/experimental-ct-react';

import type {ExpectScreenshotFixture, PlaywrightFixture} from './types';
import type {CaptureScreenshotParams, ExpectScreenshotFixture, PlaywrightFixture} from './types';

const defaultParams: CaptureScreenshotParams = {
themes: ['light', 'dark'],
};

export const expectScreenshotFixture: PlaywrightFixture<ExpectScreenshotFixture> = async (
{page},
Expand All @@ -10,8 +14,9 @@ export const expectScreenshotFixture: PlaywrightFixture<ExpectScreenshotFixture>
const expectScreenshot: ExpectScreenshotFixture = async ({
component,
nameSuffix,
themes: paramsThemes,
...pageScreenshotOptions
} = {}) => {
} = defaultParams) => {
const captureScreenshot = async () => {
return (component || page.locator('.playwright-wrapper-test')).screenshot({
animations: 'disabled',
Expand All @@ -22,17 +27,23 @@ export const expectScreenshotFixture: PlaywrightFixture<ExpectScreenshotFixture>
const nameScreenshot =
testInfo.titlePath.slice(1).join(' ') + (nameSuffix ? ` ${nameSuffix}` : '');

await page.emulateMedia({colorScheme: 'light'});
const themes = paramsThemes || defaultParams.themes;

expect(await captureScreenshot()).toMatchSnapshot({
name: `${nameScreenshot} light.png`,
});
if (themes?.includes('light')) {
await page.emulateMedia({colorScheme: 'light'});

await page.emulateMedia({colorScheme: 'dark'});
expect(await captureScreenshot()).toMatchSnapshot({
name: `${nameScreenshot} light.png`,
});
}

expect(await captureScreenshot()).toMatchSnapshot({
name: `${nameScreenshot} dark.png`,
});
if (themes?.includes('dark')) {
await page.emulateMedia({colorScheme: 'dark'});

expect(await captureScreenshot()).toMatchSnapshot({
name: `${nameScreenshot} dark.png`,
});
}
};

await use(expectScreenshot);
Expand Down
8 changes: 8 additions & 0 deletions playwright/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ export const test = base.extend<Fixtures>({
});

export {expect} from '@playwright/experimental-ct-react';

export const smokeTest = (testSuffix: string, body: Parameters<typeof test>[2]) => {
test.skip(({browserName}) => {
return browserName !== 'chromium';
}, 'Smoke test is only relevant in Chrome');

test(`smoke ${testSuffix}`, {tag: ['@smoke']}, body);
};
3 changes: 2 additions & 1 deletion playwright/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export interface ExpectScreenshotFixture {
(props?: CaptureScreenshotParams): Promise<void>;
}

interface CaptureScreenshotParams extends PageScreenshotOptions {
export interface CaptureScreenshotParams extends PageScreenshotOptions {
nameSuffix?: string;
component?: Locator;
themes?: Array<'light' | 'dark'>;
}
3 changes: 2 additions & 1 deletion src/components/ActionTooltip/ActionTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {Popup} from '../Popup';
import type {PopupPlacement} from '../Popup';
import type {DOMProps, QAProps} from '../types';
import {block} from '../utils/cn';
import {getElementRef} from '../utils/getElementRef';

import './ActionTooltip.scss';

Expand Down Expand Up @@ -77,7 +78,7 @@ export function ActionTooltip(props: ActionTooltipProps) {
};

const child = React.Children.only(children);
const childRef = (child as any).ref;
const childRef = getElementRef(child);

const ref = useForkRef(setAnchorElement, childRef);

Expand Down
Loading

0 comments on commit 0d4c06f

Please sign in to comment.