diff --git a/package.json b/package.json index a0dcc80f..ddd65bda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@user-interviews/ui-design-system", - "version": "3.2.3", + "version": "3.3.0", "dependencies": { "@tiptap/core": "^2.4.0", "@tiptap/extension-bold": "^2.4.0", diff --git a/scss/forms/form_group.scss b/scss/forms/form_group.scss index 6e8f8286..efed0f06 100644 --- a/scss/forms/form_group.scss +++ b/scss/forms/form_group.scss @@ -54,6 +54,10 @@ } } + &--no-margin { + margin: 0; + } + &__helper-text { @include synth-font-type-20; color: var(--ux-gray-900); diff --git a/src/FormGroup/FormGroup.mdx b/src/FormGroup/FormGroup.mdx index 17e261eb..0c1e1e7c 100644 --- a/src/FormGroup/FormGroup.mdx +++ b/src/FormGroup/FormGroup.mdx @@ -42,6 +42,12 @@ be beneficial to the user +### No margin + +- Remove the default margin on the FormGroup. + + + ### With Label Tooltip - Information users will typically only reference once (and then it's learned) or here and there. diff --git a/src/FormGroup/FormGroup.stories.tsx b/src/FormGroup/FormGroup.stories.tsx index a0467b5d..18f3911f 100644 --- a/src/FormGroup/FormGroup.stories.tsx +++ b/src/FormGroup/FormGroup.stories.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import { faSearch } from '@fortawesome/pro-solid-svg-icons'; +import { FlexContainer } from 'src/FlexContainer'; import FormGroup from '.'; import Input from '../Input'; import FormControlLabel from '../FormControlLabel'; @@ -56,6 +57,27 @@ export const Required = () => ( ); +export const NoMargin = () => ( + + + + + + + + +); + export const WithLabelTooltip = () => ( ( 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 = () => ( + + ( + +); + +/** + 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 = [ {