mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 22:05:23 +02:00
refactor(kube/volumes): migrate to react [EE-4695] (#10987)
This commit is contained in:
parent
2b53bebcb3
commit
da615afc92
24 changed files with 347 additions and 397 deletions
|
@ -9,7 +9,16 @@ export default {
|
|||
type: {
|
||||
control: {
|
||||
type: 'select',
|
||||
options: ['success', 'danger', 'warn', 'info'],
|
||||
options: [
|
||||
'success',
|
||||
'danger',
|
||||
'warn',
|
||||
'info',
|
||||
'successSecondary',
|
||||
'dangerSecondary',
|
||||
'warnSecondary',
|
||||
'infoSecondary',
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -14,45 +14,45 @@ export type BadgeType =
|
|||
// the classes are typed in full because tailwind doesn't render the interpolated classes
|
||||
const typeClasses: Record<BadgeType, string> = {
|
||||
success: clsx(
|
||||
`text-success-9 bg-success-2`,
|
||||
`th-dark:text-success-3 th-dark:bg-success-10`,
|
||||
`th-highcontrast:text-success-3 th-highcontrast:bg-success-10`
|
||||
'text-success-9 bg-success-2',
|
||||
'th-dark:text-success-3 th-dark:bg-success-10',
|
||||
'th-highcontrast:text-success-3 th-highcontrast:bg-success-10'
|
||||
),
|
||||
warn: clsx(
|
||||
`text-warning-9 bg-warning-2`,
|
||||
`th-dark:text-warning-3 th-dark:bg-warning-10`,
|
||||
`th-highcontrast:text-warning-3 th-highcontrast:bg-warning-10`
|
||||
'text-warning-9 bg-warning-2',
|
||||
'th-dark:text-warning-3 th-dark:bg-warning-10',
|
||||
'th-highcontrast:text-warning-3 th-highcontrast:bg-warning-10'
|
||||
),
|
||||
danger: clsx(
|
||||
`text-error-9 bg-error-2`,
|
||||
`th-dark:text-error-3 th-dark:bg-error-10`,
|
||||
`th-highcontrast:text-error-3 th-highcontrast:bg-error-10`
|
||||
'text-error-9 bg-error-2',
|
||||
'th-dark:text-error-3 th-dark:bg-error-10',
|
||||
'th-highcontrast:text-error-3 th-highcontrast:bg-error-10'
|
||||
),
|
||||
info: clsx(
|
||||
`text-blue-9 bg-blue-2`,
|
||||
`th-dark:text-blue-3 th-dark:bg-blue-10`,
|
||||
`th-highcontrast:text-blue-3 th-highcontrast:bg-blue-10`
|
||||
'text-blue-9 bg-blue-2',
|
||||
'th-dark:text-blue-3 th-dark:bg-blue-10',
|
||||
'th-highcontrast:text-blue-3 th-highcontrast:bg-blue-10'
|
||||
),
|
||||
// the secondary classes are a bit darker in light mode and a bit lighter in dark mode
|
||||
successSecondary: clsx(
|
||||
`text-success-9 bg-success-3`,
|
||||
`th-dark:text-success-3 th-dark:bg-success-9`,
|
||||
`th-highcontrast:text-success-3 th-highcontrast:bg-success-9`
|
||||
'text-success-9 bg-success-3',
|
||||
'th-dark:text-success-3 th-dark:bg-success-9',
|
||||
'th-highcontrast:text-success-3 th-highcontrast:bg-success-9'
|
||||
),
|
||||
warnSecondary: clsx(
|
||||
`text-warning-9 bg-warning-3`,
|
||||
`th-dark:text-warning-3 th-dark:bg-warning-9`,
|
||||
`th-highcontrast:text-warning-3 th-highcontrast:bg-warning-9`
|
||||
'text-warning-9 bg-warning-3',
|
||||
'th-dark:text-warning-3 th-dark:bg-warning-9',
|
||||
'th-highcontrast:text-warning-3 th-highcontrast:bg-warning-9'
|
||||
),
|
||||
dangerSecondary: clsx(
|
||||
`text-error-9 bg-error-3`,
|
||||
`th-dark:text-error-3 th-dark:bg-error-9`,
|
||||
`th-highcontrast:text-error-3 th-highcontrast:bg-error-9`
|
||||
'text-error-9 bg-error-3',
|
||||
'th-dark:text-error-3 th-dark:bg-error-9',
|
||||
'th-highcontrast:text-error-3 th-highcontrast:bg-error-9'
|
||||
),
|
||||
infoSecondary: clsx(
|
||||
`text-blue-9 bg-blue-3`,
|
||||
`th-dark:text-blue-3 th-dark:bg-blue-9`,
|
||||
`th-highcontrast:text-blue-3 th-highcontrast:bg-blue-9`
|
||||
'text-blue-9 bg-blue-3',
|
||||
'th-dark:text-blue-3 th-dark:bg-blue-9',
|
||||
'th-highcontrast:text-blue-3 th-highcontrast:bg-blue-9'
|
||||
),
|
||||
};
|
||||
|
||||
|
|
5
app/react/components/Badge/ExternalBadge.tsx
Normal file
5
app/react/components/Badge/ExternalBadge.tsx
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { Badge } from '@@/Badge';
|
||||
|
||||
export function ExternalBadge() {
|
||||
return <Badge type="info">external</Badge>;
|
||||
}
|
5
app/react/components/Badge/SystemBadge.tsx
Normal file
5
app/react/components/Badge/SystemBadge.tsx
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { Badge } from '@@/Badge';
|
||||
|
||||
export function SystemBadge() {
|
||||
return <Badge type="success">system</Badge>;
|
||||
}
|
5
app/react/components/Badge/UnusedBadge.tsx
Normal file
5
app/react/components/Badge/UnusedBadge.tsx
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { Badge } from '@@/Badge';
|
||||
|
||||
export function UnusedBadge() {
|
||||
return <Badge type="warn">unused</Badge>;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue