Skip to content

Commit fb7b93b

Browse files
Merge branch 'main' into feat/disable-wheel-prop
2 parents 50780f9 + ad3b045 commit fb7b93b

File tree

12 files changed

+164
-292
lines changed

12 files changed

+164
-292
lines changed

docs/migration/v11.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ const { white, g10, g90, g100 } = v10;
18821882
| inverse-01 | icon-inverse || Split |
18831883
| inverse-01 | focus-inset || Split |
18841884
| inverse-01 | text-inverse || Split |
1885-
| inverse-02 | "background-inverse " || Updated |
1885+
| inverse-02 | background-inverse || Updated |
18861886
| inverse-focus-ui | focus-inverse || Updated |
18871887
| inverse-hover-ui | background-inverse-hover || Updated |
18881888
| inverse-link | link-inverse || Updated |

packages/react/src/components/AspectRatio/AspectRatio-story.js

Lines changed: 0 additions & 75 deletions
This file was deleted.

packages/react/src/components/AspectRatio/AspectRatio.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Story, Props, Source, Preview } from '@storybook/addon-docs';
22
import { Grid, Row, Column } from '../Grid';
3-
import { AspectRatio } from '../AspectRatio';
3+
import { AspectRatio } from '.';
44

55
# AspectRatio
66

@@ -28,7 +28,7 @@ spanning 100% of the space available in your layout, and the height will be
2828
determined by the ratio that you specified.
2929

3030
<Preview>
31-
<Story id="components-aspectratio--aspect-ratio-story" />
31+
<Story id="components-aspectratio--default" />
3232
</Preview>
3333

3434
To see the full list of ratios supported by the `ratio` prop, check out the prop

packages/react/src/components/AspectRatio/next/AspectRatio.stories.js renamed to packages/react/src/components/AspectRatio/AspectRatio.stories.js

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import '../AspectRatio-story.scss';
8+
import './AspectRatio-story.scss';
99

1010
import React from 'react';
11-
import { Grid, Column } from '../../Grid';
12-
import { AspectRatio } from '../';
13-
import mdx from '../AspectRatio.mdx';
11+
import { Grid, Column } from '../Grid';
12+
import { AspectRatio } from './';
13+
import mdx from './AspectRatio.mdx';
1414

1515
export default {
1616
title: 'Components/AspectRatio',
@@ -49,33 +49,9 @@ export const Default = () => {
4949
};
5050

5151
export const Playground = {
52-
argTypes: {
53-
as: {
54-
control: {
55-
type: null,
56-
},
57-
},
58-
children: {
59-
control: {
60-
type: null,
61-
},
62-
},
63-
className: {
64-
control: {
65-
type: null,
66-
},
67-
},
68-
ratio: {
69-
control: {
70-
type: 'select',
71-
},
72-
defaultValue: '1x1',
73-
options: ['16x9', '9x16', '2x1', '1x2', '4x3', '3x4', '1x1'],
74-
},
75-
},
76-
render: ({ ratio }) => {
52+
render: ({ ratio }, ...args) => {
7753
return (
78-
<Grid>
54+
<Grid {...args}>
7955
<Column sm={1} md={2} lg={4}>
8056
<AspectRatio ratio={ratio}>Content</AspectRatio>
8157
</Column>
@@ -92,3 +68,28 @@ export const Playground = {
9268
);
9369
},
9470
};
71+
72+
Playground.argTypes = {
73+
as: {
74+
table: {
75+
disable: true,
76+
},
77+
},
78+
children: {
79+
table: {
80+
disable: true,
81+
},
82+
},
83+
className: {
84+
table: {
85+
disable: true,
86+
},
87+
},
88+
ratio: {
89+
control: {
90+
type: 'select',
91+
},
92+
defaultValue: '1x1',
93+
options: ['16x9', '9x16', '2x1', '1x2', '4x3', '3x4', '1x1'],
94+
},
95+
};

packages/react/src/components/FluidTextInput/__tests__/FluidTextInput-test.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ describe('FluidTextInput', () => {
284284
it('should respect readOnly prop', () => {
285285
const onChange = jest.fn();
286286
const onClick = jest.fn();
287-
const { container } = render(
287+
render(
288288
<FluidTextInput
289289
id="input-1"
290290
labelText="FluidTextInput label"
@@ -302,12 +302,6 @@ describe('FluidTextInput', () => {
302302
userEvent.type(screen.getByRole('textbox'), 'x');
303303
expect(screen.getByRole('textbox')).not.toHaveValue('x');
304304
expect(onChange).toHaveBeenCalledTimes(0);
305-
306-
// Should display the "read-only" icon
307-
const icon = container.querySelector(
308-
`svg.${prefix}--text-input__readonly-icon`
309-
);
310-
expect(icon).toBeInTheDocument();
311305
});
312306
});
313307
});

packages/react/src/components/FormGroup/FormGroup-story.js

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/**
2+
* Copyright IBM Corp. 2016, 2018
3+
*
4+
* This source code is licensed under the Apache-2.0 license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import React from 'react';
9+
import FormGroup from '../FormGroup';
10+
import TextInput from '../TextInput';
11+
import RadioButtonGroup from '../RadioButtonGroup';
12+
import RadioButton from '../RadioButton';
13+
import Button from '../Button';
14+
import { Stack } from '../Stack';
15+
16+
export default {
17+
title: 'Components/FormGroup',
18+
component: FormGroup,
19+
argTypes: {
20+
legendId: {
21+
table: {
22+
disable: true,
23+
},
24+
},
25+
className: {
26+
table: {
27+
disable: true,
28+
},
29+
},
30+
invalid: {
31+
table: {
32+
disable: true,
33+
},
34+
},
35+
children: {
36+
table: {
37+
disable: true,
38+
},
39+
},
40+
},
41+
};
42+
43+
export const Default = () => (
44+
<FormGroup style={{ maxWidth: '400px' }} legendText="FormGroup Legend">
45+
<Stack gap={7}>
46+
<TextInput id="one" labelText="First Name" />
47+
<TextInput id="two" labelText="Last Name" />
48+
<RadioButtonGroup
49+
legendText="Radio button heading"
50+
name="radio-button-group"
51+
defaultSelected="radio-1">
52+
<RadioButton labelText="Option 1" value="radio-1" id="radio-1" />
53+
<RadioButton labelText="Option 2" value="radio-2" id="radio-2" />
54+
<RadioButton labelText="Option 3" value="radio-3" id="radio-3" />
55+
</RadioButtonGroup>
56+
<Button>Submit</Button>
57+
</Stack>
58+
</FormGroup>
59+
);
60+
61+
export const Playground = (args) => (
62+
<FormGroup style={{ maxWidth: '400px' }} {...args}>
63+
<Stack gap={7}>
64+
<TextInput id="one" labelText="First Name" />
65+
<TextInput id="two" labelText="Last Name" />
66+
<RadioButtonGroup
67+
legendText="Radio button heading"
68+
name="radio-button-group"
69+
defaultSelected="radio-1">
70+
<RadioButton labelText="Option 1" value="radio-1" id="radio-1" />
71+
<RadioButton labelText="Option 2" value="radio-2" id="radio-2" />
72+
<RadioButton labelText="Option 3" value="radio-3" id="radio-3" />
73+
</RadioButtonGroup>
74+
<Button>Submit</Button>
75+
</Stack>
76+
</FormGroup>
77+
);
78+
79+
Playground.argTypes = {
80+
legendId: {
81+
control: {
82+
type: 'text',
83+
},
84+
},
85+
legendText: {
86+
control: {
87+
type: 'text',
88+
},
89+
},
90+
message: {
91+
control: {
92+
type: 'boolean',
93+
},
94+
defaultValue: false,
95+
},
96+
messageText: {
97+
control: {
98+
type: 'text',
99+
},
100+
},
101+
};
102+
103+
Playground.args = {
104+
legendId: 'form-group-1',
105+
legendText: 'FormGroup Legend',
106+
};

0 commit comments

Comments
 (0)