Skip to content

Commit 5717e32

Browse files
committed
docs(storybook): document the label slot
1 parent ef92987 commit 5717e32

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

packages/uui-radio/lib/uui-radio-group.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const SPACE = ' ';
1515

1616
/**
1717
* @element uui-radio-group
18-
* @slot for uui-radio elements
18+
* @slot default - slot for `<uui-radio>` elements or custom elements that extend from `UUIRadioElement`
1919
*/
2020
@defineElement('uui-radio-group')
2121
export class UUIRadioGroupElement extends FormControlMixin(LitElement) {

packages/uui-radio/lib/uui-radio.element.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { html, css, LitElement } from 'lit';
2-
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
3-
import { query, property } from 'lit/decorators.js';
41
import {
5-
UUIHorizontalShakeKeyframes,
62
UUIHorizontalShakeAnimationValue,
3+
UUIHorizontalShakeKeyframes,
74
} from '@umbraco-ui/uui-base/lib/animations';
5+
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
6+
import { css, html, LitElement } from 'lit';
7+
import { property, query } from 'lit/decorators.js';
8+
89
import { UUIRadioEvent } from './UUIRadioEvent';
910

1011
/**
1112
* @element uui-radio
1213
* @description - a single radio, should never be use as a stand-alone. Must be wrapped in `<uui-radio-group></uui-radio-group>` element.
13-
* @slot - for label
14-
* @cssprop --uui-radio-button-size - Sets the size of the radio button.
15-
* @fires change - on input change
16-
*
14+
* @slot default - slot to set the label if no `label` attribute is set.
15+
* @cssprop --uui-radio-button-size - Sets the size of the radio button.
16+
* @fires change - on input change
1717
*/
1818
@defineElement('uui-radio')
1919
export class UUIRadioElement extends LitElement {

packages/uui-radio/lib/uui-radio.story.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export default {
1212
checked: false,
1313
disabled: false,
1414
},
15+
argTypes: {
16+
default: { control: { type: 'text' } },
17+
},
1518
};
1619

1720
export const AAAOverview: Story = props =>
@@ -21,13 +24,21 @@ export const AAAOverview: Story = props =>
2124
.name=${props.name}
2225
?disabled=${props.disabled}
2326
?checked=${props.checked}
24-
>Label</uui-radio
27+
>${props.default}</uui-radio
2528
>`;
2629
AAAOverview.storyName = 'Overview';
2730
AAAOverview.parameters = {
2831
docs: {
2932
source: {
30-
code: `Copy from GroupedOverview story`,
33+
code: `<uui-radio-group name="Test">
34+
<uui-radio value="Value 1" disabled>Option 1</uui-radio>
35+
<uui-radio value="Value 2" label="Option 2"></uui-radio>
36+
<uui-radio value="Value 3">Option 3</uui-radio>
37+
<uui-radio value="Value 4" disabled>Option 4</uui-radio>
38+
<uui-radio value="Value 5" checked>Option 5</uui-radio>
39+
<uui-radio value="Value 6">Option 6</uui-radio>
40+
<uui-radio value="Value 7" disabled>Option 7</uui-radio>
41+
</uui-radio-group>`,
3142
},
3243
},
3344
};

0 commit comments

Comments
 (0)