@spark-web/spinner 5.1.0-rc.0 → 5.1.1
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 +23 -7
- package/CLAUDE.md +73 -0
- package/dist/declarations/src/spinner.d.ts +1 -1
- package/dist/spark-web-spinner.cjs.d.ts +1 -1
- package/dist/spark-web-spinner.cjs.dev.js +1 -1
- package/dist/spark-web-spinner.cjs.prod.js +1 -1
- package/dist/spark-web-spinner.esm.js +1 -1
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
# @spark-web/spinner
|
|
2
2
|
|
|
3
|
-
## 5.1.
|
|
3
|
+
## 5.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#782](https://github.com/brighte-labs/spark-web/pull/782)
|
|
8
|
+
[`bb41800`](https://github.com/brighte-labs/spark-web/commit/bb418004d21165f72f4bf2456afea844ee04a21c)
|
|
9
|
+
Thanks [@jacobporci-brighte](https://github.com/jacobporci-brighte)! -
|
|
10
|
+
**docs:** add CLAUDE.md AI context files to foundation and form packages;
|
|
11
|
+
patch data-table with manual sort and spinner overlay patterns
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
[[`bb41800`](https://github.com/brighte-labs/spark-web/commit/bb418004d21165f72f4bf2456afea844ee04a21c)]:
|
|
14
|
+
- @spark-web/box@6.0.1
|
|
15
|
+
|
|
16
|
+
## 5.1.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
6
19
|
|
|
7
|
-
-
|
|
20
|
+
- [#667](https://github.com/brighte-labs/spark-web/pull/667)
|
|
21
|
+
[`80d9c15`](https://github.com/brighte-labs/spark-web/commit/80d9c156a40bbcd2b1a91a2d0403b3c8e9b47b4e)
|
|
22
|
+
Thanks [@Leo704099](https://github.com/Leo704099)! - Support react 17 to 19
|
|
8
23
|
|
|
9
24
|
### Patch Changes
|
|
10
25
|
|
|
11
|
-
- Updated dependencies
|
|
12
|
-
-
|
|
13
|
-
- @spark-web/
|
|
14
|
-
- @spark-web/
|
|
15
|
-
- @spark-web/
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
[[`80d9c15`](https://github.com/brighte-labs/spark-web/commit/80d9c156a40bbcd2b1a91a2d0403b3c8e9b47b4e)]:
|
|
28
|
+
- @spark-web/utils@5.1.0
|
|
29
|
+
- @spark-web/a11y@5.3.0
|
|
30
|
+
- @spark-web/icon@5.1.0
|
|
31
|
+
- @spark-web/box@6.0.0
|
|
16
32
|
|
|
17
33
|
## 5.0.1
|
|
18
34
|
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @spark-web/spinner — AI Context
|
|
2
|
+
|
|
3
|
+
## What this is
|
|
4
|
+
|
|
5
|
+
An animated circular loading indicator. Used to communicate that an async
|
|
6
|
+
operation is in progress. Includes a visually hidden "is loading" label for
|
|
7
|
+
screen readers.
|
|
8
|
+
|
|
9
|
+
## What this is NOT
|
|
10
|
+
|
|
11
|
+
- Not a progress bar — does not communicate percentage completion
|
|
12
|
+
- Not the loading state for `DataTable` — use the `isLoading` prop on
|
|
13
|
+
`DataTable` instead of placing a `Spinner` externally alongside the table
|
|
14
|
+
- Not a skeleton loader — for page-level skeleton loading use placeholder shapes
|
|
15
|
+
|
|
16
|
+
## Props interface
|
|
17
|
+
|
|
18
|
+
| Prop | Type | Default | Notes |
|
|
19
|
+
| ------ | ----------------------- | ----------- | -------------------------- |
|
|
20
|
+
| `tone` | icon tone (string) | — | Controls SVG stroke color |
|
|
21
|
+
| `size` | `'xxsmall' \| 'xsmall'` | `'xxsmall'` | Visual size of the spinner |
|
|
22
|
+
| `data` | `DataAttributeMap` | — | Test/analytics attributes |
|
|
23
|
+
|
|
24
|
+
## Common tones
|
|
25
|
+
|
|
26
|
+
- `tone="primary"` — green on white surface (default loading state)
|
|
27
|
+
- `tone="neutral"` — grey, for subdued contexts
|
|
28
|
+
- No tone — inherits ambient foreground color
|
|
29
|
+
|
|
30
|
+
## Common patterns
|
|
31
|
+
|
|
32
|
+
### Inline loading overlay (not inside DataTable)
|
|
33
|
+
|
|
34
|
+
Use only when you cannot use `DataTable`'s `isLoading` prop — e.g., a full-page
|
|
35
|
+
overlay or a custom loading region:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
{
|
|
39
|
+
isLoading && (
|
|
40
|
+
<Box
|
|
41
|
+
display="flex"
|
|
42
|
+
flexDirection="column"
|
|
43
|
+
alignItems="center"
|
|
44
|
+
justifyContent="center"
|
|
45
|
+
gap="small"
|
|
46
|
+
padding="xlarge"
|
|
47
|
+
>
|
|
48
|
+
<Spinner tone="primary" size="xsmall" />
|
|
49
|
+
<Text tone="muted">Loading</Text>
|
|
50
|
+
</Box>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Inline next to text
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<Row gap="small" alignY="center">
|
|
59
|
+
<Spinner tone="primary" />
|
|
60
|
+
<Text tone="muted">Saving…</Text>
|
|
61
|
+
</Row>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Do NOTs
|
|
65
|
+
|
|
66
|
+
- NEVER render a `Spinner` outside `DataTable` to indicate table loading — use
|
|
67
|
+
`DataTable`'s `isLoading` prop
|
|
68
|
+
- NEVER use a size larger than `xsmall` — only `xxsmall` and `xsmall` are
|
|
69
|
+
supported
|
|
70
|
+
- NEVER wrap `<Spinner>` in `aria-hidden="true"` — the component includes a
|
|
71
|
+
built-in visually hidden `"is loading"` label for screen readers. The inner
|
|
72
|
+
SVG is already `aria-hidden` by the component; do not suppress the outer
|
|
73
|
+
element.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IconProps } from '@spark-web/icon';
|
|
2
2
|
import type { DataAttributeMap } from '@spark-web/utils/internal';
|
|
3
|
-
export
|
|
3
|
+
export type SpinnerProps = {
|
|
4
4
|
/** Provide a tone to influence elements of the field, and its input. */
|
|
5
5
|
tone?: IconProps['tone'];
|
|
6
6
|
/** The size of the nested radios. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./declarations/src/index";
|
|
1
|
+
export * from "./declarations/src/index.js";
|
|
2
2
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Bhcmstd2ViLXNwaW5uZXIuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
|
|
@@ -28,7 +28,7 @@ function Spinner(_ref) {
|
|
|
28
28
|
justifyContent: "center",
|
|
29
29
|
data: data,
|
|
30
30
|
children: [jsxRuntime.jsx(a11y.VisuallyHidden, {
|
|
31
|
-
children: "
|
|
31
|
+
children: "is loading"
|
|
32
32
|
}), jsxRuntime.jsx(SpinnerIcon, {
|
|
33
33
|
size: size,
|
|
34
34
|
tone: tone,
|
|
@@ -28,7 +28,7 @@ function Spinner(_ref) {
|
|
|
28
28
|
justifyContent: "center",
|
|
29
29
|
data: data,
|
|
30
30
|
children: [jsxRuntime.jsx(a11y.VisuallyHidden, {
|
|
31
|
-
children: "
|
|
31
|
+
children: "is loading"
|
|
32
32
|
}), jsxRuntime.jsx(SpinnerIcon, {
|
|
33
33
|
size: size,
|
|
34
34
|
tone: tone,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-web/spinner",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"homepage": "https://github.com/brighte-labs/spark-web#readme",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,23 +11,24 @@
|
|
|
11
11
|
"module": "dist/spark-web-spinner.esm.js",
|
|
12
12
|
"files": [
|
|
13
13
|
"CHANGELOG.md",
|
|
14
|
+
"CLAUDE.md",
|
|
14
15
|
"dist",
|
|
15
16
|
"README.md"
|
|
16
17
|
],
|
|
17
18
|
"dependencies": {
|
|
18
19
|
"@babel/runtime": "^7.25.0",
|
|
19
20
|
"@emotion/react": "^11.14.0",
|
|
20
|
-
"@spark-web/a11y": "^5.3.0
|
|
21
|
-
"@spark-web/box": "^6.0.
|
|
22
|
-
"@spark-web/icon": "^5.1.0
|
|
23
|
-
"@spark-web/utils": "^5.1.0
|
|
21
|
+
"@spark-web/a11y": "^5.3.0",
|
|
22
|
+
"@spark-web/box": "^6.0.1",
|
|
23
|
+
"@spark-web/icon": "^5.1.0",
|
|
24
|
+
"@spark-web/utils": "^5.1.0"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@types/react": "^19.1.0",
|
|
27
28
|
"react": "^19.1.0"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
|
-
"react": "
|
|
31
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
31
32
|
},
|
|
32
33
|
"engines": {
|
|
33
34
|
"node": ">=14"
|