From 12b54c7397d00f370d988ee7c5de3c230deacb21 Mon Sep 17 00:00:00 2001 From: Evgenij Shangin Date: Mon, 7 Oct 2024 12:43:12 +0300 Subject: [PATCH 1/6] chore(ActionsPanel): mark as deprecated (#224) --- src/components/ActionsPanel/ActionsPanel.tsx | 2 ++ src/components/ActionsPanel/README.md | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ActionsPanel/ActionsPanel.tsx b/src/components/ActionsPanel/ActionsPanel.tsx index b7db93ff..61bf3492 100644 --- a/src/components/ActionsPanel/ActionsPanel.tsx +++ b/src/components/ActionsPanel/ActionsPanel.tsx @@ -13,6 +13,8 @@ import './ActionsPanel.scss'; const b = block('actions-panel'); +// eslint-disable-next-line valid-jsdoc +/** @deprecated it's been moved to `@gravity-ui/uikit`. It's available there since version 6.30.0 */ export const ActionsPanel = ({className, actions, onClose, renderNote}: ActionsPanelProps) => { return (
diff --git a/src/components/ActionsPanel/README.md b/src/components/ActionsPanel/README.md index 17706da7..f2103333 100644 --- a/src/components/ActionsPanel/README.md +++ b/src/components/ActionsPanel/README.md @@ -1,4 +1,6 @@ -# ActionsPanel +# ⚠️[DEPRECATED] ActionsPanel + +⚠️ It's been moved to `@gravity-ui/uikit`. It's available there since version 6.30.0 ## Usage From 3b59e088ff420dc7b078962afd9465c0c0e8494e Mon Sep 17 00:00:00 2001 From: mytwink Date: Sat, 12 Oct 2024 12:08:36 +0300 Subject: [PATCH 2/6] feat(Stories): Add content property (#225) --- src/components/Stories/README.md | 5 +++-- src/components/Stories/__stories__/Stories.stories.tsx | 6 +++--- .../Stories/components/StoriesLayout/StoriesLayout.tsx | 7 ++++++- src/components/Stories/types.ts | 4 ++++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/components/Stories/README.md b/src/components/Stories/README.md index 8c0c1191..045ed091 100644 --- a/src/components/Stories/README.md +++ b/src/components/Stories/README.md @@ -21,7 +21,8 @@ Component for displaying stories. It looks like a carousel in a modal with given | Field | Type | Required | Default | Description | | ----------- | ------------------ | -------- | ------- | -------------------------------- | | title | `String` | | | Title | -| description | `String` | | | Main text | +| description | `String` | | | Main text, deprecated | +| content | `React.ReactNode` | | | Main content | | url | `String` | | | Link to display more information | | media | `StoriesItemMedia` | | | Media content | @@ -41,7 +42,7 @@ Component for displaying stories. It looks like a carousel in a modal with given items={[ { title: 'Story title', - description: 'Story text', + content: Story text, media: { url: 'https://storage.yandexcloud.net/uikit-storybook-assets/story-picture-2.png', }, diff --git a/src/components/Stories/__stories__/Stories.stories.tsx b/src/components/Stories/__stories__/Stories.stories.tsx index bb0ca091..83025dc9 100644 --- a/src/components/Stories/__stories__/Stories.stories.tsx +++ b/src/components/Stories/__stories__/Stories.stories.tsx @@ -15,7 +15,7 @@ export default { const items: StoriesItem[] = [ { title: 'New navigation', - description: + content: 'At the top of the panel is the service navigation for each service. ' + 'Below are common navigation elements: a component for switching between accounts ' + 'and organizations, settings, help center, search, notifications, favorites.', @@ -26,7 +26,7 @@ const items: StoriesItem[] = [ }, { title: 'New navigation (2)', - description: 'A little more about the new navigation', + content: 'A little more about the new navigation', media: { url: 'https://storage.yandexcloud.net/uikit-storybook-assets/sample_960x400_ocean_with_audio.mp4', type: 'video', @@ -34,7 +34,7 @@ const items: StoriesItem[] = [ }, { title: 'New navigation (3)', - description: 'Switch to the new navigation right now', + content: Switch to the new navigation right now, media: { url: 'https://storage.yandexcloud.net/uikit-storybook-assets/story-picture-4.png', }, diff --git a/src/components/Stories/components/StoriesLayout/StoriesLayout.tsx b/src/components/Stories/components/StoriesLayout/StoriesLayout.tsx index 16e290c1..f2ccd951 100644 --- a/src/components/Stories/components/StoriesLayout/StoriesLayout.tsx +++ b/src/components/Stories/components/StoriesLayout/StoriesLayout.tsx @@ -55,7 +55,12 @@ export const StoriesLayout = (props: StoriesLayoutProps) => { {currentStory.title && (
{currentStory.title}
)} - {currentStory.description && ( + {currentStory.content && ( +
+ {currentStory.content} +
+ )} + {!currentStory.content && currentStory.description && (
{currentStory.description}
diff --git a/src/components/Stories/types.ts b/src/components/Stories/types.ts index 281a25d7..cca78d72 100644 --- a/src/components/Stories/types.ts +++ b/src/components/Stories/types.ts @@ -1,3 +1,5 @@ +import type React from 'react'; + export type StoriesItemMedia = {url: string} & ( | { /** default 'image' */ @@ -12,7 +14,9 @@ export type StoriesItemMedia = {url: string} & ( export interface StoriesItem { title?: string; + /** @deprecated use `content` property instead */ description?: string; + content?: React.ReactNode; /** Url for link "more" */ url?: string; media?: StoriesItemMedia; From 5f0b47100804bd9d61a95abb8e0566d596478681 Mon Sep 17 00:00:00 2001 From: Andrey Melikhov Date: Mon, 14 Oct 2024 12:33:07 +0300 Subject: [PATCH 3/6] fix: update universal-cookie (#227) --- package-lock.json | 19 ++++++++++++++----- package.json | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1045ce5d..c7c01175 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@gravity-ui/icons": "^2.8.1", "lodash": "^4.17.21", "resize-observer-polyfill": "^1.5.1", - "universal-cookie": "^6.1.3" + "universal-cookie": "^7.2.0" }, "devDependencies": { "@babel/preset-env": "^7.23.9", @@ -10206,6 +10206,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true, "engines": { "node": ">= 0.6" } @@ -27365,12 +27366,20 @@ } }, "node_modules/universal-cookie": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-6.1.3.tgz", - "integrity": "sha512-AETYRrhpRgl9T1YtnODmQE32G81U3A+f3HO3ZeK7efbXqe3x+RNOW4RTpV0iff7zJWhGYJA6EI0Mm+w50aFTAw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-7.2.1.tgz", + "integrity": "sha512-GEKneQ0sz8qbobkYM5s9elAx6l7GQDNVl3Siqmc7bt/YccyyXWDPn+fht3J1qMcaLwPrzkty3i+dNfPGP2/9hA==", "dependencies": { "@types/cookie": "^0.6.0", - "cookie": "^0.6.0" + "cookie": "^0.7.2" + } + }, + "node_modules/universal-cookie/node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "engines": { + "node": ">= 0.6" } }, "node_modules/universalify": { diff --git a/package.json b/package.json index 56300b27..51f351c6 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@gravity-ui/icons": "^2.8.1", "lodash": "^4.17.21", "resize-observer-polyfill": "^1.5.1", - "universal-cookie": "^6.1.3" + "universal-cookie": "^7.2.0" }, "devDependencies": { "@babel/preset-env": "^7.23.9", From c1e3e190a074c545fc4b0bca2390e33ed3bbd219 Mon Sep 17 00:00:00 2001 From: Gravity UI Bot <111915794+gravity-ui-bot@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:27:24 +0300 Subject: [PATCH 4/6] chore(main): release 3.11.0 (#226) --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c45e8d..23cd98ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [3.11.0](https://github.com/gravity-ui/components/compare/v3.10.1...v3.11.0) (2024-10-14) + + +### Features + +* **Stories:** Add content property ([#225](https://github.com/gravity-ui/components/issues/225)) ([3b59e08](https://github.com/gravity-ui/components/commit/3b59e088ff420dc7b078962afd9465c0c0e8494e)) + + +### Bug Fixes + +* update universal-cookie ([#227](https://github.com/gravity-ui/components/issues/227)) ([5f0b471](https://github.com/gravity-ui/components/commit/5f0b47100804bd9d61a95abb8e0566d596478681)) + ## [3.10.1](https://github.com/gravity-ui/components/compare/v3.10.0...v3.10.1) (2024-09-12) diff --git a/package-lock.json b/package-lock.json index c7c01175..1c4fc27f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gravity-ui/components", - "version": "3.10.1", + "version": "3.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gravity-ui/components", - "version": "3.10.1", + "version": "3.11.0", "license": "MIT", "dependencies": { "@bem-react/classname": "^1.6.0", diff --git a/package.json b/package.json index 51f351c6..846387d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gravity-ui/components", - "version": "3.10.1", + "version": "3.11.0", "description": "", "license": "MIT", "main": "./build/cjs/index.js", From ac5431b9ac5fee0159337b9e7032487a7a5bd82f Mon Sep 17 00:00:00 2001 From: Marat Validov Date: Tue, 15 Oct 2024 19:23:37 +0300 Subject: [PATCH 5/6] chore(Stories)!: remove deprecated description param --- src/components/Stories/README.md | 13 ++++++------- .../components/StoriesLayout/StoriesLayout.tsx | 5 ----- src/components/Stories/types.ts | 2 -- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/components/Stories/README.md b/src/components/Stories/README.md index 045ed091..0680ca46 100644 --- a/src/components/Stories/README.md +++ b/src/components/Stories/README.md @@ -18,13 +18,12 @@ Component for displaying stories. It looks like a carousel in a modal with given ### StoriesItem object -| Field | Type | Required | Default | Description | -| ----------- | ------------------ | -------- | ------- | -------------------------------- | -| title | `String` | | | Title | -| description | `String` | | | Main text, deprecated | -| content | `React.ReactNode` | | | Main content | -| url | `String` | | | Link to display more information | -| media | `StoriesItemMedia` | | | Media content | +| Field | Type | Required | Default | Description | +| ------- | ------------------ | -------- | ------- | -------------------------------- | +| title | `String` | | | Title | +| content | `React.ReactNode` | | | Main content | +| url | `String` | | | Link to display more information | +| media | `StoriesItemMedia` | | | Media content | ### StoriesItemMedia object diff --git a/src/components/Stories/components/StoriesLayout/StoriesLayout.tsx b/src/components/Stories/components/StoriesLayout/StoriesLayout.tsx index f2ccd951..47f1c3d2 100644 --- a/src/components/Stories/components/StoriesLayout/StoriesLayout.tsx +++ b/src/components/Stories/components/StoriesLayout/StoriesLayout.tsx @@ -60,11 +60,6 @@ export const StoriesLayout = (props: StoriesLayoutProps) => { {currentStory.content}
)} - {!currentStory.content && currentStory.description && ( -
- {currentStory.description} -
- )} {currentStory.url && (
diff --git a/src/components/Stories/types.ts b/src/components/Stories/types.ts index cca78d72..18f56d40 100644 --- a/src/components/Stories/types.ts +++ b/src/components/Stories/types.ts @@ -14,8 +14,6 @@ export type StoriesItemMedia = {url: string} & ( export interface StoriesItem { title?: string; - /** @deprecated use `content` property instead */ - description?: string; content?: React.ReactNode; /** Url for link "more" */ url?: string; From 5a5229f449644f90270ae78c26edd27a8cfe631d Mon Sep 17 00:00:00 2001 From: Marat Validov Date: Tue, 15 Oct 2024 19:28:29 +0300 Subject: [PATCH 6/6] fix(StoriesGroup): fix storybook --- .../StoriesGroup/__stories__/StoriesGroup.stories.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/StoriesGroup/__stories__/StoriesGroup.stories.tsx b/src/components/StoriesGroup/__stories__/StoriesGroup.stories.tsx index d512b9d1..a45fe276 100644 --- a/src/components/StoriesGroup/__stories__/StoriesGroup.stories.tsx +++ b/src/components/StoriesGroup/__stories__/StoriesGroup.stories.tsx @@ -17,7 +17,7 @@ const groups: StoriesGroupItem[] = [ items: [ { title: 'New navigation', - description: + content: 'At the top of the panel is the service navigation for each service. ' + 'Below are common navigation elements: a component for switching between accounts ' + 'and organizations, settings, help center, search, notifications, favorites.', @@ -28,7 +28,7 @@ const groups: StoriesGroupItem[] = [ }, { title: 'New navigation (2)', - description: 'A little more about the new navigation', + content: 'A little more about the new navigation', media: { url: 'https://storage.yandexcloud.net/uikit-storybook-assets/sample_960x400_ocean_with_audio.mp4', type: 'video', @@ -40,7 +40,7 @@ const groups: StoriesGroupItem[] = [ items: [ { title: 'New navigation (3)', - description: 'Switch to the new navigation right now', + content: 'Switch to the new navigation right now', media: { url: 'https://storage.yandexcloud.net/uikit-storybook-assets/story-picture-4.png', },