Skip to content

Commit

Permalink
updated the Badge component
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeriaMaltseva committed Dec 17, 2024
1 parent 6432986 commit 250c561
Show file tree
Hide file tree
Showing 4 changed files with 2,050 additions and 1 deletion.
63 changes: 63 additions & 0 deletions assets/js/src/core/components/badge/badge.stories.tsx
Original file line number Diff line number Diff line change
@@ -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: (
<Icon value={ 'folder' } />
),
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]
}
}
2 changes: 1 addition & 1 deletion assets/js/src/core/components/badge/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<AntBadge
color={ color }
Expand Down
14 changes: 14 additions & 0 deletions public/build/60f6f739-39c5-422c-bb87-8a49352dbd3f/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"entrypoints": {
"main": {
"css": [
"http://localhost:3030/build/60f6f739-39c5-422c-bb87-8a49352dbd3f/vendors-node_modules_dnd-kit_modifiers_dist_modifiers_esm_js-node_modules_dnd-kit_sortable_di-cbce9d.css",
"http://localhost:3030/build/60f6f739-39c5-422c-bb87-8a49352dbd3f/main.css"
],
"js": [
"http://localhost:3030/build/60f6f739-39c5-422c-bb87-8a49352dbd3f/vendors-node_modules_dnd-kit_modifiers_dist_modifiers_esm_js-node_modules_dnd-kit_sortable_di-cbce9d.js",
"http://localhost:3030/build/60f6f739-39c5-422c-bb87-8a49352dbd3f/main.js"
]
}
}
}
Loading

0 comments on commit 250c561

Please sign in to comment.