@sb1/ffe-spinner-react 5.0.3 → 5.1.3

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.3",
3
+ "version": "5.1.3",
4
4
  "license": "MIT",
5
5
  "author": "SpareBank 1",
6
6
  "files": [
@@ -17,11 +17,9 @@
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
+ "watch": "ffe-buildtool babel-watch",
22
+ "lint": "eslint src",
25
23
  "test": "jest",
26
24
  "test:watch": "jest --watch"
27
25
  },
@@ -29,9 +27,10 @@
29
27
  "setupTestFrameworkScriptFile": "../../test-setup.js"
30
28
  },
31
29
  "dependencies": {
32
- "prop-types": "^15.6.0"
30
+ "prop-types": "^15.7.2"
33
31
  },
34
32
  "devDependencies": {
33
+ "@sb1/ffe-buildtool": "^0.3.0",
35
34
  "enzyme": "^3.7.0",
36
35
  "enzyme-adapter-react-16": "^1.7.0",
37
36
  "jest": "^26.0.0",
@@ -45,5 +44,5 @@
45
44
  "publishConfig": {
46
45
  "access": "public"
47
46
  },
48
- "gitHead": "274d896b03703139da2bfeab8ab32652f6b4c1e2"
47
+ "gitHead": "1960685a8b6055efc0653aa1643138cf4a7054fc"
49
48
  }
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,291 +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.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@5.0.2...@sb1/ffe-spinner-react@5.0.3) (2021-03-15)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **ffe-spinner-react:** broadens version of peer dependencies ([78bdddc](https://github.com/SpareBank1/designsystem/commit/78bdddcec94641d07a68b267eb7995769a50a310))
12
-
13
-
14
-
15
-
16
-
17
- ## [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)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * packages/ffe-spinner-react/package.json to reduce vulnerabilities ([020a0f8](https://github.com/SpareBank1/designsystem/commit/020a0f87f3aef2af602019d6c3f19d01338dbd0d))
23
-
24
-
25
-
26
-
27
-
28
- ## [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)
29
-
30
-
31
- ### Bug Fixes
32
-
33
- * **ffe-spinner-react:** reduce vulnerabilities ([c502167](https://github.com/SpareBank1/designsystem/commit/c502167b80add31dae531e466a7c03e549ed740a))
34
-
35
-
36
-
37
-
38
-
39
- # [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)
40
-
41
- ### chore
42
-
43
- - bump React to 16.9 to allow for using hooks etc ([e3901f1](https://github.com/SpareBank1/designsystem/commit/e3901f1))
44
-
45
- ### BREAKING CHANGES
46
-
47
- - peerDep of React is raised to 16.9. While this in itself
48
- isn't a breaking change, it allows for the use of hooks in later releases.
49
- Such changes would just be a minor version, or even a patch, but without
50
- this major version bump it would result in a runtime error for consumers.
51
-
52
- ## [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)
53
-
54
- ### Bug Fixes
55
-
56
- - **ffe-spinner-react:** Fixed missing default export in typescript definitions ([82a2df2](https://github.com/SpareBank1/designsystem/commit/82a2df2))
57
-
58
- # [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)
59
-
60
- ### Features
61
-
62
- - **ffe-spinner-react:** Added type definitions for typescript ([12cccd5](https://github.com/SpareBank1/designsystem/commit/12cccd5))
63
- - **ffe-spinner-react:** Added type definitions for typescript ([e528654](https://github.com/SpareBank1/designsystem/commit/e528654))
64
-
65
- ## [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)
66
-
67
- ### Bug Fixes
68
-
69
- - Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
70
-
71
- ## [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)
72
-
73
- **Note:** Version bump only for package @sb1/ffe-spinner-react
74
-
75
- <a name="4.0.4"></a>
76
-
77
- ## [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)
78
-
79
- **Note:** Version bump only for package @sb1/ffe-spinner-react
80
-
81
- <a name="4.0.3"></a>
82
-
83
- ## [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)
84
-
85
- **Note:** Version bump only for package @sb1/ffe-spinner-react
86
-
87
- <a name="4.0.2"></a>
88
-
89
- ## [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)
90
-
91
- ### Bug Fixes
92
-
93
- - Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
94
-
95
- <a name="4.0.1"></a>
96
-
97
- ## [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)
98
-
99
- ### Bug Fixes
100
-
101
- - Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
102
-
103
- <a name="4.0.0"></a>
104
-
105
- # 4.0.0 (2018-02-25)
106
-
107
- ### Chores
108
-
109
- - **ffe-spinner-react:** Reimplement ffe-spinner-react ([f3f8795](https://github.com/SpareBank1/designsystem/commit/f3f8795))
110
- - add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
111
-
112
- ### BREAKING CHANGES
113
-
114
- - All packages have been renamed to add the @sb1 scope.
115
-
116
- See links [1] and [2] to read more about package scopes.
117
-
118
- Unfortunately this requires you update both your dependencies in
119
- `package.json` and all `import` or `require` statements in your code.
120
- Also, you unfortunately have to upgrade all FFE packages at once due to
121
- dependency between packages. If you are on the latest version prior to
122
- this breaking change the upgrade should be a matter of updating
123
- `package.json` with new package names and versions, and updating your
124
- imports.
125
-
126
- To help find the proper package versions you can either browse to the
127
- packages you need or check out the list of Git tags either on
128
- Github [3] or by cloning the repository and running the `git tag`
129
- command. All package versions get a tag in the format
130
- _package@version_.
131
-
132
- Update your `package.json` with the latest package version and add the
133
- @sb1 scope to the package name:
134
-
135
- ```diff
136
- - "ffe-core": "11.0.2",
137
- + "@sb1/ffe-core": "11.0.2",
138
- ```
139
-
140
- Scoped packages all get put in a subdirectory in `node_modules/`. In our
141
- case packages will be put in the `node_modules/@sb1/` directory. If your
142
- build depends on file paths (for instance for copying fonts) you need to
143
- update that path to include the scope.
144
-
145
- The directory structure also means you have to update your imports, both
146
- in Less and in JavaScript.
147
-
148
- Using `less-plugin-npm-import`:
149
-
150
- ```diff
151
- - @import 'npm://ffe-core/less/ffe';
152
- + @import 'npm://@sb1/ffe-core/less/ffe';
153
- ```
154
-
155
- Using Webpack:
156
-
157
- ```diff
158
- - @import '~ffe-core/less/ffe';
159
- + @import '~@sb1/ffe-core/less/ffe';
160
- ```
161
-
162
- Using plain old paths:
163
-
164
- ```diff
165
- - @import '../path/to/node_modules/ffe-core/less/ffe';
166
- + @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
167
- ```
168
-
169
- JavaScript `import`:
170
-
171
- ```diff
172
- - import { ActionButton } from 'ffe-buttons-react';
173
- + import { ActionButton } from '@sb1/ffe-buttons-react';
174
- ```
175
-
176
- JavaScript `require`:
177
-
178
- ```diff
179
- - const { ActionButton } = require('ffe-buttons-react').default;
180
- + const { ActionButton } = require('@sb1/ffe-buttons-react').default;
181
- ```
182
-
183
- [1]: https://docs.npmjs.com/misc/scope
184
- [2]: https://docs.npmjs.com/getting-started/scoped-packages
185
- [3]: https://github.com/sparebank1/designsystem/tags
186
-
187
- - **ffe-spinner-react:** This commit reimplements and simplifies the
188
- ffe-spinner-react implementation. It no longer includes layout, which
189
- requires the consumer to place it correctly.
190
-
191
- The `<InlineSpinner />` and `<LargeSpinner />` are now available as
192
- `<Spinner large={true|false} />`.
193
-
194
- The previous `<Spinner />` implementation, which wrapped a large
195
- spinner in a `ffe-content-container` class is now removed. To keep this
196
- behavior, the consumer can create its own implementation of a
197
- `<SpinnerWithLayout />` or something similar.
198
-
199
- <a name="3.0.6"></a>
200
-
201
- ## [3.0.6](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.5...ffe-spinner-react@3.0.6) (2018-02-23)
202
-
203
- **Note:** Version bump only for package ffe-spinner-react
204
-
205
- <a name="3.0.5"></a>
206
-
207
- ## [3.0.5](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.4...ffe-spinner-react@3.0.5) (2018-02-22)
208
-
209
- **Note:** Version bump only for package ffe-spinner-react
210
-
211
- <a name="3.0.4"></a>
212
-
213
- ## [3.0.4](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.3...ffe-spinner-react@3.0.4) (2018-02-20)
214
-
215
- **Note:** Version bump only for package ffe-spinner-react
216
-
217
- <a name="3.0.3"></a>
218
-
219
- ## [3.0.3](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.2...ffe-spinner-react@3.0.3) (2018-02-15)
220
-
221
- **Note:** Version bump only for package ffe-spinner-react
222
-
223
- <a name="3.0.2"></a>
224
-
225
- ## [3.0.2](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.1...ffe-spinner-react@3.0.2) (2018-02-01)
226
-
227
- **Note:** Version bump only for package ffe-spinner-react
228
-
229
- <a name="3.0.1"></a>
230
-
231
- ## [3.0.1](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.0...ffe-spinner-react@3.0.1) (2018-01-22)
232
-
233
- **Note:** Version bump only for package ffe-spinner-react
234
-
235
- <a name="3.0.0"></a>
236
-
237
- # 3.0.0 (2018-01-22)
238
-
239
- ### Chores
240
-
241
- - **ffe-spinner-react:** Reimplement ffe-spinner-react
242
-
243
- ### BREAKING CHANGES
244
-
245
- - **ffe-spinner-react:** This commit reimplements and simplifies the
246
- ffe-spinner-react implementation. It no longer includes layout, which
247
- requires the consumer to place it correctly.
248
-
249
- The `<InlineSpinner />` and `<LargeSpinner />` are now available as
250
- `<Spinner large={true|false} />`.
251
-
252
- The previous `<Spinner />` implementation, which wrapped a large
253
- spinner in a `ffe-content-container` class is now removed. To keep this
254
- behavior, the consumer can create its own implementation of a
255
- `<SpinnerWithLayout />` or something similar.
256
-
257
- ## 2.0.4
258
-
259
- - Document and refactor internally.
260
- - Deprecate `text` prop in favor of `children`
261
-
262
- ## 2.0.3
263
-
264
- - Use PropTypes from prop-types package
265
-
266
- ## 2.0.2
267
-
268
- - Expand peerDep scope of `ffe-spinner` to include `2.x`.
269
- - Remove peerDep on `ffe-core`.
270
-
271
- ## 2.0.1
272
-
273
- - Upgrade eslint to use latest ffe config
274
-
275
- # 2.0.0
276
-
277
- - peerDependency on `ffe-core` bumped to `^8.0.2`
278
- - Added explicit dependency on `ffe-core` and `ffe-spinner`
279
- - Added a budo example page that can be launched with `npm start`
280
-
281
- ## 1.0.2
282
-
283
- - peerDependency on `ffe-core` relaxed to `^6.0.0`
284
-
285
- ## 1.0.1
286
-
287
- - peerDependency on `ffe-core` relaxed to `^5.0.0`
288
-
289
- # 1.0.0
290
-
291
- - 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
- });