From c906d65354836b8832b8947c154c880d02fd664c Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Wed, 18 May 2022 18:02:05 -0400 Subject: [PATCH 1/7] adds a draft for the SegmentedControl component docs --- docs/content/SegmentedControl.mdx | 190 ++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 docs/content/SegmentedControl.mdx diff --git a/docs/content/SegmentedControl.mdx b/docs/content/SegmentedControl.mdx new file mode 100644 index 00000000000..1acde78853d --- /dev/null +++ b/docs/content/SegmentedControl.mdx @@ -0,0 +1,190 @@ +--- +title: SegmentedControl +status: Draft +description: Used to select an option from a short list and immediately apply the selection +--- + +## Examples + +### Simple + +```jsx live drafts + + Preview + Raw + Blame + +``` + +### With icons and labels + +```jsx live drafts + + Preview + Raw + Blame + +``` + +### With icons only + +```jsx live drafts + + + + + +``` + +### With labels hidden on smaller viewports + +```jsx live drafts + + Preview + Raw + Blame + +``` + +### Convert to a dropdown on smaller viewports + +```jsx live drafts + + Preview + Raw + Blame + +``` + +### Fill width of parent + +```jsx live drafts + + Preview + Raw + Blame + +``` + +### In a loading state + +```jsx live drafts + + Preview + Raw + Blame + +``` + +### With a label and caption on the left + +```jsx live drafts + + + + File view + + + Change the way the file is viewed + + + + Preview + Raw + Blame + + +``` + +### With a label above and caption below + +```jsx live drafts + + File view + + Preview + Raw + Blame + + Change the way the file is viewed + +``` + +### With something besides the first option selected + +```jsx live drafts + + Preview + Raw + Blame + +``` + +### With a selection change handler + +```jsx live drafts + { + alert(`Segment ${selectedIndex}`) + }} +> + Preview + Raw + Blame + +``` + +## Props + +### SegmentedControl + + + + + + + + + + +### SegmentedControl.Item + + + + + + + +### SegmentedControl.IconItem + + + + + + + +## Status + + From b8421bdf807eba090ea8d70eae61f8aa12c13645 Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Thu, 19 May 2022 16:26:29 -0400 Subject: [PATCH 2/7] addresses first round of PR feedback --- docs/content/SegmentedControl.mdx | 62 +++++++++++++++---------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/content/SegmentedControl.mdx b/docs/content/SegmentedControl.mdx index 1acde78853d..f3b134ce3d7 100644 --- a/docs/content/SegmentedControl.mdx +++ b/docs/content/SegmentedControl.mdx @@ -10,9 +10,9 @@ description: Used to select an option from a short list and immediately apply th ```jsx live drafts - Preview - Raw - Blame + Preview + Raw + Blame ``` @@ -20,9 +20,9 @@ description: Used to select an option from a short list and immediately apply th ```jsx live drafts - Preview - Raw - Blame + Preview + Raw + Blame ``` @@ -30,16 +30,16 @@ description: Used to select an option from a short list and immediately apply th ```jsx live drafts - - - + + + ``` ### With labels hidden on smaller viewports ```jsx live drafts - + Preview Raw Blame @@ -49,7 +49,7 @@ description: Used to select an option from a short list and immediately apply th ### Convert to a dropdown on smaller viewports ```jsx live drafts - + Preview Raw Blame @@ -60,9 +60,9 @@ description: Used to select an option from a short list and immediately apply th ```jsx live drafts - Preview - Raw - Blame + Preview + Raw + Blame ``` @@ -70,9 +70,9 @@ description: Used to select an option from a short list and immediately apply th ```jsx live drafts - Preview - Raw - Blame + Preview + Raw + Blame ``` @@ -89,9 +89,9 @@ description: Used to select an option from a short list and immediately apply th - Preview - Raw - Blame + Preview + Raw + Blame ``` @@ -102,9 +102,9 @@ description: Used to select an option from a short list and immediately apply th File view - Preview - Raw - Blame + Preview + Raw + Blame Change the way the file is viewed @@ -114,9 +114,9 @@ description: Used to select an option from a short list and immediately apply th ```jsx live drafts - Preview - Raw - Blame + Preview + Raw + Blame ``` @@ -129,9 +129,9 @@ description: Used to select an option from a short list and immediately apply th alert(`Segment ${selectedIndex}`) }} > - Preview - Raw - Blame + Preview + Raw + Blame ``` @@ -152,7 +152,7 @@ description: Used to select an option from a short list and immediately apply th /> -### SegmentedControl.Item +### SegmentedControl.Button @@ -160,7 +160,7 @@ description: Used to select an option from a short list and immediately apply th -### SegmentedControl.IconItem +### SegmentedControl.IconButton From c754dfd79eee47642a30390fb94af21fa8ecfabd Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Mon, 23 May 2022 12:21:13 -0400 Subject: [PATCH 3/7] changes 'block' prop name to 'fullWidth --- docs/content/SegmentedControl.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/SegmentedControl.mdx b/docs/content/SegmentedControl.mdx index f3b134ce3d7..d4f4bd0de96 100644 --- a/docs/content/SegmentedControl.mdx +++ b/docs/content/SegmentedControl.mdx @@ -59,7 +59,7 @@ description: Used to select an option from a short list and immediately apply th ### Fill width of parent ```jsx live drafts - + Preview Raw Blame @@ -143,7 +143,7 @@ description: Used to select an option from a short list and immediately apply th - + Date: Tue, 24 May 2022 10:57:07 -0400 Subject: [PATCH 4/7] Update docs/content/SegmentedControl.mdx Co-authored-by: Cole Bemis --- docs/content/SegmentedControl.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/SegmentedControl.mdx b/docs/content/SegmentedControl.mdx index d4f4bd0de96..c4f25fbaed8 100644 --- a/docs/content/SegmentedControl.mdx +++ b/docs/content/SegmentedControl.mdx @@ -1,7 +1,7 @@ --- title: SegmentedControl status: Draft -description: Used to select an option from a short list and immediately apply the selection +description: Use a segmented control to let users select an option from a short list and immediately apply the selection --- ## Examples From 266bce99d7ce971195a4bc826208f9a41e90e4fb Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Tue, 24 May 2022 10:57:15 -0400 Subject: [PATCH 5/7] Update docs/content/SegmentedControl.mdx Co-authored-by: Cole Bemis --- docs/content/SegmentedControl.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/SegmentedControl.mdx b/docs/content/SegmentedControl.mdx index c4f25fbaed8..4a7ea83aef8 100644 --- a/docs/content/SegmentedControl.mdx +++ b/docs/content/SegmentedControl.mdx @@ -4,6 +4,8 @@ status: Draft description: Use a segmented control to let users select an option from a short list and immediately apply the selection --- +Not implemented yet + ## Examples ### Simple From 07d1382008e1a29ea56fafb7b1561e09baaa1a51 Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Tue, 24 May 2022 11:01:01 -0400 Subject: [PATCH 6/7] Update docs/content/SegmentedControl.mdx Co-authored-by: Cole Bemis --- docs/content/SegmentedControl.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/SegmentedControl.mdx b/docs/content/SegmentedControl.mdx index 4a7ea83aef8..2092235ce06 100644 --- a/docs/content/SegmentedControl.mdx +++ b/docs/content/SegmentedControl.mdx @@ -160,6 +160,8 @@ description: Use a segmented control to let users select an option from a short + + ### SegmentedControl.IconButton From 0272eaddcf1b4234a9187a932343d404396e802c Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Wed, 25 May 2022 12:29:53 -0400 Subject: [PATCH 7/7] addresses remainder of PR feedback --- docs/content/SegmentedControl.mdx | 47 ++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/docs/content/SegmentedControl.mdx b/docs/content/SegmentedControl.mdx index 2092235ce06..4da191647e2 100644 --- a/docs/content/SegmentedControl.mdx +++ b/docs/content/SegmentedControl.mdx @@ -12,7 +12,7 @@ description: Use a segmented control to let users select an option from a short ```jsx live drafts - Preview + Preview Raw Blame @@ -22,7 +22,9 @@ description: Use a segmented control to let users select an option from a short ```jsx live drafts - Preview + + Preview + Raw Blame @@ -32,7 +34,7 @@ description: Use a segmented control to let users select an option from a short ```jsx live drafts - + @@ -42,9 +44,11 @@ description: Use a segmented control to let users select an option from a short ```jsx live drafts - Preview - Raw - Blame + + Preview + + Raw + Blame ``` @@ -52,9 +56,11 @@ description: Use a segmented control to let users select an option from a short ```jsx live drafts - Preview - Raw - Blame + + Preview + + Raw + Blame ``` @@ -62,7 +68,7 @@ description: Use a segmented control to let users select an option from a short ```jsx live drafts - Preview + Preview Raw Blame @@ -72,7 +78,7 @@ description: Use a segmented control to let users select an option from a short ```jsx live drafts - Preview + Preview Raw Blame @@ -91,7 +97,7 @@ description: Use a segmented control to let users select an option from a short - Preview + Preview Raw Blame @@ -104,7 +110,7 @@ description: Use a segmented control to let users select an option from a short File view - Preview + Preview Raw Blame @@ -116,7 +122,7 @@ description: Use a segmented control to let users select an option from a short ```jsx live drafts - Preview + Preview Raw Blame @@ -152,6 +158,17 @@ description: Use a segmented control to let users select an option from a short type="(selectedIndex?: number) => void" description="The handler that gets called when a segment is selected" /> + + + ### SegmentedControl.Button @@ -170,6 +187,8 @@ description: Use a segmented control to let users select an option from a short + + ## Status