Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: davidhu2000/react-spinners
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 54c911d5b286d9b7f497e89b8da3369e57d07286
Choose a base ref
...
head repository: davidhu2000/react-spinners
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 61ad627af30be7f7124419b29cc7f7b52cc68a9d
Choose a head ref
Loading
Showing with 21,006 additions and 20,268 deletions.
  1. +1 −7 .babelrc
  2. +0 −29 .circleci/config.yml
  3. +17 −0 .eslintrc.js
  4. +15 −13 .github/ISSUE_TEMPLATE/bug_report.md
  5. +11 −8 .github/ISSUE_TEMPLATE/feature_request.md
  6. +2 −7 .github/PULL_REQUEST_TEMPLATE.md
  7. +16 −0 .github/actions/setup-node/action.yaml
  8. +67 −0 .github/workflows/deploy.yml
  9. +12 −1 .gitignore
  10. +10 −4 .npmignore
  11. +8 −0 .prettierignore
  12. +8 −0 .storybook/canonical-link/register.js
  13. +12 −0 .storybook/google-adsense/register.js
  14. +26 −0 .storybook/google-analytics-v4/register.js
  15. +18 −0 .storybook/main.js
  16. +3 −0 .storybook/manager.js
  17. +48 −0 .storybook/preview.js
  18. +6 −0 .vscode/settings.json
  19. +807 −0 .yarn/releases/yarn-3.3.0.cjs
  20. +3 −0 .yarnrc.yml
  21. +238 −0 CHANGELOG.md
  22. +10 −10 CODE_OF_CONDUCT.md
  23. +2 −2 CONTRIBUTING.md
  24. +62 −30 README.md
  25. +0 −121 __tests__/BarLoader-tests.tsx
  26. +0 −117 __tests__/BeatLoader-tests.tsx
  27. +0 −99 __tests__/BounceLoader-tests.tsx
  28. +0 −99 __tests__/CircleLoader-tests.tsx
  29. +0 −113 __tests__/ClimbingBoxLoader-tests.tsx
  30. +0 −97 __tests__/ClipLoader-tests.tsx
  31. +0 −102 __tests__/ClockLoader-tests.tsx
  32. +0 −94 __tests__/DotLoader-tests.tsx
  33. +0 −265 __tests__/FadeLoader-tests.tsx
  34. +0 −94 __tests__/GridLoader-tests.tsx
  35. +0 −204 __tests__/HashLoader-tests.tsx
  36. +0 −122 __tests__/MoonLoader-tests.tsx
  37. +0 −286 __tests__/PacmanLoader-tests.tsx
  38. +0 −178 __tests__/PropagateLoader-tests.tsx
  39. +0 −99 __tests__/PuffLoader-tests.tsx
  40. +0 −167 __tests__/PulseLoader-test.tsx
  41. +0 −175 __tests__/RingLoader-tests.tsx
  42. +0 −186 __tests__/RiseLoader-tests.tsx
  43. +0 −226 __tests__/RotateLoader-tests.tsx
  44. +0 −220 __tests__/ScaleLoader-tests.tsx
  45. +0 −161 __tests__/SkewLoader-tests.tsx
  46. +0 −101 __tests__/SquareLoader-tests.tsx
  47. +0 −188 __tests__/SyncLoader-tests.tsx
  48. +0 −95 __tests__/__snapshots__/BarLoader-tests.tsx.snap
  49. +0 −83 __tests__/__snapshots__/BeatLoader-tests.tsx.snap
  50. +0 −85 __tests__/__snapshots__/BounceLoader-tests.tsx.snap
  51. +0 −226 __tests__/__snapshots__/CircleLoader-tests.tsx.snap
  52. +0 −140 __tests__/__snapshots__/ClimbingBoxLoader-tests.tsx.snap
  53. +0 −49 __tests__/__snapshots__/ClipLoader-tests.tsx.snap
  54. +0 −70 __tests__/__snapshots__/ClockLoader-tests.tsx.snap
  55. +0 −95 __tests__/__snapshots__/DotLoader-tests.tsx.snap
  56. +0 −285 __tests__/__snapshots__/FadeLoader-tests.tsx.snap
  57. +0 −83 __tests__/__snapshots__/GridLoader-tests.tsx.snap
  58. +0 −108 __tests__/__snapshots__/HashLoader-tests.tsx.snap
  59. +0 −70 __tests__/__snapshots__/MoonLoader-tests.tsx.snap
  60. +0 −219 __tests__/__snapshots__/PacmanLoader-tests.tsx.snap
  61. +0 −259 __tests__/__snapshots__/PropagateLoader-tests.tsx.snap
  62. +0 −133 __tests__/__snapshots__/PulseLoader-test.tsx.snap
  63. +0 −93 __tests__/__snapshots__/RingLoader-tests.tsx.snap
  64. +0 −121 __tests__/__snapshots__/RiseLoader-tests.tsx.snap
  65. +0 −77 __tests__/__snapshots__/RotateLoader-tests.tsx.snap
  66. +0 −198 __tests__/__snapshots__/ScaleLoader-tests.tsx.snap
  67. +0 −53 __tests__/__snapshots__/SkewLoader-tests.tsx.snap
  68. +0 −51 __tests__/__snapshots__/SquareLoader-tests.tsx.snap
  69. +0 −124 __tests__/__snapshots__/SyncLoader-tests.tsx.snap
  70. +0 −4 __tests__/config/enzyme.ts
  71. +0 −145 __tests__/helpers/proptypes-tests.ts
  72. +0 −72 docs/index.html
  73. +0 −1 docs/javascripts/main-4ed1af48874a10c5cd01.js
  74. +0 −1 docs/javascripts/npm-emotion-46d0bff312017d5c792f.js
  75. +0 −1 docs/javascripts/npm-lodash-274d46f3c933a7c99cd9.js
  76. +0 −1 docs/javascripts/npm-react-color-07d019635c56c6ccc579.js
  77. +0 −9 docs/javascripts/npm-react-dom-95e71e900f54f4b47a13.js
  78. +0 −1 docs/javascripts/npm-reactcss-5dabd4e7069c1b893dd5.js
  79. +0 −1 docs/javascripts/npm-tinycolor2-1cbf8a88d1c5d5cdbb90.js
  80. +0 −22 docs/javascripts/vendors~main-449453e809c4ca1e9cd2.js
  81. +0 −17 docs/scripts.js
  82. +87 −120 docs/styles.css
  83. +8 −24 examples/components/Code.tsx
  84. +5 −5 examples/components/ColorPicker.tsx
  85. +0 −24 examples/components/Form.tsx
  86. +14 −54 examples/components/LoaderItem.tsx
  87. +3 −3 examples/components/index.ts
  88. +71 −65 examples/index.tsx
  89. +2 −6 jest.config.js
  90. +0 −11,608 package-lock.json
  91. +68 −50 package.json
  92. +3 −3 prettier.config.js
  93. +4 −0 scripts/build-docs.sh
  94. +79 −0 scripts/mod.rb
  95. +35 −0 scripts/stories.rb
  96. +17 −0 scripts/stories.template
  97. +57 −63 src/BarLoader.tsx
  98. +47 −37 src/BeatLoader.tsx
  99. +48 −52 src/BounceLoader.tsx
  100. +54 −59 src/CircleLoader.tsx
  101. +64 −71 src/ClimbingBoxLoader.tsx
  102. +37 −35 src/ClipLoader.tsx
  103. +57 −56 src/ClockLoader.tsx
  104. +48 −58 src/DotLoader.tsx
  105. +99 −110 src/FadeLoader.tsx
  106. +62 −61 src/GridLoader.tsx
  107. +71 −105 src/HashLoader.tsx
  108. +55 −72 src/MoonLoader.tsx
  109. +78 −105 src/PacmanLoader.tsx
  110. +89 −80 src/PropagateLoader.tsx
  111. +50 −61 src/PuffLoader.tsx
  112. +47 −38 src/PulseLoader.tsx
  113. +52 −55 src/RingLoader.tsx
  114. +63 −54 src/RiseLoader.tsx
  115. +52 −67 src/RotateLoader.tsx
  116. +49 −40 src/ScaleLoader.tsx
  117. +33 −34 src/SkewLoader.tsx
  118. +34 −32 src/SquareLoader.tsx
  119. +45 −37 src/SyncLoader.tsx
  120. +16 −0 src/helpers/animation.server.test.ts
  121. +12 −0 src/helpers/animation.test.ts
  122. +23 −0 src/helpers/animation.ts
  123. +1 −1 __tests__/helpers/colors-tests.ts → src/helpers/colors.test.ts
  124. +3 −8 src/helpers/colors.ts
  125. +0 −3 src/helpers/index.ts
  126. +31 −0 src/helpers/props.ts
  127. +0 −54 src/helpers/proptypes.ts
  128. +6 −7 __tests__/helpers/unitConverter-tests.ts → src/helpers/unitConverter.test.ts
  129. +11 −8 src/helpers/unitConverter.ts
  130. +23 −54 src/index.ts
  131. +0 −41 src/interfaces.ts
  132. 0 stories/.keep
  133. +50 −25 template.html
  134. +30 −0 tests/AllLoaders.test.tsx
  135. +6 −0 tsconfig.cjs.json
  136. +6 −0 tsconfig.esm.json
  137. +11 −3 tsconfig.json
  138. +6 −0 tsconfig.umd.json
  139. +0 −74 tslint.json
  140. +14 −14 webpack.config.dev.js
  141. +16 −15 webpack.config.js
  142. +17,652 −0 yarn.lock
8 changes: 1 addition & 7 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"presets": ["@babel/preset-react", "@babel/preset-env"],
"plugins": [
"emotion",
"@babel/plugin-transform-react-jsx",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-typescript"
]
"presets": ["@babel/preset-react", "@babel/preset-env"]
}
29 changes: 0 additions & 29 deletions .circleci/config.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "unicorn", "jest-dom", "testing-library"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"prettier",
"plugin:storybook/recommended",
],
settings: {
react: {
version: "detect",
},
},
};
28 changes: 15 additions & 13 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Package Version**

<!-- A clear and concise description of what the bug is. -->

**Describe the bug**
A clear and concise description of what the bug is.
<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
<!-- Steps to reproduce the behavior: -->

**Expected behavior**
A clear and concise description of what you expected to happen.

<!-- A clear and concise description of what you expected to happen. -->

**Screenshots**
If applicable, add screenshots to help explain your problem.

<!-- If applicable, add screenshots to help explain your problem. -->

**Additional context**
Add any other context about the problem here.

<!-- Add any other context about the problem here. -->
19 changes: 11 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
Add any other context or screenshots about the feature request here.

<!-- Add any other context or screenshots about the feature request here. -->
9 changes: 2 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# What changes are introduced?

**Before submitting a pull request,** please do the following:

1. Make sure you are not working on the master branch.
2. run `npm run test` and ensure that all tests pass.
3. Push up the branch code and create a pull request.
4. Add details regarding what code you wrote.
5. If the pull request is related to a particular issue, make sure to reference the issue number.
# Any screenshots?
16 changes: 16 additions & 0 deletions .github/actions/setup-node/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: setup-node-env

runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install --global yarn
shell: bash
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- run: yarn install
shell: bash
67 changes: 67 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: deploy

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read
pages: write
id-token: write

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- run: yarn run clean
- run: yarn run test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- run: yarn run clean
- run: yarn run lint --max-warnings=0

build-site:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
- uses: ./.github/actions/setup-node
- name: Build demo site
run: yarn run build:demo
- name: Create stories
run: ruby scripts/stories.rb
- name: Build storybook
run: yarn run build-storybook

- name: Upload Pages Artifact
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-pages-artifact@v1
with:
path: "./docs"

deploy-site:
if: ${{ github.event_name != 'pull_request' }}
needs: [build-site, lint, tests]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -7,4 +7,15 @@
npm-debug.log
node_modules
dist
docs/js
docs/javascripts
docs/js
docs/index.html
docs/storybook

cjs
esm
umd
.yarn/cache
.yarn/install-state.gz
stories/*.tsx
storybook-static
14 changes: 10 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -9,18 +9,24 @@
npm-debug.log
lib

.yarn/*
.yarnrc
examples
docs
webpack.config.*
prettier.config.js
prettier.config.*
template.html
__tests__
.github
.circleci
.eslintrc.*
coverage
src
tslint.json
jest.config.js
jest.config.*
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
CONTRIBUTING.md
stories
yarn-error.log
.storybook
.prettierignore
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.yarn
node_modules
yarn.lock
coverage
docs/storybook
docs/javascripts
docs/js
template.html
8 changes: 8 additions & 0 deletions .storybook/canonical-link/register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { addons } from "@storybook/addons";

addons.register("storybook/canonical-link", (api) => {
var link = document.createElement("link");
link.setAttribute("rel", "canonical");
link.setAttribute("href", "https://www.davidhu.io/react-spinners/storybook");
document.head.appendChild(link);
});
12 changes: 12 additions & 0 deletions .storybook/google-adsense/register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { addons } from "@storybook/addons";

addons.register("storybook/google-adsense", (api) => {
var script = document.createElement("script");
script.async = true;
script.setAttribute(
"src",
"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5203413376871291"
);
script.setAttribute("crossorigin", "anonymous");
document.head.appendChild(script);
});
26 changes: 26 additions & 0 deletions .storybook/google-analytics-v4/register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { window } from "global";
import { addons } from "@storybook/addons";
import { STORY_CHANGED, STORY_ERRORED, STORY_MISSING } from "@storybook/core-events";

import ReactGa from "react-ga4";

addons.register("storybook/google-analytics-v4", (api) => {
ReactGa.initialize(window.STORYBOOK_GA_V4_ID, window.STORYBOOK_REACT_GA_OPTIONS);

api.on(STORY_CHANGED, () => {
const { path } = api.getUrlState();
ReactGa.send({ hitType: "pageview", page: path });
});
api.on(STORY_ERRORED, ({ description }) => {
ReactGa.exception({
description,
fatal: true,
});
});
api.on(STORY_MISSING, (id) => {
ReactGa.exception({
description: `attempted to render ${id}, but it is missing`,
fatal: false,
});
});
});
18 changes: 18 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
stories: ["../stories/*.stories.@(ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
// "@storybook/addon-google-analytics",
"storybook-dark-mode",
"./google-analytics-v4/register.js",
"./google-adsense/register.js",
"./canonical-link/register.js",
],
framework: "@storybook/react",
core: {
builder: "@storybook/builder-webpack5",
disableTelemetry: true,
},
};
3 changes: 3 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
window.STORYBOOK_GA_ID = "UA-92266369-2";
window.STORYBOOK_GA_V4_ID = "G-ZLGVJTEW5V";
window.STORYBOOK_REACT_GA_OPTIONS = {};
Loading