1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 21:35:23 +02:00

feat(helm): update helm view [r8s-256] (#582)

Co-authored-by: Cara Ryan <cara.ryan@portainer.io>
Co-authored-by: James Player <james.player@portainer.io>
Co-authored-by: stevensbkang <skan070@gmail.com>
This commit is contained in:
Ali 2025-04-10 16:08:24 +12:00 committed by GitHub
parent 46eddbe7b9
commit 0ca9321db1
57 changed files with 2635 additions and 222 deletions

View file

@ -3,6 +3,56 @@ import { AriaAttributes, PropsWithChildren } from 'react';
import { Icon, IconProps } from '@@/Icon';
export type StatusBadgeType =
| 'success'
| 'danger'
| 'warning'
| 'info'
| 'successLite'
| 'dangerLite'
| 'warningLite'
| 'mutedLite'
| 'infoLite'
| 'default';
const typeClasses: Record<StatusBadgeType, string> = {
success: clsx(
'text-white bg-success-7',
'th-dark:text-white th-dark:bg-success-9'
),
warning: clsx(
'text-white bg-warning-7',
'th-dark:text-white th-dark:bg-warning-9'
),
danger: clsx(
'text-white bg-error-7',
'th-dark:text-white th-dark:bg-error-9'
),
info: clsx('text-white bg-blue-7', 'th-dark:text-white th-dark:bg-blue-9'),
// the lite classes are a bit lighter in light mode and the same in dark mode
successLite: clsx(
'text-success-9 bg-success-3',
'th-dark:text-white th-dark:bg-success-9'
),
warningLite: clsx(
'text-warning-9 bg-warning-3',
'th-dark:text-white th-dark:bg-warning-9'
),
dangerLite: clsx(
'text-error-9 bg-error-3',
'th-dark:text-white th-dark:bg-error-9'
),
mutedLite: clsx(
'text-gray-9 bg-gray-3',
'th-dark:text-white th-dark:bg-gray-9'
),
infoLite: clsx(
'text-blue-9 bg-blue-3',
'th-dark:text-white th-dark:bg-blue-9'
),
default: '',
};
export function StatusBadge({
className,
children,
@ -12,7 +62,7 @@ export function StatusBadge({
}: PropsWithChildren<
{
className?: string;
color?: 'success' | 'danger' | 'warning' | 'info' | 'default';
color?: StatusBadgeType;
icon?: IconProps['icon'];
} & AriaAttributes
>) {
@ -21,13 +71,8 @@ export function StatusBadge({
className={clsx(
'inline-flex items-center gap-1 rounded',
'w-fit px-1.5 py-0.5',
'text-sm font-medium text-white',
{
'bg-success-7 th-dark:bg-success-9': color === 'success',
'bg-warning-7 th-dark:bg-warning-9': color === 'warning',
'bg-error-7 th-dark:bg-error-9': color === 'danger',
'bg-blue-9': color === 'info',
},
'text-sm font-medium',
typeClasses[color],
className
)}
// eslint-disable-next-line react/jsx-props-no-spreading