Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Stories)!: remove deprecated description param #228

Open
wants to merge 6 commits into
base: release/v4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
23 changes: 16 additions & 7 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gravity-ui/components",
"version": "3.10.1",
"version": "3.11.0",
"description": "",
"license": "MIT",
"main": "./build/cjs/index.js",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/components/ActionsPanel/ActionsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className={b(null, className)}>
Expand Down
4 changes: 3 additions & 1 deletion src/components/ActionsPanel/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
14 changes: 7 additions & 7 deletions src/components/Stories/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +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 |
| 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

Expand All @@ -41,7 +41,7 @@ Component for displaying stories. It looks like a carousel in a modal with given
items={[
{
title: 'Story title',
description: 'Story text',
content: <b>Story text</b>,
media: {
url: 'https://storage.yandexcloud.net/uikit-storybook-assets/story-picture-2.png',
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/Stories/__stories__/Stories.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand All @@ -26,15 +26,15 @@ 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',
},
},
{
title: 'New navigation (3)',
description: 'Switch to the new navigation right now',
content: <b>Switch to the new navigation right now</b>,
media: {
url: 'https://storage.yandexcloud.net/uikit-storybook-assets/story-picture-4.png',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export const StoriesLayout = (props: StoriesLayoutProps) => {
{currentStory.title && (
<div className={b('text-header')}>{currentStory.title}</div>
)}
{currentStory.description && (
{currentStory.content && (
<div className={b('text-content')}>
{currentStory.description}
{currentStory.content}
</div>
)}
{currentStory.url && (
Expand Down
4 changes: 3 additions & 1 deletion src/components/Stories/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type React from 'react';

export type StoriesItemMedia = {url: string} & (
| {
/** default 'image' */
Expand All @@ -12,7 +14,7 @@ export type StoriesItemMedia = {url: string} & (

export interface StoriesItem {
title?: string;
description?: string;
content?: React.ReactNode;
/** Url for link "more" */
url?: string;
media?: StoriesItemMedia;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand All @@ -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',
Expand All @@ -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',
},
Expand Down
Loading