Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit bdb3f43

Browse files
Ari ChivukulaMatt Goo
Ari Chivukula
authored and
Matt Goo
committed
chore: Re-Build Lock File (#939)
1 parent e222e94 commit bdb3f43

File tree

18 files changed

+5046
-9251
lines changed

18 files changed

+5046
-9251
lines changed

package-lock.json

+5,005-9,206
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
"@types/mocha": "^5.2.7",
101101
"@types/prop-types": "^15.5.6",
102102
"@types/puppeteer": "^1.11.1",
103-
"@types/react": "^16.4.4",
104-
"@types/react-dom": "^16.0.11",
103+
"@types/react": "~16.7.22",
104+
"@types/react-dom": "~16.0.11",
105105
"@types/react-is": "^16.7.1",
106106
"@types/react-router-dom": "^4.3.1",
107107
"@types/uuid": "^3.4.4",
@@ -153,8 +153,8 @@
153153
"postcss-loader": "^3.0.0",
154154
"prettier": "^1.17.1",
155155
"puppeteer": "^1.17.0",
156-
"react": "^16.4.2",
157-
"react-dom": "^16.4.2",
156+
"react": "~16.7.0",
157+
"react-dom": "~16.7.0",
158158
"react-router-dom": "^4.3.1",
159159
"remap-istanbul": "^0.12.0",
160160
"resemblejs": "^3.0.1",

packages/button/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const Button = <T extends ButtonTypes>({
7676

7777
if (href) {
7878
return (
79-
<a {...props as React.HTMLProps<HTMLAnchorElement>} href={href}>
79+
<a {...(props as React.HTMLProps<HTMLAnchorElement>)} href={href}>
8080
{!trailingIcon ? renderIcon(icon) : null}
8181
<span className={CSS_CLASSES.LABEL}>{children}</span>
8282
{trailingIcon ? renderIcon(trailingIcon) : null}
@@ -85,7 +85,7 @@ export const Button = <T extends ButtonTypes>({
8585
}
8686

8787
return (
88-
<button {...props as React.HTMLProps<HTMLButtonElement>}>
88+
<button {...(props as React.HTMLProps<HTMLButtonElement>)}>
8989
{!trailingIcon ? renderIcon(icon) : null}
9090
<span className={CSS_CLASSES.LABEL}>{children}</span>
9191
{trailingIcon ? renderIcon(trailingIcon) : null}

packages/chips/Chip.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class Chip extends React.Component<ChipProps, ChipState> {
6969
shouldRemoveOnTrailingIconClick: true,
7070
};
7171

72-
state = {
72+
state: ChipState = {
7373
classList: new Set(),
7474
leadingIconClassList: new Set(),
7575
};

packages/icon-button/index.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,12 @@ class IconButtonBase<T extends IconButtonTypes> extends React.Component<
134134
...otherProps,
135135
};
136136
if (isLink) {
137-
return <a {...props as IconButtonProps<HTMLAnchorElement>}>{children}</a>;
137+
return (
138+
<a {...(props as IconButtonProps<HTMLAnchorElement>)}>{children}</a>
139+
);
138140
}
139141
return (
140-
<button {...props as IconButtonProps<HTMLButtonElement>}>
142+
<button {...(props as IconButtonProps<HTMLButtonElement>)}>
141143
{children}
142144
</button>
143145
);

packages/layout-grid/Cell.tsx

+3-9
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,9 @@ const Cell: <T extends {} = HTMLDivElement>(
5959
[`${CSS_CLASSES.CELL_ALIGN}-${align}`]: !!align,
6060
[`${CSS_CLASSES.CELL_ORDER}-${order}`]: !!order,
6161
[`${CSS_CLASSES.CELL_SPAN}-${columns}`]: !!columns,
62-
[`${CSS_CLASSES.CELL_SPAN}-${desktopColumns}-${
63-
DEVICE_TYPE.DESKTOP
64-
}`]: !!desktopColumns,
65-
[`${CSS_CLASSES.CELL_SPAN}-${phoneColumns}-${
66-
DEVICE_TYPE.PHONE
67-
}`]: !!phoneColumns,
68-
[`${CSS_CLASSES.CELL_SPAN}-${tabletColumns}-${
69-
DEVICE_TYPE.TABLET
70-
}`]: !!tabletColumns,
62+
[`${CSS_CLASSES.CELL_SPAN}-${desktopColumns}-${DEVICE_TYPE.DESKTOP}`]: !!desktopColumns,
63+
[`${CSS_CLASSES.CELL_SPAN}-${phoneColumns}-${DEVICE_TYPE.PHONE}`]: !!phoneColumns,
64+
[`${CSS_CLASSES.CELL_SPAN}-${tabletColumns}-${DEVICE_TYPE.TABLET}`]: !!tabletColumns,
7165
});
7266

7367
return (

packages/ripple/index.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {Subtract} from 'utility-types'; // eslint-disable-line @typescript-eslin
2626
import {MDCRippleFoundation} from '@material/ripple/foundation';
2727
import {MDCRippleAdapter} from '@material/ripple/adapter';
2828
import {supportsCssVariables, applyPassive} from '@material/ripple/util';
29-
import {SpecificEventListener} from '@material/base/types';
29+
import {EventType, SpecificEventListener} from '@material/base/types';
3030
import {matches} from '@material/dom/ponyfill';
3131

3232
export interface RippledComponentProps<T> {
@@ -197,18 +197,18 @@ export function withRipple<
197197
classList.delete(className);
198198
this.setState({classList});
199199
},
200-
registerDocumentInteractionHandler: (
201-
evtType: string,
202-
handler: EventListener
200+
registerDocumentInteractionHandler: <K extends EventType>(
201+
evtType: K,
202+
handler: SpecificEventListener<K>
203203
) =>
204204
document.documentElement.addEventListener(
205205
evtType,
206206
handler,
207207
applyPassive()
208208
),
209-
deregisterDocumentInteractionHandler: (
210-
evtType: string,
211-
handler: EventListener
209+
deregisterDocumentInteractionHandler: <K extends EventType>(
210+
evtType: K,
211+
handler: SpecificEventListener<K>
212212
) =>
213213
document.documentElement.removeEventListener(
214214
evtType,
@@ -324,6 +324,7 @@ export function withRipple<
324324
if (value === null) {
325325
delete updatedStyle[varName as keyof React.CSSProperties];
326326
} else {
327+
// @ts-ignore CSS values now strongly typed
327328
updatedStyle[varName as keyof React.CSSProperties] = value;
328329
}
329330

packages/select/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ export default class Select<
379379
foundation={this.state.foundation}
380380
className={selectClassName}
381381
{...(enhanced ? enhancedProps : {})}
382-
{...otherProps as BaseSelectProps<T>}
382+
{...(otherProps as BaseSelectProps<T>)}
383383
>
384384
{this.renderOptions()}
385385
</BaseSelect>

packages/snackbar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class Snackbar extends React.Component<Props, State> {
5959
constructor(props: Props) {
6060
super(props);
6161
const {timeoutMs, closeOnEscape, leading, stacked} = this.props;
62-
const classes = new Set();
62+
const classes = new Set<string>();
6363
if (leading) {
6464
classes.add('mdc-snackbar--leading');
6565
}

packages/tab-indicator/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ export default class TabIndicator extends React.Component<
187187
}
188188

189189
addContentClassesToChildren = () => {
190-
const child = React.Children.only(this.props.children);
190+
const child = React.Children.only(
191+
this.props.children
192+
) as React.ReactElement<any>;
191193
const className = classnames(child.props.className, this.contentClasses);
192194
const props = Object.assign({}, child.props, {className});
193195
return React.cloneElement(child, props);

packages/text-field/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ class TextField<
373373
}
374374

375375
renderInput() {
376-
const child: React.ReactElement<InputProps<T>> = React.Children.only(
376+
const child = React.Children.only(
377377
this.props.children
378-
);
378+
) as React.ReactElement<InputProps<T>>;
379379
return React.cloneElement(child, this.inputProps);
380380
}
381381

packages/top-app-bar/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class TopAppBar<
174174
{},
175175
this.state.style
176176
) as React.CSSProperties;
177+
// @ts-ignore CSS values now strongly typed
177178
updatedStyle[varName] = value;
178179
this.setState({style: updatedStyle});
179180
},

test/unit/dialog/index.test.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,7 @@ test('#adapter.getActionFromEvent returns null when attribute is not present', (
344344
assert.isNull(action);
345345
});
346346

347-
test(`#adapter.clickDefaultButton invokes click() on button matching ${
348-
cssClasses.DEFAULT_BUTTON
349-
}`, () => {
347+
test(`#adapter.clickDefaultButton invokes click() on button matching ${cssClasses.DEFAULT_BUTTON}`, () => {
350348
const wrapper = mount<Dialog>(
351349
<Dialog>
352350
<DialogContent>
@@ -367,9 +365,7 @@ test(`#adapter.clickDefaultButton invokes click() on button matching ${
367365
td.verify(defaultButton.click(), {times: 1});
368366
});
369367

370-
test(`#adapter.clickDefaultButton does nothing if no button matches ${
371-
cssClasses.DEFAULT_BUTTON
372-
}`, () => {
368+
test(`#adapter.clickDefaultButton does nothing if no button matches ${cssClasses.DEFAULT_BUTTON}`, () => {
373369
const wrapper = mount<Dialog>(DialogStub);
374370
const buttons = wrapper.instance().buttons!;
375371
buttons.map(

test/unit/floating-label/index.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ test(
105105

106106
test('on animationend should remove the shake class', () => {
107107
const wrapper = mount(<FloatingLabel />);
108-
const classList = new Set();
108+
const classList = new Set<string>();
109109
classList.add('mdc-floating-label--shake');
110110
wrapper.setState({classList});
111111
wrapper.simulate('animationEnd');
@@ -120,7 +120,7 @@ test('#adapter.addClass', () => {
120120

121121
test('#adapter.removeClass', () => {
122122
const wrapper = mount<FloatingLabel>(<FloatingLabel />);
123-
const classList = new Set();
123+
const classList = new Set<string>();
124124
classList.add('test-class-name');
125125
wrapper.setState({classList});
126126
assert.isTrue(wrapper.state().classList.has('test-class-name'));

test/unit/line-ripple/index.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ test('#adapter.addClass updates state.classList', () => {
8888

8989
test('#adapter.removeClass updates state.classList', () => {
9090
const wrapper = shallow<LineRipple>(<LineRipple />);
91-
const classList = new Set();
91+
const classList = new Set<string>();
9292
classList.add('test-color-class');
9393
wrapper.setState({classList});
9494
getAdapter(wrapper.instance()).removeClass('test-color-class');
@@ -97,7 +97,7 @@ test('#adapter.removeClass updates state.classList', () => {
9797

9898
test('#adapter.hasClass returns true if exists in classList', () => {
9999
const wrapper = shallow<LineRipple>(<LineRipple />);
100-
const classList = new Set();
100+
const classList = new Set<string>();
101101
classList.add('test-color-class');
102102
wrapper.setState({classList});
103103
const hasClass = getAdapter(wrapper.instance()).hasClass('test-color-class');

test/unit/ripple/index.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ test('#adapter.deregisterDocumentInteractionHandler does not trigger handler on
399399

400400
test('#adapter.registerResizeHandler triggers handler on window resize', () => {
401401
const wrapper = mount<DivProps>(<DivRipple />);
402-
const testHandler = td.func<SpecificEventListener<'scroll'>>();
402+
const testHandler = td.func<SpecificEventListener<'resize'>>();
403403
getAdapter(
404404
coerceForTesting<RippledComponent>(wrapper.instance()).foundation
405405
).registerResizeHandler(testHandler);
@@ -412,7 +412,7 @@ test(
412412
'after registering resize handler',
413413
() => {
414414
const wrapper = mount<DivProps>(<DivRipple />);
415-
const testHandler = td.func<SpecificEventListener<'scroll'>>();
415+
const testHandler = td.func<SpecificEventListener<'resize'>>();
416416
getAdapter(
417417
coerceForTesting<RippledComponent>(wrapper.instance()).foundation
418418
).registerResizeHandler(testHandler);

test/unit/text-field/helper-text/index.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ test('#adapter.addClass updates state.classList', () => {
140140

141141
test('#adapter.removeClass updates state.classList', () => {
142142
const wrapper = shallow<HelperText>(<HelperText>Helper Text</HelperText>);
143-
const classList = new Set();
143+
const classList = new Set<string>();
144144
classList.add('test-class-name');
145145
wrapper.setState({classList});
146146
wrapper.instance().adapter.removeClass('test-class-name');

test/unit/text-field/index.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ test('#adapter.removeClass removes class from state.classList', () => {
149149
<Input />
150150
</TextField>
151151
);
152-
const classList = new Set();
152+
const classList = new Set<string>();
153153
classList.add('test-class-name');
154154
wrapper.setState({classList});
155155
wrapper.instance().adapter.removeClass('test-class-name');
@@ -162,7 +162,7 @@ test('#adapter.removeClass removes class from state.classList', () => {
162162
<Input />
163163
</TextField>
164164
);
165-
const classList = new Set();
165+
const classList = new Set<string>();
166166
classList.add('test-class-name');
167167
wrapper.setState({classList});
168168
assert.isTrue(wrapper.instance().adapter.hasClass('test-class-name'));

0 commit comments

Comments
 (0)