From 167c5a8834281597560166404cb9b5d03f2bf377 Mon Sep 17 00:00:00 2001 From: Evis Drenova Date: Mon, 13 Nov 2023 13:02:32 -0800 Subject: [PATCH] gender transformer --- docs/docs/transformers/system/full-name.mdx | 2 +- docs/docs/transformers/system/gender.mdx | 84 +++++++++++++++++++ docs/sidebars.js | 5 ++ .../TransformerPageHeader.tsx | 2 +- docs/src/theme/DocSidebarItem/Link/index.js | 4 +- 5 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 docs/docs/transformers/system/gender.mdx diff --git a/docs/docs/transformers/system/full-name.mdx b/docs/docs/transformers/system/full-name.mdx index c9023d73a2..38ac2b9e91 100644 --- a/docs/docs/transformers/system/full-name.mdx +++ b/docs/docs/transformers/system/full-name.mdx @@ -37,7 +37,7 @@ Depending on your validations, you may want to configure the output full name. T { data: [ 'PreserveLength', - 'Preserve Length will ensure that the output full name is the same length as the input full name by preserving the length of the first and last names. The preserveLength config only preserves names up to 12 characters long.', + 'Preserve Length will ensure that the output full name is the same length as the input full name by preserving the length of the first and last names. The preserveLength config only preserves first and/or last names up to 12 characters long. So the max full name length is 25 characters.', 'false', 'John', 'Bill', diff --git a/docs/docs/transformers/system/gender.mdx b/docs/docs/transformers/system/gender.mdx new file mode 100644 index 0000000000..6df48089b6 --- /dev/null +++ b/docs/docs/transformers/system/gender.mdx @@ -0,0 +1,84 @@ +--- +title: Gender +id: gender +hide_title: true +slug: /transformers/system/gender +--- + +import { TransformerPageHeader } from '@site/src/CustomComponents/TransformerPageHeader.tsx'; + +import { DocsTable } from '@site/src/CustomComponents/DocsTable.tsx'; + + + +## Definition + +The gender transformer randomly selects a gender value from a predefined list of genders. Here is the list: + + + +By default, the gender transformer does not abbreviate the gender. If you'd like to return an abbreviated gender, pass in the `abbreviate` config. + +## Configurations + +Depending on your validations, you may want to configure the output gender. The gender transformer has the following configurations: + + + +## Examples + +There are several ways you can mix-and-match configurations to get different full name formats. Here are some possible combinations: + + diff --git a/docs/sidebars.js b/docs/sidebars.js index 8cb04134e6..1b0571b48a 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -161,6 +161,11 @@ const sidebars = { id: 'transformers/system/full-name', label: 'Full Name', }, + { + type: 'doc', + id: 'transformers/system/gender', + label: 'Gender', + }, { type: 'doc', id: 'transformers/system/ssn', diff --git a/docs/src/CustomComponents/TransformerPageHeader.tsx b/docs/src/CustomComponents/TransformerPageHeader.tsx index fb25511ed4..ecc8aba771 100644 --- a/docs/src/CustomComponents/TransformerPageHeader.tsx +++ b/docs/src/CustomComponents/TransformerPageHeader.tsx @@ -18,7 +18,7 @@ export const TransformerPageHeader = (props: Props) => { href={apiRef} className="no-underline text-gray-900 flex items-center hover:text-gray-900" > - Code reference + code reference ); diff --git a/docs/src/theme/DocSidebarItem/Link/index.js b/docs/src/theme/DocSidebarItem/Link/index.js index 98b428f675..3b81196ad4 100644 --- a/docs/src/theme/DocSidebarItem/Link/index.js +++ b/docs/src/theme/DocSidebarItem/Link/index.js @@ -18,7 +18,7 @@ import { AiOutlinePhone, } from 'react-icons/ai'; import { BiLogoPostgresql, BiSolidCity } from 'react-icons/bi'; -import { BsFunnel, BsShieldCheck } from 'react-icons/bs'; +import { BsFunnel, BsGenderAmbiguous, BsShieldCheck } from 'react-icons/bs'; import { FaAws, FaDocker, @@ -138,6 +138,8 @@ export const RenderIcon = (name) => { return ; case 'Full Address': return ; + case 'Gender': + return ; default: return ; }