fleet/frontend/components/Card/Card.tsx
Gabriel Hernandez 0359290662
implement add Vpp software UI to new add software pages (#22264)
relates to #21811

This adds the UI for the new add vpp software flow. This moves the add
app store vpp flow under the App Store (Vpp) Tab panel. This includes:

**add vpp software form**


![image](https://github.com/user-attachments/assets/0b8cea88-baea-4da7-88f7-6c392a8af4a6)

**has now vpp token setup UI**


![image](https://github.com/user-attachments/assets/40142599-f5d9-4602-a731-786b69a6b8b9)


**has no vpp apps UI**


![image](https://github.com/user-attachments/assets/5aa29772-037c-456a-894b-cf99f5f35cb4)


<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-09-20 16:15:10 +01:00

69 lines
1.9 KiB
TypeScript

import React from "react";
import classnames from "classnames";
const baseClass = "card";
type BorderRadiusSize = "small" | "medium" | "large" | "xlarge" | "xxlarge";
type CardColor = "white" | "gray" | "purple" | "yellow";
interface ICardProps {
children?: React.ReactNode;
/** The size of the border radius. Defaults to `small`.
*
* These correspond to the boarder radius in the design system. Look at
* `var/_global.scss` for values */
borderRadiusSize?: BorderRadiusSize;
/** Includes the card shadows. Defaults to `false` */
includeShadow?: boolean;
/** The color of the card. Defaults to `white` */
color?: CardColor;
className?: string;
/** The size of the padding around the content of the card. Defaults to `large`.
*
* These correspond to the padding sizes in the design system. Look at
* `padding.scss` for values */
paddingSize?:
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge"
| "xxxlarge";
/**
* @deprecated Use `paddingSize` prop instead.
*
* Increases to 40px padding. Defaults to `false` */
largePadding?: boolean;
}
/**
* A generic card component that will be used to render content within a card with a border and
* and selected background color.
*/
const Card = ({
children,
borderRadiusSize = "small",
includeShadow = false,
color = "white",
className,
largePadding = false,
paddingSize = "large",
}: ICardProps) => {
const classNames = classnames(
baseClass,
`${baseClass}__${color}`,
`${baseClass}__radius-${borderRadiusSize}`,
{
// TODO: simplify this when we've replaced largePadding prop with paddingSize
[`${baseClass}__padding-${paddingSize}`]:
!largePadding && paddingSize !== undefined,
[`${baseClass}__shadow`]: includeShadow,
[`${baseClass}__large-padding`]: largePadding,
},
className
);
return <div className={classNames}>{children}</div>;
};
export default Card;