Skip to content

Commit 28cccec

Browse files
laurensuhSang Kyung Suh
andauthored
feat (radio-group): add in tooltip example (#5029)
* feat (radio-group): add in tooltip example * fix(radio-group): Add in example with tooltip * fix(radio-group): Add padding-top for tooltip Co-authored-by: Sang Kyung Suh <[email protected]>
1 parent 8b65af3 commit 28cccec

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#### Added
4949
- Added styling changes to support radio group with help text icon.
5050
- Added examples: Required with help text icon and Right to left required with help text icon to documentation
51+
- Added required with help text icon and tooltip example
5152
#### Fixed
5253
- Right to left legend to be right aligned and match the alignment of content.
5354

ui/components/radio-group/RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- Added styling changes to support radio group with help text icon.
1212
- Added examples: Required with help text icon and Right to left required with help text icon to documentation
13+
- Added required with help text icon and tooltip example
1314

1415
### Fixed
1516

ui/components/radio-group/base/example.jsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import React from 'react';
55
import PropTypes from 'prop-types';
66
import classNames from 'classnames';
77
import _ from '../../../shared/helpers';
8-
import { FormElementControl } from '../../form-element/';
8+
import { FormElementControl, FormElementTooltip } from '../../form-element/';
99
import ButtonIcon from '../../button-icons/';
1010

11-
1211
/// ////////////////////////////////////////
1312
// Partial(s)
1413
/// ////////////////////////////////////////
@@ -215,6 +214,27 @@ export let states = [
215214
</Fieldset>
216215
)
217216
},
217+
{
218+
id: 'required-help-text-icon-tooltip',
219+
label: 'Required with Help Text Icon with Tooltip',
220+
demoStyles: 'padding-top: 4rem',
221+
storybookStyles: true,
222+
element: (
223+
<Fieldset>
224+
<Legend>
225+
<abbr className="slds-required" title="required">
226+
*
227+
</abbr>{' '}
228+
Radio Group Label
229+
</Legend>
230+
<FormElementTooltip showTooltip="true" />
231+
<FormElementControl>
232+
<Radio checked label="Radio Label One" />
233+
<Radio label="Radio Label Two" />
234+
</FormElementControl>
235+
</Fieldset>
236+
)
237+
},
218238
{
219239
id: 'rtl',
220240
label: 'Right to Left',

ui/components/radio-group/docs.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import CodeView from '../../../shared/components/CodeView';
22
import DisplayColumn from '../../../shared/components/DisplayColumn';
33
import DisplayGrid from '../../../shared/components/DisplayGrid';
44
import Blockquote from '../../../shared/components/Blockquote';
5-
import { getDisplayElementById } from '../../shared/helpers';
5+
import { getDisplayElementById, getDemoStylesById } from '../../shared/helpers';
66
import { MobileNotice, MobileBlurb } from '../../shared/doc-text';
77
import * as Base from './base/example';
88
import StylingHooksTable from '../../../shared/components/StylingHooksTable';
@@ -63,6 +63,12 @@ When disabling a radio button, either the entire group must be disabled or if on
6363

6464
<CodeView>{getDisplayElementById(Base.states, 'required-help-text-icon')}</CodeView>
6565

66+
### Required with Help Text Icon and Tooltip
67+
68+
<CodeView demoStyles={getDemoStylesById(Base.states, 'required-help-text-icon-tooltip')}>
69+
{getDisplayElementById(Base.states, 'required-help-text-icon-tooltip')}
70+
</CodeView>
71+
6672
### Right to Left
6773

6874
<CodeView>{getDisplayElementById(Base.states, 'rtl')}</CodeView>

0 commit comments

Comments
 (0)