From cdfdca314475fc78cc484398c315370b6a44c675 Mon Sep 17 00:00:00 2001 From: Dario Eder Date: Wed, 6 Nov 2024 07:58:33 +0100 Subject: [PATCH 1/5] chore: add a required and deprecated badge to properties --- .../docs/src/lib/PropertiesTables/components/PropertyRow.tsx | 3 +++ packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts | 1 + packages/docs/src/lib/PropertiesTables/types.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx index c590eb88f..1c2c90229 100644 --- a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx +++ b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx @@ -5,6 +5,7 @@ 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"; export interface PropertyTableGroupProps { property: Property; @@ -20,6 +21,8 @@ export const PropertyRow: React.FC = ({ {property.name} + {property.required && Required} + {property.deprecated && Deprecated} {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..1788be6ef 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("@deprecaded"), 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"; From 96a925a0162a3e80349f5dbbb77ec52ead6bab3e Mon Sep 17 00:00:00 2001 From: Dario Eder Date: Wed, 6 Nov 2024 07:59:39 +0100 Subject: [PATCH 2/5] fix: typo --- packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts b/packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts index 1788be6ef..93c3ff18d 100644 --- a/packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts +++ b/packages/docs/src/lib/PropertiesTables/lib/loadProperties.ts @@ -28,7 +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("@deprecaded"), + deprecated: prop.description.includes("@deprecated"), type, }; }); From 5ff17efc70f525781656a7946305e1b100671438 Mon Sep 17 00:00:00 2001 From: Dario Eder Date: Wed, 6 Nov 2024 10:47:16 +0100 Subject: [PATCH 3/5] chore: remove deprecated badge --- .../docs/src/lib/PropertiesTables/components/PropertyRow.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx index 1c2c90229..00ee6286f 100644 --- a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx +++ b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx @@ -22,7 +22,6 @@ export const PropertyRow: React.FC = ({ {property.name} {property.required && Required} - {property.deprecated && Deprecated} {property.type} {property.default || "-"} From 7064e89d6569cb46979c560c22b8d64d9a7e3dcd Mon Sep 17 00:00:00 2001 From: Dario Eder Date: Mon, 11 Nov 2024 15:21:50 +0100 Subject: [PATCH 4/5] chore: required badge in next to the name --- .../lib/PropertiesTables/components/PropertyRow.module.css | 5 +++++ .../docs/src/lib/PropertiesTables/components/PropertyRow.tsx | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 packages/docs/src/lib/PropertiesTables/components/PropertyRow.module.css 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 00ee6286f..4bd14d375 100644 --- a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx +++ b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx @@ -6,6 +6,7 @@ import { customComponents } from "@/lib/mdx/components/MdxFileView/customCompone 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; @@ -19,9 +20,10 @@ export const PropertyRow: React.FC = ({ .replaceAll(/{@link (\S+)}/g, "[$1]($1)"); return ( - + {property.name} {property.required && Required} + Required {property.type} {property.default || "-"} From 0b40ff0325e6802f711d82ffb998a90d9ee61fc8 Mon Sep 17 00:00:00 2001 From: Dario Eder Date: Mon, 11 Nov 2024 15:30:02 +0100 Subject: [PATCH 5/5] chore: required badge in next to the name --- .../docs/src/lib/PropertiesTables/components/PropertyRow.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx index 4bd14d375..1bd7f4c76 100644 --- a/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx +++ b/packages/docs/src/lib/PropertiesTables/components/PropertyRow.tsx @@ -23,7 +23,6 @@ export const PropertyRow: React.FC = ({ {property.name} {property.required && Required} - Required {property.type} {property.default || "-"}