Skip to content

Commit 7fb1c23

Browse files
committed
feat: add IELoading component
Animated GIF component showing the classic Internet Explorer HTTP loading animation extracted from the original IE source. The GIF asset is shipped in dist/images/IELoading.gif and the component accepts a src prop for the consumer to provide the path. Adapted from upstream PR react95-io#388 (credit @Puzovoz and @Montty666).
1 parent eb97ed1 commit 7fb1c23

10 files changed

Lines changed: 83 additions & 0 deletions

File tree

dist/IELoading/IELoading.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import { CommonStyledProps } from '../types';
3+
type IELoadingProps = {
4+
src?: string;
5+
width?: number;
6+
} & Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'width'> & CommonStyledProps;
7+
declare const IELoading: React.ForwardRefExoticComponent<{
8+
src?: string | undefined;
9+
width?: number | undefined;
10+
} & Omit<React.ImgHTMLAttributes<HTMLImageElement>, "width"> & CommonStyledProps & React.RefAttributes<HTMLImageElement>>;
11+
export { IELoading, IELoadingProps };
12+
//# sourceMappingURL=IELoading.d.ts.map

dist/IELoading/IELoading.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
Object.defineProperty(exports, '__esModule', { value: true });
4+
5+
var React = require('react');
6+
var styled = require('styled-components');
7+
8+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9+
10+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12+
13+
const StyledImg = styled__default["default"].img`
14+
width: ${({ $width }) => $width}px;
15+
height: auto;
16+
`;
17+
const IELoading = React.forwardRef(({ width = 250, ...otherProps }, ref) => {
18+
return React__default["default"].createElement(StyledImg, { ref, alt: "Loading", "$width": width, ...otherProps });
19+
});
20+
IELoading.displayName = "IELoading";
21+
22+
exports.IELoading = IELoading;

dist/IELoading/IELoading.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React__default, { forwardRef } from 'react';
2+
import styled from 'styled-components';
3+
4+
const StyledImg = styled.img`
5+
width: ${({ $width }) => $width}px;
6+
height: auto;
7+
`;
8+
const IELoading = forwardRef(({ width = 250, ...otherProps }, ref) => {
9+
return React__default.createElement(StyledImg, { ref, alt: "Loading", "$width": width, ...otherProps });
10+
});
11+
IELoading.displayName = "IELoading";
12+
13+
export { IELoading };

dist/images/IELoading.gif

115 KB
Loading

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export * from './Frame/Frame';
1212
export * from './GroupBox/GroupBox';
1313
export * from './Handle/Handle';
1414
export * from './Hourglass/Hourglass';
15+
export * from './IELoading/IELoading';
1516
export * from './MenuList/MenuList';
1617
export * from './Monitor/Monitor';
1718
export * from './NumberInput/NumberInput';

dist/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var Frame = require('./Frame/Frame.js');
1616
var GroupBox = require('./GroupBox/GroupBox.js');
1717
var Handle = require('./Handle/Handle.js');
1818
var Hourglass = require('./Hourglass/Hourglass.js');
19+
var IELoading = require('./IELoading/IELoading.js');
1920
var MenuList = require('./MenuList/MenuList.js');
2021
var Monitor = require('./Monitor/Monitor.js');
2122
var NumberInput = require('./NumberInput/NumberInput.js');
@@ -74,6 +75,7 @@ exports.Frame = Frame.Frame;
7475
exports.GroupBox = GroupBox.GroupBox;
7576
exports.Handle = Handle.Handle;
7677
exports.Hourglass = Hourglass.Hourglass;
78+
exports.IELoading = IELoading.IELoading;
7779
exports.MenuList = MenuList.MenuList;
7880
exports.Monitor = Monitor.Monitor;
7981
exports.NumberInput = NumberInput.NumberInput;

dist/index.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export { Frame } from './Frame/Frame.mjs';
1212
export { GroupBox } from './GroupBox/GroupBox.mjs';
1313
export { Handle } from './Handle/Handle.mjs';
1414
export { Hourglass } from './Hourglass/Hourglass.mjs';
15+
export { IELoading } from './IELoading/IELoading.mjs';
1516
export { MenuList } from './MenuList/MenuList.mjs';
1617
export { Monitor } from './Monitor/Monitor.mjs';
1718
export { NumberInput } from './NumberInput/NumberInput.mjs';

src/IELoading/IELoading.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React, { forwardRef } from 'react';
2+
import styled from 'styled-components';
3+
import { CommonStyledProps } from '../types';
4+
5+
type IELoadingProps = {
6+
src?: string;
7+
width?: number;
8+
} & Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'width'> &
9+
CommonStyledProps;
10+
11+
const StyledImg = styled.img<{ $width: number }>`
12+
width: ${({ $width }) => $width}px;
13+
height: auto;
14+
`;
15+
16+
const IELoading = forwardRef<HTMLImageElement, IELoadingProps>(
17+
({ width = 250, ...otherProps }, ref) => {
18+
return (
19+
<StyledImg
20+
ref={ref}
21+
alt='Loading'
22+
$width={width}
23+
{...otherProps}
24+
/>
25+
);
26+
}
27+
);
28+
29+
IELoading.displayName = 'IELoading';
30+
31+
export { IELoading, IELoadingProps };

src/assets/images/IELoading.gif

115 KB
Loading

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export * from './Frame/Frame';
1515
export * from './GroupBox/GroupBox';
1616
export * from './Handle/Handle';
1717
export * from './Hourglass/Hourglass';
18+
export * from './IELoading/IELoading';
1819
export * from './MenuList/MenuList';
1920
export * from './Monitor/Monitor';
2021
export * from './NumberInput/NumberInput';

0 commit comments

Comments
 (0)