Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions examples/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ function SpinnerExamples() {
<button onClick={togglePicker}>Change Color</button>
)}
</div>

{Object.entries(Spinners).map(([name, loader]) => (
<LoaderItem key={`loader-${name}`} color={color} name={name} Spinner={loader} />
<LoaderItem
key={`loader-${name}`}
color={color}
name={name}
Spinner={loader as React.ComponentType<any>}
/>
))}
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions scripts/mod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def camelize(string)
" css = {},",
" #{props}",
" ...additionalprops",
"}: #{$1}): React.JSX.Element | null {"].join("\n")
"}: #{$1}) {"].join("\n")
end

content.sub!(/public static defaultProps = .+;/, "")
Expand All @@ -67,7 +67,7 @@ def camelize(string)
content.gsub!("css=", "style=")
content.gsub!("{this.", "{")

content.gsub!("public render(): React.JSX.Element | null {", "")
content.gsub!("public render() {", "")
content.gsub!(/}\n\s+}/, "}")

content.gsub!("return loading ? (", "if (!loading) { return null; }\n\n return (")
Expand Down
2 changes: 1 addition & 1 deletion src/BarLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function BarLoader({
height = 4,
width = 100,
...additionalprops
}: LoaderHeightWidthProps): React.JSX.Element | null {
}: LoaderHeightWidthProps) {
const wrapper: React.CSSProperties = {
display: "inherit",
position: "relative",
Expand Down
2 changes: 1 addition & 1 deletion src/BeatLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function BeatLoader({
size = 15,
margin = 2,
...additionalprops
}: LoaderSizeMarginProps): React.JSX.Element | null {
}: LoaderSizeMarginProps) {
const wrapper: React.CSSProperties = {
display: "inherit",
...cssOverride,
Expand Down
2 changes: 1 addition & 1 deletion src/BounceLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function BounceLoader({
cssOverride = {},
size = 60,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const style = (i: number): React.CSSProperties => {
const animationTiming = i === 1 ? `${1 / speedMultiplier}s` : "0s";
return {
Expand Down
2 changes: 1 addition & 1 deletion src/CircleLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function CircleLoader({
cssOverride = {},
size = 50,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const wrapper: React.CSSProperties = {
display: "inherit",
position: "relative",
Expand Down
2 changes: 1 addition & 1 deletion src/ClimbingBoxLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function ClimbingBoxLoader({
cssOverride = {},
size = 15,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const container: React.CSSProperties = {
display: "inherit",
position: "relative",
Expand Down
2 changes: 1 addition & 1 deletion src/ClipLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ClipLoader({
cssOverride = {},
size = 35,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const style: React.CSSProperties = {
background: "transparent !important",
width: cssValue(size),
Expand Down
2 changes: 1 addition & 1 deletion src/ClockLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function ClockLoader({
cssOverride = {},
size = 50,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const { value, unit } = parseLengthAndUnit(size);

const wrapper: React.CSSProperties = {
Expand Down
2 changes: 1 addition & 1 deletion src/DotLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function DotLoader({
cssOverride = {},
size = 60,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const wrapper: React.CSSProperties = {
display: "inherit",
position: "relative",
Expand Down
2 changes: 1 addition & 1 deletion src/FadeLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function FadeLoader({
radius = 2,
margin = 2,
...additionalprops
}: LoaderHeightWidthRadiusProps): React.JSX.Element | null {
}: LoaderHeightWidthRadiusProps) {
const { value } = parseLengthAndUnit(margin);
const radiusValue = value + 18;
const quarter = radiusValue / 2 + radiusValue / 5.5;
Expand Down
2 changes: 1 addition & 1 deletion src/GridLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function GridLoader({
size = 15,
margin = 2,
...additionalprops
}: LoaderSizeMarginProps): React.JSX.Element | null {
}: LoaderSizeMarginProps) {
const sizeWithUnit = parseLengthAndUnit(size);
const marginWithUnit = parseLengthAndUnit(margin);

Expand Down
2 changes: 1 addition & 1 deletion src/HashLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function HashLoader({
cssOverride = {},
size = 50,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const { value, unit } = parseLengthAndUnit(size);

const wrapper: React.CSSProperties = {
Expand Down
2 changes: 1 addition & 1 deletion src/MoonLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function MoonLoader({
cssOverride = {},
size = 60,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const { value, unit } = parseLengthAndUnit(size);
const moonSize = Math.round(value / 7);

Expand Down
2 changes: 1 addition & 1 deletion src/PacmanLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function PacmanLoader({
size = 25,
margin = 2,
...additionalprops
}: LoaderSizeMarginProps): React.JSX.Element | null {
}: LoaderSizeMarginProps) {
const { value, unit } = parseLengthAndUnit(size);

const wrapper: React.CSSProperties = {
Expand Down
2 changes: 1 addition & 1 deletion src/PropagateLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function PropagateLoader({
cssOverride = {},
size = 15,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const { value, unit } = parseLengthAndUnit(size);

const wrapper: React.CSSProperties = {
Expand Down
2 changes: 1 addition & 1 deletion src/PuffLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function PuffLoader({
cssOverride = {},
size = 60,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const wrapper: React.CSSProperties = {
display: "inherit",
position: "relative",
Expand Down
2 changes: 1 addition & 1 deletion src/PulseLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function PulseLoader({
size = 15,
margin = 2,
...additionalprops
}: LoaderSizeMarginProps): React.JSX.Element | null {
}: LoaderSizeMarginProps) {
const wrapper: React.CSSProperties = {
display: "inherit",
...cssOverride,
Expand Down
2 changes: 1 addition & 1 deletion src/RingLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function RingLoader({
cssOverride = {},
size = 60,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const { value, unit } = parseLengthAndUnit(size);

const wrapper: React.CSSProperties = {
Expand Down
2 changes: 1 addition & 1 deletion src/RiseLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function RiseLoader({
size = 15,
margin = 2,
...additionalprops
}: LoaderSizeMarginProps): React.JSX.Element | null {
}: LoaderSizeMarginProps) {
const wrapper: React.CSSProperties = {
display: "inherit",
...cssOverride,
Expand Down
2 changes: 1 addition & 1 deletion src/RotateLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function RotateLoader({
size = 15,
margin = 2,
...additionalprops
}: LoaderSizeMarginProps): React.JSX.Element | null {
}: LoaderSizeMarginProps) {
const { value, unit } = parseLengthAndUnit(margin);

const ball: React.CSSProperties = {
Expand Down
2 changes: 1 addition & 1 deletion src/ScaleLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function ScaleLoader({
margin = 2,
barCount = 5,
...additionalprops
}: LoaderHeightWidthRadiusProps & { barCount: number }): React.JSX.Element | null {
}: LoaderHeightWidthRadiusProps & { barCount: number }) {
const wrapper: React.CSSProperties = {
display: "inherit",
...cssOverride,
Expand Down
2 changes: 1 addition & 1 deletion src/SkewLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function SkewLoader({
cssOverride = {},
size = 20,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const style: React.CSSProperties = {
width: "0",
height: "0",
Expand Down
2 changes: 1 addition & 1 deletion src/SquareLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function SquareLoader({
cssOverride = {},
size = 50,
...additionalprops
}: LoaderSizeProps): React.JSX.Element | null {
}: LoaderSizeProps) {
const style: React.CSSProperties = {
backgroundColor: color,
width: cssValue(size),
Expand Down
2 changes: 1 addition & 1 deletion src/SyncLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function SyncLoader({
size = 15,
margin = 2,
...additionalprops
}: LoaderSizeMarginProps): React.JSX.Element | null {
}: LoaderSizeMarginProps) {
const wrapper: React.CSSProperties = {
display: "inherit",
...cssOverride,
Expand Down