@nucleux/spinner 0.0.0-stage → 0.6.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/LICENSE +21 -0
- package/README.md +33 -2
- package/dist/index.cjs +45 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nucleux
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nucleux/spinner
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Animated loading indicator — Nucleux agentic UI for React.
|
|
4
|
+
|
|
5
|
+
Part of **[Nucleux](https://github.com/intelligaia-open-labs/nucleux)** — agentic UI components for React. Install a single component, or the full kit via [`@nucleux/react`](https://www.npmjs.com/package/@nucleux/react).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Exports
|
|
9
|
+
|
|
10
|
+
- **`Spinner`** — spinning icon with `role="status"` and `aria-label="Loading"` (override the label to say what is loading)
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @nucleux/spinner @nucleux/tokens
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`react` / `react-dom` are peer dependencies.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { Spinner } from "@nucleux/spinner";
|
|
24
|
+
|
|
25
|
+
<Spinner />
|
|
26
|
+
<Button disabled leftIcon={<Spinner aria-label="Saving" />}>Saving…</Button>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Requires the theme once in your app: `import "@nucleux/tokens/styles.css";`
|
|
30
|
+
and the Tailwind preset from `@nucleux/tokens/preset`.
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
MIT © Nucleux
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var lucideReact = require('lucide-react');
|
|
6
|
+
var utils = require('@nucleux/utils');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
+
|
|
29
|
+
// src/index.tsx
|
|
30
|
+
var Spinner = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
+
lucideReact.Loader2,
|
|
32
|
+
{
|
|
33
|
+
ref,
|
|
34
|
+
role: "status",
|
|
35
|
+
"aria-label": "Loading",
|
|
36
|
+
"data-slot": "spinner",
|
|
37
|
+
className: utils.cn("size-4 animate-spin", className),
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
));
|
|
41
|
+
Spinner.displayName = "Spinner";
|
|
42
|
+
|
|
43
|
+
exports.Spinner = Spinner;
|
|
44
|
+
//# sourceMappingURL=index.cjs.map
|
|
45
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":["React","jsx","Loader2","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAM,OAAA,GAAgBA,4BAAwC,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC7FC,cAAA;AAAA,EAACC,mBAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,IAAA,EAAK,QAAA;AAAA,IACL,YAAA,EAAW,SAAA;AAAA,IACX,WAAA,EAAU,SAAA;AAAA,IACV,SAAA,EAAWC,QAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA;AAAA,IAC7C,GAAG;AAAA;AACN,CACD;AACD,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\nimport { Loader2, type LucideProps } from \"lucide-react\";\nimport { cn } from \"@nucleux/utils\";\n\nexport type SpinnerProps = LucideProps;\n\n/**\n * An animated loading indicator: a spinning lucide Loader2 icon, 16px by\n * default (resize with `className=\"size-6\"`, recolour with a text colour).\n * It carries `role=\"status\"` and `aria-label=\"Loading\"` so assistive tech\n * announces it; override `aria-label` to describe what is loading. Drop it\n * inside a Button, Badge or Empty to show work in progress.\n */\nexport const Spinner = React.forwardRef<SVGSVGElement, SpinnerProps>(({ className, ...props }, ref) => (\n <Loader2\n ref={ref}\n role=\"status\"\n aria-label=\"Loading\"\n data-slot=\"spinner\"\n className={cn(\"size-4 animate-spin\", className)}\n {...props}\n />\n));\nSpinner.displayName = \"Spinner\";\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LucideProps } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
type SpinnerProps = LucideProps;
|
|
5
|
+
/**
|
|
6
|
+
* An animated loading indicator: a spinning lucide Loader2 icon, 16px by
|
|
7
|
+
* default (resize with `className="size-6"`, recolour with a text colour).
|
|
8
|
+
* It carries `role="status"` and `aria-label="Loading"` so assistive tech
|
|
9
|
+
* announces it; override `aria-label` to describe what is loading. Drop it
|
|
10
|
+
* inside a Button, Badge or Empty to show work in progress.
|
|
11
|
+
*/
|
|
12
|
+
declare const Spinner: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
13
|
+
|
|
14
|
+
export { Spinner, type SpinnerProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LucideProps } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
type SpinnerProps = LucideProps;
|
|
5
|
+
/**
|
|
6
|
+
* An animated loading indicator: a spinning lucide Loader2 icon, 16px by
|
|
7
|
+
* default (resize with `className="size-6"`, recolour with a text colour).
|
|
8
|
+
* It carries `role="status"` and `aria-label="Loading"` so assistive tech
|
|
9
|
+
* announces it; override `aria-label` to describe what is loading. Drop it
|
|
10
|
+
* inside a Button, Badge or Empty to show work in progress.
|
|
11
|
+
*/
|
|
12
|
+
declare const Spinner: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
13
|
+
|
|
14
|
+
export { Spinner, type SpinnerProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Loader2 } from 'lucide-react';
|
|
4
|
+
import { cn } from '@nucleux/utils';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
// src/index.tsx
|
|
8
|
+
var Spinner = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9
|
+
Loader2,
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
role: "status",
|
|
13
|
+
"aria-label": "Loading",
|
|
14
|
+
"data-slot": "spinner",
|
|
15
|
+
className: cn("size-4 animate-spin", className),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
Spinner.displayName = "Spinner";
|
|
20
|
+
|
|
21
|
+
export { Spinner };
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;AAaO,IAAM,OAAA,GAAgB,iBAAwC,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC7F,GAAA;AAAA,EAAC,OAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,IAAA,EAAK,QAAA;AAAA,IACL,YAAA,EAAW,SAAA;AAAA,IACX,WAAA,EAAU,SAAA;AAAA,IACV,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA;AAAA,IAC7C,GAAG;AAAA;AACN,CACD;AACD,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\nimport { Loader2, type LucideProps } from \"lucide-react\";\nimport { cn } from \"@nucleux/utils\";\n\nexport type SpinnerProps = LucideProps;\n\n/**\n * An animated loading indicator: a spinning lucide Loader2 icon, 16px by\n * default (resize with `className=\"size-6\"`, recolour with a text colour).\n * It carries `role=\"status\"` and `aria-label=\"Loading\"` so assistive tech\n * announces it; override `aria-label` to describe what is loading. Drop it\n * inside a Button, Badge or Empty to show work in progress.\n */\nexport const Spinner = React.forwardRef<SVGSVGElement, SpinnerProps>(({ className, ...props }, ref) => (\n <Loader2\n ref={ref}\n role=\"status\"\n aria-label=\"Loading\"\n data-slot=\"spinner\"\n className={cn(\"size-4 animate-spin\", className)}\n {...props}\n />\n));\nSpinner.displayName = \"Spinner\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nucleux/spinner",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": ">=18",
|
|
22
|
+
"react-dom": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@nucleux/utils": "0.6.0",
|
|
26
|
+
"lucide-react": "^0.469.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"tsup": "^8.3.5",
|
|
30
|
+
"typescript": "^5.7.2",
|
|
31
|
+
"@types/react": "^18.3.18",
|
|
32
|
+
"react": "^18.3.1"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/intelligaia-open-labs/nucleux.git",
|
|
41
|
+
"directory": "packages/spinner"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/intelligaia-open-labs/nucleux#readme",
|
|
44
|
+
"description": "Animated loading indicator — Nucleux agentic UI for React.",
|
|
45
|
+
"keywords": [
|
|
46
|
+
"nucleux",
|
|
47
|
+
"react",
|
|
48
|
+
"ui",
|
|
49
|
+
"components",
|
|
50
|
+
"agentic",
|
|
51
|
+
"ai",
|
|
52
|
+
"tailwind",
|
|
53
|
+
"spinner"
|
|
54
|
+
],
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "tsup"
|
|
57
|
+
}
|
|
6
58
|
}
|