@spark-web/spinner 1.0.7 → 1.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,182 @@
1
+ # @spark-web/spinner
2
+
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#382](https://github.com/brighte-labs/spark-web/pull/382)
8
+ [`955bf5d`](https://github.com/brighte-labs/spark-web/commit/955bf5d7698bfdf45e7f317aa3e726c81d3444c0)
9
+ Thanks [@dilipt-brighte](https://github.com/dilipt-brighte)! - Updates React
10
+ version to latest (18.2.0)
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ [[`955bf5d`](https://github.com/brighte-labs/spark-web/commit/955bf5d7698bfdf45e7f317aa3e726c81d3444c0)]:
16
+ - @spark-web/a11y@1.4.0
17
+ - @spark-web/box@1.2.0
18
+ - @spark-web/icon@1.3.0
19
+ - @spark-web/utils@1.3.0
20
+
21
+ ## 1.0.8
22
+
23
+ ### Patch Changes
24
+
25
+ - [#218](https://github.com/brighte-labs/spark-web/pull/218)
26
+ [`6fc8d1b`](https://github.com/brighte-labs/spark-web/commit/6fc8d1bc37e25d0cd622bc37f68a1d92eb5961b5)
27
+ Thanks [@nderkim](https://github.com/nderkim)! - Rename files to kebab case
28
+
29
+ - [#222](https://github.com/brighte-labs/spark-web/pull/222)
30
+ [`7f93c45`](https://github.com/brighte-labs/spark-web/commit/7f93c45bbae8c765e10df9d0dd7615473797749b)
31
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update
32
+ dependencies
33
+
34
+ - [#242](https://github.com/brighte-labs/spark-web/pull/242)
35
+ [`6df05f7`](https://github.com/brighte-labs/spark-web/commit/6df05f764e4181c140d6547d6b897d0210468f6a)
36
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - - Add homepage
37
+ and repository keys to package.json
38
+ - Add CHANGELOG and README to files key in package.json
39
+ - Updated dependencies
40
+ [[`adc5e9e`](https://github.com/brighte-labs/spark-web/commit/adc5e9e6c99acd117f3261edcefdb5573132441b),
41
+ [`de99b9c`](https://github.com/brighte-labs/spark-web/commit/de99b9c7f72373bd1902cf67f5cfec9a1e1db01c),
42
+ [`6fc8d1b`](https://github.com/brighte-labs/spark-web/commit/6fc8d1bc37e25d0cd622bc37f68a1d92eb5961b5),
43
+ [`7f93c45`](https://github.com/brighte-labs/spark-web/commit/7f93c45bbae8c765e10df9d0dd7615473797749b),
44
+ [`6df05f7`](https://github.com/brighte-labs/spark-web/commit/6df05f764e4181c140d6547d6b897d0210468f6a)]:
45
+ - @spark-web/box@1.1.0
46
+ - @spark-web/icon@1.2.2
47
+ - @spark-web/a11y@1.3.2
48
+ - @spark-web/utils@1.2.3
49
+
50
+ ## 1.0.7
51
+
52
+ ### Patch Changes
53
+
54
+ - [#208](https://github.com/brighte-labs/spark-web/pull/208)
55
+ [`1ea26ef`](https://github.com/brighte-labs/spark-web/commit/1ea26ef04a3b45875ed0dd2326eeab1fbe1e4bc5)
56
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Lower required
57
+ node version
58
+
59
+ - Updated dependencies
60
+ [[`1ea26ef`](https://github.com/brighte-labs/spark-web/commit/1ea26ef04a3b45875ed0dd2326eeab1fbe1e4bc5)]:
61
+ - @spark-web/a11y@1.3.1
62
+ - @spark-web/box@1.0.9
63
+ - @spark-web/icon@1.2.1
64
+ - @spark-web/utils@1.2.2
65
+
66
+ ## 1.0.6
67
+
68
+ ### Patch Changes
69
+
70
+ - [#197](https://github.com/brighte-labs/spark-web/pull/197)
71
+ [`94016d8`](https://github.com/brighte-labs/spark-web/commit/94016d84e26bbe55833bbcbab847a2cce6041538)
72
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update packages
73
+
74
+ - Updated dependencies
75
+ [[`51b6c7a`](https://github.com/brighte-labs/spark-web/commit/51b6c7a43f441e02b90403b13af9cfa11e5438ef),
76
+ [`07286b5`](https://github.com/brighte-labs/spark-web/commit/07286b52f897909b1a806d736e1040351c93078f),
77
+ [`94016d8`](https://github.com/brighte-labs/spark-web/commit/94016d84e26bbe55833bbcbab847a2cce6041538)]:
78
+ - @spark-web/a11y@1.3.0
79
+ - @spark-web/icon@1.2.0
80
+ - @spark-web/box@1.0.8
81
+ - @spark-web/utils@1.2.1
82
+
83
+ ## 1.0.5
84
+
85
+ ### Patch Changes
86
+
87
+ - [#173](https://github.com/brighte-labs/spark-web/pull/173)
88
+ [`90b7e9c`](https://github.com/brighte-labs/spark-web/commit/90b7e9cf4eb7e864d765c74b22c3dedf3d262e25)
89
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update babel
90
+ dependency
91
+
92
+ - Updated dependencies
93
+ [[`90b7e9c`](https://github.com/brighte-labs/spark-web/commit/90b7e9cf4eb7e864d765c74b22c3dedf3d262e25),
94
+ [`be99536`](https://github.com/brighte-labs/spark-web/commit/be99536abb56dd26e5c9a1703e6df9c7860b449b),
95
+ [`c3867af`](https://github.com/brighte-labs/spark-web/commit/c3867af7b77dfae3580ab63a5d5c9e8452f2da62)]:
96
+ - @spark-web/a11y@1.2.0
97
+ - @spark-web/box@1.0.7
98
+ - @spark-web/icon@1.1.5
99
+ - @spark-web/utils@1.2.0
100
+
101
+ ## 1.0.4
102
+
103
+ ### Patch Changes
104
+
105
+ - [#167](https://github.com/brighte-labs/spark-web/pull/167)
106
+ [`4f79350`](https://github.com/brighte-labs/spark-web/commit/4f793508fdb43ddd452f0d59a3126101f9fa5459)
107
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update Babel
108
+
109
+ - Updated dependencies
110
+ [[`4f79350`](https://github.com/brighte-labs/spark-web/commit/4f793508fdb43ddd452f0d59a3126101f9fa5459),
111
+ [`f524009`](https://github.com/brighte-labs/spark-web/commit/f5240098cf731b0a2e351b7b585711e893a33736)]:
112
+ - @spark-web/a11y@1.1.0
113
+ - @spark-web/box@1.0.6
114
+ - @spark-web/icon@1.1.4
115
+ - @spark-web/utils@1.1.5
116
+
117
+ ## 1.0.3
118
+
119
+ ### Patch Changes
120
+
121
+ - [#142](https://github.com/brighte-labs/spark-web/pull/142)
122
+ [`500939d`](https://github.com/brighte-labs/spark-web/commit/500939de7c45c93d48078f39151035ab9eba057f)
123
+ Thanks [@clothoo](https://github.com/clothoo)! - Add role 'progressbar'
124
+
125
+ ## 1.0.2
126
+
127
+ ### Patch Changes
128
+
129
+ - [#113](https://github.com/brighte-labs/spark-web/pull/113)
130
+ [`156236d`](https://github.com/brighte-labs/spark-web/commit/156236d2474aee66a0b8e2030635f9c08a5b78ba)
131
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update
132
+ dependencies
133
+
134
+ - Updated dependencies
135
+ [[`156236d`](https://github.com/brighte-labs/spark-web/commit/156236d2474aee66a0b8e2030635f9c08a5b78ba)]:
136
+ - @spark-web/box@1.0.5
137
+ - @spark-web/icon@1.1.3
138
+ - @spark-web/utils@1.1.3
139
+
140
+ ## 1.0.1
141
+
142
+ ### Patch Changes
143
+
144
+ - [#87](https://github.com/brighte-labs/spark-web/pull/87)
145
+ [`5744b68`](https://github.com/brighte-labs/spark-web/commit/5744b6820f626b93a14e11e1fbd96bcbe1b12b27)
146
+ Thanks [@ChristopherMitchell242](https://github.com/ChristopherMitchell242)! -
147
+ Data attribute added to component props to allow consumers to attach
148
+ customattributes to components
149
+
150
+ * [#52](https://github.com/brighte-labs/spark-web/pull/52)
151
+ [`82ab744`](https://github.com/brighte-labs/spark-web/commit/82ab744f198466810f3386bc459b8ab4d57c820e)
152
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Add files array
153
+ to package.json files
154
+
155
+ - [#63](https://github.com/brighte-labs/spark-web/pull/63)
156
+ [`58a7284`](https://github.com/brighte-labs/spark-web/commit/58a728457bbbda86ac406a72d8ec4ad6c1c16630)
157
+ Thanks [@jordangeizer](https://github.com/jordangeizer)! - Patched loader
158
+ animation so that it doesn't disappear on last keyframe.
159
+
160
+ - Updated dependencies
161
+ [[`82ab744`](https://github.com/brighte-labs/spark-web/commit/82ab744f198466810f3386bc459b8ab4d57c820e),
162
+ [`df618d9`](https://github.com/brighte-labs/spark-web/commit/df618d92d534e06f06ecedc95ea6bdd51cdc906b)]:
163
+ - @spark-web/box@1.0.4
164
+ - @spark-web/icon@1.1.2
165
+ - @spark-web/utils@1.1.2
166
+
167
+ ## 1.0.0
168
+
169
+ ### Major Changes
170
+
171
+ - [#44](https://github.com/brighte-labs/spark-web/pull/44)
172
+ [`11e7365`](https://github.com/brighte-labs/spark-web/commit/11e73659ff4a01a48a8761821bff34c6ec28568b)
173
+ Thanks [@matildaPan](https://github.com/matildaPan)! - initial release of
174
+ spinner component
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies
179
+ [[`11e7365`](https://github.com/brighte-labs/spark-web/commit/11e73659ff4a01a48a8761821bff34c6ec28568b),
180
+ [`11e7365`](https://github.com/brighte-labs/spark-web/commit/11e73659ff4a01a48a8761821bff34c6ec28568b)]:
181
+ - @spark-web/icon@1.1.0
182
+ - @spark-web/utils@1.1.0
package/README.md CHANGED
@@ -4,13 +4,14 @@ storybookPath: feedback-overlays-spinner--default
4
4
  isExperimentalPackage: true
5
5
  ---
6
6
 
7
- Spinner indicates users that their request is in progress
7
+ Spinner indicates to users that their request is in progress. In most cases
8
+ [you should use the `loading` prop on a Button instead of using this component directly](/package/button#loading).
8
9
 
9
10
  ## Examples
10
11
 
11
12
  ### Tones
12
13
 
13
- The appearance of Spinner can be cutomised with the tone prop.
14
+ The appearance of Spinner can be customised with the tone prop.
14
15
 
15
16
  Defaults to `primary`.
16
17
 
@@ -18,30 +19,49 @@ Defaults to `primary`.
18
19
  const tones = ['secondary', 'critical', 'positive', 'neutral'];
19
20
 
20
21
  return (
21
- <Stack align="left" gap="xxlarge">
22
- <Inline gap="xxlarge">
22
+ <Stack align="left" gap="large">
23
+ <Inline gap="large">
23
24
  {tones.map(tone => (
24
- <Button tone={tone} prominence="low" key={tone}>
25
- <Spinner />
26
- </Button>
27
- ))}
28
- </Inline>
29
- <Inline gap="xxlarge">
30
- {tones.map(tone => (
31
- <Button tone={tone} key={tone}>
32
- <Spinner />
33
- </Button>
34
- ))}
35
- </Inline>
36
- <Inline gap="xxlarge">
37
- {tones.map(tone => (
38
- <Spinner tone={tone} key={tone} />
25
+ <Spinner key={tone} tone={tone} />
39
26
  ))}
40
27
  </Inline>
41
28
  </Stack>
42
29
  );
43
30
  ```
44
31
 
32
+ ```jsx live
33
+ const backgrounds = [
34
+ // Light
35
+ ['surface', 'positiveLight', 'infoLight', 'cautionLight', 'criticalLight'],
36
+ // Dark
37
+ ['muted', 'positive', 'info', 'caution', 'critical'],
38
+ ];
39
+
40
+ return (
41
+ <Stack gap="large">
42
+ {backgrounds.map((backgroundLightness, index) => (
43
+ <Inline key={index} gap="large">
44
+ {backgroundLightness.map(background => (
45
+ <Box
46
+ key={background}
47
+ background={background}
48
+ shadow="medium"
49
+ height="medium"
50
+ width="medium"
51
+ display="flex"
52
+ flexShrink={0}
53
+ alignItems="center"
54
+ justifyContent="center"
55
+ >
56
+ <Spinner />
57
+ </Box>
58
+ ))}
59
+ </Inline>
60
+ ))}
61
+ </Stack>
62
+ );
63
+ ```
64
+
45
65
  ## Size
46
66
 
47
67
  Spinners available in two size: `xxsmall` and `xsmall`.
@@ -49,23 +69,17 @@ Spinners available in two size: `xxsmall` and `xsmall`.
49
69
  Defaults to `xsmall`.
50
70
 
51
71
  ```jsx live
52
- <Inline gap="xxlarge">
53
- <Row gap="xxlarge">
54
- <Spinner size="xxsmall" />
55
- <Spinner size="xsmall" />
56
- </Row>
57
- </Inline>
72
+ <Row gap="large">
73
+ <Spinner size="xxsmall" />
74
+ <Spinner size="xsmall" />
75
+ </Row>
58
76
  ```
59
77
 
60
78
  ## Props
61
79
 
62
80
  ### Spinner
63
81
 
64
- | Prop | Type | Default | Description |
65
- | ----- | -------------------------------------- | --------- | ----------------------------------------------------------------- |
66
- | size? | 'xxsmall' \| 'xsmall' | | The size of the nested radios. |
67
- | tone? | 'critical' \| 'positive' \| 'neutral' | 'neutral' | Provide a tone to influence elements of the field, and its input. |
68
- | data? | [DataAttributeMap][data-attribute-map] | | Sets data attributes on the component. |
82
+ <PropsTable displayName="Spinner" />
69
83
 
70
84
  [data-attribute-map]:
71
85
  https://github.com/brighte-labs/spark-web/blob/e7f6f4285b4cfd876312cc89fbdd094039aa239a/packages/utils/src/internal/buildDataAttributes.ts#L1
@@ -1,2 +1,2 @@
1
- export { Spinner } from './Spinner';
2
- export type { SpinnerProps } from './Spinner';
1
+ export { Spinner } from './spinner';
2
+ export type { SpinnerProps } from './spinner';
@@ -2,9 +2,11 @@
2
2
  import type { IconProps } from '@spark-web/icon';
3
3
  import type { DataAttributeMap } from '@spark-web/utils/internal';
4
4
  export declare type SpinnerProps = {
5
+ /** Provide a tone to influence elements of the field, and its input. */
5
6
  tone?: IconProps['tone'];
7
+ /** The size of the nested radios. */
6
8
  size?: 'xxsmall' | 'xsmall';
7
- /** Allows setting of data attributes on the underlying element. */
9
+ /** Sets data attributes for the element. */
8
10
  data?: DataAttributeMap;
9
11
  };
10
12
  export declare function Spinner({ tone, size, data }: SpinnerProps): JSX.Element;
@@ -11,9 +11,9 @@ var jsxRuntime = require('react/jsx-runtime');
11
11
 
12
12
  function Spinner(_ref) {
13
13
  var tone = _ref.tone,
14
- _ref$size = _ref.size,
15
- size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
16
- data = _ref.data;
14
+ _ref$size = _ref.size,
15
+ size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
16
+ data = _ref.data;
17
17
  var spinAnimationRef = utils.useSynchronizedAnimation(spinAnimation);
18
18
  var strokeAnimationRef = utils.useSynchronizedAnimation(strokeDashAnimation);
19
19
  var styles = useSpinnerStyles();
@@ -61,7 +61,6 @@ var strokeDashAnimation = css.keyframes({
61
61
  strokeDashoffset: '-55px'
62
62
  }
63
63
  });
64
-
65
64
  function useSpinnerStyles() {
66
65
  return {
67
66
  animation: "".concat(spinAnimation, " 1.4s linear infinite"),
@@ -11,9 +11,9 @@ var jsxRuntime = require('react/jsx-runtime');
11
11
 
12
12
  function Spinner(_ref) {
13
13
  var tone = _ref.tone,
14
- _ref$size = _ref.size,
15
- size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
16
- data = _ref.data;
14
+ _ref$size = _ref.size,
15
+ size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
16
+ data = _ref.data;
17
17
  var spinAnimationRef = utils.useSynchronizedAnimation(spinAnimation);
18
18
  var strokeAnimationRef = utils.useSynchronizedAnimation(strokeDashAnimation);
19
19
  var styles = useSpinnerStyles();
@@ -61,7 +61,6 @@ var strokeDashAnimation = css.keyframes({
61
61
  strokeDashoffset: '-55px'
62
62
  }
63
63
  });
64
-
65
64
  function useSpinnerStyles() {
66
65
  return {
67
66
  animation: "".concat(spinAnimation, " 1.4s linear infinite"),
@@ -7,9 +7,9 @@ import { jsx, jsxs } from 'react/jsx-runtime';
7
7
 
8
8
  function Spinner(_ref) {
9
9
  var tone = _ref.tone,
10
- _ref$size = _ref.size,
11
- size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
12
- data = _ref.data;
10
+ _ref$size = _ref.size,
11
+ size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
12
+ data = _ref.data;
13
13
  var spinAnimationRef = useSynchronizedAnimation(spinAnimation);
14
14
  var strokeAnimationRef = useSynchronizedAnimation(strokeDashAnimation);
15
15
  var styles = useSpinnerStyles();
@@ -57,7 +57,6 @@ var strokeDashAnimation = keyframes({
57
57
  strokeDashoffset: '-55px'
58
58
  }
59
59
  });
60
-
61
60
  function useSpinnerStyles() {
62
61
  return {
63
62
  animation: "".concat(spinAnimation, " 1.4s linear infinite"),
package/package.json CHANGED
@@ -1,23 +1,30 @@
1
1
  {
2
2
  "name": "@spark-web/spinner",
3
- "version": "1.0.7",
4
- "license": "MIT",
3
+ "version": "1.1.0",
4
+ "homepage": "https://github.com/brighte-labs/spark-web#readme",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/brighte-labs/spark-web.git",
8
+ "directory": "packages/spinner"
9
+ },
5
10
  "main": "dist/spark-web-spinner.cjs.js",
6
11
  "module": "dist/spark-web-spinner.esm.js",
7
12
  "files": [
8
- "dist"
13
+ "CHANGELOG.md",
14
+ "dist",
15
+ "README.md"
9
16
  ],
10
17
  "dependencies": {
11
- "@babel/runtime": "^7.18.9",
18
+ "@babel/runtime": "^7.19.0",
12
19
  "@emotion/css": "^11.9.0",
13
- "@spark-web/a11y": "^1.3.1",
14
- "@spark-web/box": "^1.0.9",
15
- "@spark-web/icon": "^1.2.1",
16
- "@spark-web/utils": "^1.2.2"
20
+ "@spark-web/a11y": "^1.4.0",
21
+ "@spark-web/box": "^1.2.0",
22
+ "@spark-web/icon": "^1.3.0",
23
+ "@spark-web/utils": "^1.3.0"
17
24
  },
18
25
  "devDependencies": {
19
- "@types/react": "^17.0.12",
20
- "react": "^17.0.2"
26
+ "@types/react": "^18.2.0",
27
+ "react": "^18.2.0"
21
28
  },
22
29
  "peerDependencies": {
23
30
  "react": ">=17.0.2"