From 250c561b64bf1bce1342f853de6ca8a580a1fe28 Mon Sep 17 00:00:00 2001 From: Valeriia Maltseva Date: Tue, 17 Dec 2024 12:08:20 +0100 Subject: [PATCH] updated the Badge component --- .../core/components/badge/badge.stories.tsx | 63 + assets/js/src/core/components/badge/badge.tsx | 2 +- .../entrypoints.json | 14 + .../manifest.json | 1972 +++++++++++++++++ 4 files changed, 2050 insertions(+), 1 deletion(-) create mode 100644 assets/js/src/core/components/badge/badge.stories.tsx create mode 100644 public/build/60f6f739-39c5-422c-bb87-8a49352dbd3f/entrypoints.json create mode 100644 public/build/60f6f739-39c5-422c-bb87-8a49352dbd3f/manifest.json diff --git a/assets/js/src/core/components/badge/badge.stories.tsx b/assets/js/src/core/components/badge/badge.stories.tsx new file mode 100644 index 000000000..bd1baa225 --- /dev/null +++ b/assets/js/src/core/components/badge/badge.stories.tsx @@ -0,0 +1,63 @@ +/** +* Pimcore +* +* This source file is available under two different licenses: +* - Pimcore Open Core License (POCL) +* - Pimcore Commercial License (PCL) +* Full copyright and license information is available in +* LICENSE.md which is distributed with this source code. +* +* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) +* @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL +*/ + +import React from 'react' +import { type Meta } from '@storybook/react' +import { Badge } from './badge' +import { Icon } from '@Pimcore/components/icon/icon' + +const config: Meta = { + title: 'Components/Data Display/Badge', + component: Badge, + args: { + children: ( + + ), + count: 8 + } +} + +export default config + +export const _default = {} + +export const Small = { + args: { + size: 'small' + } +} + +export const Large = { + args: { + size: 'large' + } +} + +export const Standalone = { + args: { + children: null, + showZero: true + } +} + +export const WithOverflowCount = { + args: { + overflowCount: 5 + } +} + +export const WithOffset = { + args: { + offset: [7, 0] + } +} diff --git a/assets/js/src/core/components/badge/badge.tsx b/assets/js/src/core/components/badge/badge.tsx index e9405a065..3a10fdaf2 100644 --- a/assets/js/src/core/components/badge/badge.tsx +++ b/assets/js/src/core/components/badge/badge.tsx @@ -14,7 +14,7 @@ import React from 'react' import { Badge as AntBadge, type BadgeProps } from 'antd' -export const Badge = ({ color, children, ...props }: BadgeProps): React.JSX.Element => { +export const Badge = ({ color, ...props }: BadgeProps): React.JSX.Element => { return (