(
ref={ref}
onChange={() => null}
/>
-
+
+
+ { props.description && (
+ { props.description }
+ )}
+
- ));
+));
/* eslint-enable react/prop-types */
export default Option;
diff --git a/src/Select/Option.scss b/src/Select/Option.scss
index 923c13c5..57ec252b 100644
--- a/src/Select/Option.scss
+++ b/src/Select/Option.scss
@@ -5,4 +5,19 @@
.Checkbox {
margin-right: var(--synth-spacing-3);
}
+
+ .TitleDescriptionContainer {
+ display: flex;
+ flex-direction: column;
+
+ .Label {
+ &--bold {
+ font-weight: var(--synth-font-weight-bold);
+ }
+ }
+
+ .Description {
+ color: var(--ux-gray-800);
+ }
+ }
}
diff --git a/src/Select/SingleSelect.stories.jsx b/src/Select/SingleSelect.stories.jsx
index fc6a4a0e..3190f311 100644
--- a/src/Select/SingleSelect.stories.jsx
+++ b/src/Select/SingleSelect.stories.jsx
@@ -20,10 +20,26 @@ export default {
};
const options = [
- { label: '1-on-1 interview', value: 1 },
- { label: 'Focus group', value: 2 },
- { label: 'Multi-day study', value: 3 },
- { label: 'Unmoderated task', value: 4 },
+ {
+ label: '1-on-1 interview',
+ value: 1,
+ description: 'Interviews are typically a conversation between you and a researcher.',
+ },
+ {
+ label: 'Focus group',
+ value: 2,
+ description: 'Focus groups involve interacting with a small group of your peers.',
+ },
+ {
+ label: 'Multi-day study',
+ value: 3,
+ description: 'Diary and multiday studies are days or weeks long commitments.',
+ },
+ {
+ label: 'Unmoderated task',
+ value: 4,
+ description: 'An unmoderated task is just that—an opportunity for a user to try out a product, app, website, etc and share feedback.',
+ },
];
const peopleOptions = [
@@ -168,6 +184,32 @@ export const GroupedOptions = () => {
);
};
+export const CustomOptionWithDescriptionAndCheckbox = () => (
+
+ (
+
+ ),
+ }}
+ inputId="custom-option-with-description-select"
+ options={options}
+ onChange={onChange}
+ />
+
+);
+
+/**
+ If you're adding a new code, prefer the use of `Option` with a `description` prop.
+ `OptionWithDescription` is effectively deprecated and will be merged into `Option`.
+ */
export const CustomOptionWithDescription = () => {
const optionsWithDescriptions = [
{