@sb1/ffe-spinner-react 5.0.2 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/Spinner.js CHANGED
@@ -1,3 +1,5 @@
1
+ var _excluded = ["className", "immediate", "large"];
2
+
1
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
4
 
3
5
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -10,11 +12,14 @@ import classNames from 'classnames';
10
12
 
11
13
  var Spinner = function Spinner(_ref) {
12
14
  var className = _ref.className,
15
+ immediate = _ref.immediate,
13
16
  large = _ref.large,
14
- rest = _objectWithoutProperties(_ref, ["className", "large"]);
17
+ rest = _objectWithoutProperties(_ref, _excluded);
15
18
 
16
19
  return /*#__PURE__*/React.createElement("span", _extends({
17
20
  className: classNames('ffe-loading-spinner', {
21
+ 'ffe-loading-spinner--immediate': immediate
22
+ }, {
18
23
  'ffe-loading-spinner--large': large
19
24
  }, className)
20
25
  }, rest));
@@ -22,9 +27,11 @@ var Spinner = function Spinner(_ref) {
22
27
 
23
28
  Spinner.propTypes = {
24
29
  className: string,
30
+ immediate: bool,
25
31
  large: bool
26
32
  };
27
33
  Spinner.defaultProps = {
34
+ immediate: false,
28
35
  large: false
29
36
  };
30
37
  export default Spinner;
package/lib/Spinner.js CHANGED
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["className", "immediate", "large"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
18
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -21,11 +23,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
21
23
 
22
24
  var Spinner = function Spinner(_ref) {
23
25
  var className = _ref.className,
26
+ immediate = _ref.immediate,
24
27
  large = _ref.large,
25
- rest = _objectWithoutProperties(_ref, ["className", "large"]);
28
+ rest = _objectWithoutProperties(_ref, _excluded);
26
29
 
27
30
  return /*#__PURE__*/_react.default.createElement("span", _extends({
28
31
  className: (0, _classnames.default)('ffe-loading-spinner', {
32
+ 'ffe-loading-spinner--immediate': immediate
33
+ }, {
29
34
  'ffe-loading-spinner--large': large
30
35
  }, className)
31
36
  }, rest));
@@ -33,9 +38,11 @@ var Spinner = function Spinner(_ref) {
33
38
 
34
39
  Spinner.propTypes = {
35
40
  className: _propTypes.string,
41
+ immediate: _propTypes.bool,
36
42
  large: _propTypes.bool
37
43
  };
38
44
  Spinner.defaultProps = {
45
+ immediate: false,
39
46
  large: false
40
47
  };
41
48
  var _default = Spinner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-spinner-react",
3
- "version": "5.0.2",
3
+ "version": "5.1.2",
4
4
  "license": "MIT",
5
5
  "author": "SpareBank 1",
6
6
  "files": [
@@ -17,11 +17,8 @@
17
17
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
18
18
  },
19
19
  "scripts": {
20
- "build": "npm run build:cjs && npm run build:es && npm run build:types",
21
- "build:cjs": "babel -d lib/. --root-mode=upward --env-name=cjs --ignore=*.spec.js src/.",
22
- "build:es": "babel -d es/. --root-mode=upward --env-name=es --ignore=*.spec.js src/.",
23
- "build:types": "copyfiles -f src/index.d.ts types/",
24
- "lint": "eslint src/.",
20
+ "build": "ffe-buildtool babel",
21
+ "lint": "eslint src",
25
22
  "test": "jest",
26
23
  "test:watch": "jest --watch"
27
24
  },
@@ -29,9 +26,10 @@
29
26
  "setupTestFrameworkScriptFile": "../../test-setup.js"
30
27
  },
31
28
  "dependencies": {
32
- "prop-types": "^15.6.0"
29
+ "prop-types": "^15.7.2"
33
30
  },
34
31
  "devDependencies": {
32
+ "@sb1/ffe-buildtool": "^0.2.0",
35
33
  "enzyme": "^3.7.0",
36
34
  "enzyme-adapter-react-16": "^1.7.0",
37
35
  "jest": "^26.0.0",
@@ -39,11 +37,11 @@
39
37
  "react-dom": "^16.9.0"
40
38
  },
41
39
  "peerDependencies": {
42
- "@sb1/ffe-spinner": "^3.0.0",
43
- "react": "^16.9.0"
40
+ "@sb1/ffe-spinner": "*",
41
+ "react": ">=16.9.0"
44
42
  },
45
43
  "publishConfig": {
46
44
  "access": "public"
47
45
  },
48
- "gitHead": "072f7a0ce24bd7fe80978a54e5a4d7c6216d700a"
46
+ "gitHead": "10669ef6d5ebf454feb4eddb9aa4ca7bc8f439dc"
49
47
  }
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
 
3
3
  export interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {
4
4
  className?: string;
5
+ immediate?: boolean;
5
6
  large?: boolean;
6
7
  }
7
8
 
package/CHANGELOG.md DELETED
@@ -1,280 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [5.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@5.0.1...@sb1/ffe-spinner-react@5.0.2) (2021-02-02)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * packages/ffe-spinner-react/package.json to reduce vulnerabilities ([020a0f8](https://github.com/SpareBank1/designsystem/commit/020a0f87f3aef2af602019d6c3f19d01338dbd0d))
12
-
13
-
14
-
15
-
16
-
17
- ## [5.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@5.0.0...@sb1/ffe-spinner-react@5.0.1) (2021-02-02)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * **ffe-spinner-react:** reduce vulnerabilities ([c502167](https://github.com/SpareBank1/designsystem/commit/c502167b80add31dae531e466a7c03e549ed740a))
23
-
24
-
25
-
26
-
27
-
28
- # [5.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.1.1...@sb1/ffe-spinner-react@5.0.0) (2019-08-27)
29
-
30
- ### chore
31
-
32
- - bump React to 16.9 to allow for using hooks etc ([e3901f1](https://github.com/SpareBank1/designsystem/commit/e3901f1))
33
-
34
- ### BREAKING CHANGES
35
-
36
- - peerDep of React is raised to 16.9. While this in itself
37
- isn't a breaking change, it allows for the use of hooks in later releases.
38
- Such changes would just be a minor version, or even a patch, but without
39
- this major version bump it would result in a runtime error for consumers.
40
-
41
- ## [4.1.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.1.0...@sb1/ffe-spinner-react@4.1.1) (2019-04-26)
42
-
43
- ### Bug Fixes
44
-
45
- - **ffe-spinner-react:** Fixed missing default export in typescript definitions ([82a2df2](https://github.com/SpareBank1/designsystem/commit/82a2df2))
46
-
47
- # [4.1.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.6...@sb1/ffe-spinner-react@4.1.0) (2019-04-25)
48
-
49
- ### Features
50
-
51
- - **ffe-spinner-react:** Added type definitions for typescript ([12cccd5](https://github.com/SpareBank1/designsystem/commit/12cccd5))
52
- - **ffe-spinner-react:** Added type definitions for typescript ([e528654](https://github.com/SpareBank1/designsystem/commit/e528654))
53
-
54
- ## [4.0.6](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.5...@sb1/ffe-spinner-react@4.0.6) (2018-12-11)
55
-
56
- ### Bug Fixes
57
-
58
- - Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
59
-
60
- ## [4.0.5](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.4...@sb1/ffe-spinner-react@4.0.5) (2018-11-26)
61
-
62
- **Note:** Version bump only for package @sb1/ffe-spinner-react
63
-
64
- <a name="4.0.4"></a>
65
-
66
- ## [4.0.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.3...@sb1/ffe-spinner-react@4.0.4) (2018-08-09)
67
-
68
- **Note:** Version bump only for package @sb1/ffe-spinner-react
69
-
70
- <a name="4.0.3"></a>
71
-
72
- ## [4.0.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.2...@sb1/ffe-spinner-react@4.0.3) (2018-03-27)
73
-
74
- **Note:** Version bump only for package @sb1/ffe-spinner-react
75
-
76
- <a name="4.0.2"></a>
77
-
78
- ## [4.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.0...@sb1/ffe-spinner-react@4.0.2) (2018-03-07)
79
-
80
- ### Bug Fixes
81
-
82
- - Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
83
-
84
- <a name="4.0.1"></a>
85
-
86
- ## [4.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.0...@sb1/ffe-spinner-react@4.0.1) (2018-03-02)
87
-
88
- ### Bug Fixes
89
-
90
- - Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
91
-
92
- <a name="4.0.0"></a>
93
-
94
- # 4.0.0 (2018-02-25)
95
-
96
- ### Chores
97
-
98
- - **ffe-spinner-react:** Reimplement ffe-spinner-react ([f3f8795](https://github.com/SpareBank1/designsystem/commit/f3f8795))
99
- - add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
100
-
101
- ### BREAKING CHANGES
102
-
103
- - All packages have been renamed to add the @sb1 scope.
104
-
105
- See links [1] and [2] to read more about package scopes.
106
-
107
- Unfortunately this requires you update both your dependencies in
108
- `package.json` and all `import` or `require` statements in your code.
109
- Also, you unfortunately have to upgrade all FFE packages at once due to
110
- dependency between packages. If you are on the latest version prior to
111
- this breaking change the upgrade should be a matter of updating
112
- `package.json` with new package names and versions, and updating your
113
- imports.
114
-
115
- To help find the proper package versions you can either browse to the
116
- packages you need or check out the list of Git tags either on
117
- Github [3] or by cloning the repository and running the `git tag`
118
- command. All package versions get a tag in the format
119
- _package@version_.
120
-
121
- Update your `package.json` with the latest package version and add the
122
- @sb1 scope to the package name:
123
-
124
- ```diff
125
- - "ffe-core": "11.0.2",
126
- + "@sb1/ffe-core": "11.0.2",
127
- ```
128
-
129
- Scoped packages all get put in a subdirectory in `node_modules/`. In our
130
- case packages will be put in the `node_modules/@sb1/` directory. If your
131
- build depends on file paths (for instance for copying fonts) you need to
132
- update that path to include the scope.
133
-
134
- The directory structure also means you have to update your imports, both
135
- in Less and in JavaScript.
136
-
137
- Using `less-plugin-npm-import`:
138
-
139
- ```diff
140
- - @import 'npm://ffe-core/less/ffe';
141
- + @import 'npm://@sb1/ffe-core/less/ffe';
142
- ```
143
-
144
- Using Webpack:
145
-
146
- ```diff
147
- - @import '~ffe-core/less/ffe';
148
- + @import '~@sb1/ffe-core/less/ffe';
149
- ```
150
-
151
- Using plain old paths:
152
-
153
- ```diff
154
- - @import '../path/to/node_modules/ffe-core/less/ffe';
155
- + @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
156
- ```
157
-
158
- JavaScript `import`:
159
-
160
- ```diff
161
- - import { ActionButton } from 'ffe-buttons-react';
162
- + import { ActionButton } from '@sb1/ffe-buttons-react';
163
- ```
164
-
165
- JavaScript `require`:
166
-
167
- ```diff
168
- - const { ActionButton } = require('ffe-buttons-react').default;
169
- + const { ActionButton } = require('@sb1/ffe-buttons-react').default;
170
- ```
171
-
172
- [1]: https://docs.npmjs.com/misc/scope
173
- [2]: https://docs.npmjs.com/getting-started/scoped-packages
174
- [3]: https://github.com/sparebank1/designsystem/tags
175
-
176
- - **ffe-spinner-react:** This commit reimplements and simplifies the
177
- ffe-spinner-react implementation. It no longer includes layout, which
178
- requires the consumer to place it correctly.
179
-
180
- The `<InlineSpinner />` and `<LargeSpinner />` are now available as
181
- `<Spinner large={true|false} />`.
182
-
183
- The previous `<Spinner />` implementation, which wrapped a large
184
- spinner in a `ffe-content-container` class is now removed. To keep this
185
- behavior, the consumer can create its own implementation of a
186
- `<SpinnerWithLayout />` or something similar.
187
-
188
- <a name="3.0.6"></a>
189
-
190
- ## [3.0.6](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.5...ffe-spinner-react@3.0.6) (2018-02-23)
191
-
192
- **Note:** Version bump only for package ffe-spinner-react
193
-
194
- <a name="3.0.5"></a>
195
-
196
- ## [3.0.5](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.4...ffe-spinner-react@3.0.5) (2018-02-22)
197
-
198
- **Note:** Version bump only for package ffe-spinner-react
199
-
200
- <a name="3.0.4"></a>
201
-
202
- ## [3.0.4](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.3...ffe-spinner-react@3.0.4) (2018-02-20)
203
-
204
- **Note:** Version bump only for package ffe-spinner-react
205
-
206
- <a name="3.0.3"></a>
207
-
208
- ## [3.0.3](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.2...ffe-spinner-react@3.0.3) (2018-02-15)
209
-
210
- **Note:** Version bump only for package ffe-spinner-react
211
-
212
- <a name="3.0.2"></a>
213
-
214
- ## [3.0.2](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.1...ffe-spinner-react@3.0.2) (2018-02-01)
215
-
216
- **Note:** Version bump only for package ffe-spinner-react
217
-
218
- <a name="3.0.1"></a>
219
-
220
- ## [3.0.1](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.0...ffe-spinner-react@3.0.1) (2018-01-22)
221
-
222
- **Note:** Version bump only for package ffe-spinner-react
223
-
224
- <a name="3.0.0"></a>
225
-
226
- # 3.0.0 (2018-01-22)
227
-
228
- ### Chores
229
-
230
- - **ffe-spinner-react:** Reimplement ffe-spinner-react
231
-
232
- ### BREAKING CHANGES
233
-
234
- - **ffe-spinner-react:** This commit reimplements and simplifies the
235
- ffe-spinner-react implementation. It no longer includes layout, which
236
- requires the consumer to place it correctly.
237
-
238
- The `<InlineSpinner />` and `<LargeSpinner />` are now available as
239
- `<Spinner large={true|false} />`.
240
-
241
- The previous `<Spinner />` implementation, which wrapped a large
242
- spinner in a `ffe-content-container` class is now removed. To keep this
243
- behavior, the consumer can create its own implementation of a
244
- `<SpinnerWithLayout />` or something similar.
245
-
246
- ## 2.0.4
247
-
248
- - Document and refactor internally.
249
- - Deprecate `text` prop in favor of `children`
250
-
251
- ## 2.0.3
252
-
253
- - Use PropTypes from prop-types package
254
-
255
- ## 2.0.2
256
-
257
- - Expand peerDep scope of `ffe-spinner` to include `2.x`.
258
- - Remove peerDep on `ffe-core`.
259
-
260
- ## 2.0.1
261
-
262
- - Upgrade eslint to use latest ffe config
263
-
264
- # 2.0.0
265
-
266
- - peerDependency on `ffe-core` bumped to `^8.0.2`
267
- - Added explicit dependency on `ffe-core` and `ffe-spinner`
268
- - Added a budo example page that can be launched with `npm start`
269
-
270
- ## 1.0.2
271
-
272
- - peerDependency on `ffe-core` relaxed to `^6.0.0`
273
-
274
- ## 1.0.1
275
-
276
- - peerDependency on `ffe-core` relaxed to `^5.0.0`
277
-
278
- # 1.0.0
279
-
280
- - Initial release
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import Spinner from '.';
4
-
5
- var getWrapper = function getWrapper(props) {
6
- return shallow( /*#__PURE__*/React.createElement(Spinner, props));
7
- };
8
-
9
- describe('<Spinner />', function () {
10
- it('renders without exploding', function () {
11
- var wrapper = getWrapper();
12
- expect(wrapper.exists()).toBe(true);
13
- expect(wrapper.is('span')).toBe(true);
14
- });
15
- it('renders classes correctly', function () {
16
- var wrapper = getWrapper({
17
- className: 'test-class'
18
- });
19
- expect(wrapper.hasClass('ffe-loading-spinner')).toBe(true);
20
- expect(wrapper.hasClass('test-class')).toBe(true);
21
- });
22
- it('renders a large spinner', function () {
23
- var wrapper = getWrapper({
24
- large: true
25
- });
26
- expect(wrapper.hasClass('ffe-loading-spinner--large')).toBe(true);
27
- });
28
- it('passes props correctly', function () {
29
- var wrapper = getWrapper({
30
- id: 'test-id'
31
- });
32
- expect(wrapper.prop('id')).toBe('test-id');
33
- });
34
- });
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _enzyme = require("enzyme");
6
-
7
- var _ = _interopRequireDefault(require("."));
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- var getWrapper = function getWrapper(props) {
12
- return (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_.default, props));
13
- };
14
-
15
- describe('<Spinner />', function () {
16
- it('renders without exploding', function () {
17
- var wrapper = getWrapper();
18
- expect(wrapper.exists()).toBe(true);
19
- expect(wrapper.is('span')).toBe(true);
20
- });
21
- it('renders classes correctly', function () {
22
- var wrapper = getWrapper({
23
- className: 'test-class'
24
- });
25
- expect(wrapper.hasClass('ffe-loading-spinner')).toBe(true);
26
- expect(wrapper.hasClass('test-class')).toBe(true);
27
- });
28
- it('renders a large spinner', function () {
29
- var wrapper = getWrapper({
30
- large: true
31
- });
32
- expect(wrapper.hasClass('ffe-loading-spinner--large')).toBe(true);
33
- });
34
- it('passes props correctly', function () {
35
- var wrapper = getWrapper({
36
- id: 'test-id'
37
- });
38
- expect(wrapper.prop('id')).toBe('test-id');
39
- });
40
- });