diff --git a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.module.css b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.module.css new file mode 100644 index 000000000..9c4796527 --- /dev/null +++ b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.module.css @@ -0,0 +1,5 @@ +.nameCell { + display: flex; + gap: var(--size-px--s); + flex-wrap: wrap; +} diff --git a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx index c590eb88f..1bd7f4c76 100644 --- a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx +++ b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx @@ -5,6 +5,8 @@ import { InlineCode } from "@mittwald/flow-react-components/InlineCode"; import { customComponents } from "@/lib/mdx/components/MdxFileView/customComponents"; import Markdown from "react-markdown"; import { omit } from "remeda"; +import { Badge } from "@mittwald/flow-react-components/Badge"; +import styles from "./PropertyRow.module.css"; export interface PropertyTableGroupProps { property: Property; @@ -18,8 +20,9 @@ export const PropertyRow: React.FC = ({ .replaceAll(/{@link (\S+)}/g, "[$1]($1)"); return ( - + {property.name} + {property.required && Required} {property.type} {property.default || "-"} diff --git a/packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts b/packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts index d06de6e1d..93c3ff18d 100644 --- a/packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts +++ b/packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts @@ -28,6 +28,7 @@ export default function loadProperties(name: string): Properties | null { default: prop.defaultValue ? prop.defaultValue.value : null, description: prop.description, required: prop.required, + deprecated: prop.description.includes("@deprecated"), type, }; }); diff --git a/packages/docs/src/lib/PropertiesTables/types.ts b/packages/docs/src/lib/PropertiesTables/types.ts index 7b4073022..324d51d01 100644 --- a/packages/docs/src/lib/PropertiesTables/types.ts +++ b/packages/docs/src/lib/PropertiesTables/types.ts @@ -4,6 +4,7 @@ export interface Property { required: boolean; default: string | null; description?: string | null; + deprecated: boolean; } export type PropertyCategories = "events" | "accessibility" | "other";