@spark-ui/spinner 0.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 +14 -0
- package/LICENSE +21 -0
- package/dist/Spinner.d.ts +8 -0
- package/dist/Spinner.variants.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +7 -0
- package/package.json +18 -0
- package/tsconfig.json +4 -0
- package/vite.config.ts +6 -0
package/CHANGELOG.md
ADDED
@@ -0,0 +1,14 @@
|
|
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
|
+
# 0.1.0 (2023-04-17)
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
- **spinner:** add current color as default ([7e5b55b](https://github.com/adevinta/spark/commit/7e5b55b5d55a5514de07ce118e88a529bc0dece0))
|
11
|
+
- **spinner:** add first iteration of spinner component ([930e715](https://github.com/adevinta/spark/commit/930e7154e13880b8623565a84b7f5a82e83adf25))
|
12
|
+
- **spinner:** bump version ([c517dd0](https://github.com/adevinta/spark/commit/c517dd0b34723add844de5d503bb248098b59275))
|
13
|
+
- **spinner:** update sizes ([5e2c296](https://github.com/adevinta/spark/commit/5e2c29680fd7c423403be7a1b3a4c89938c1e0ee))
|
14
|
+
- **spinner:** update spinner story and add background visible prop ([cc89533](https://github.com/adevinta/spark/commit/cc89533dfecdc2cd294f5ff2d6719d20092a1c87))
|
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
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.
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
2
|
+
import { SpinnerVariantsProps } from './Spinner.variants';
|
3
|
+
export interface SpinnerProps extends ComponentPropsWithoutRef<'div'>, SpinnerVariantsProps {
|
4
|
+
label?: string;
|
5
|
+
}
|
6
|
+
export declare const Spinner: import("react").ForwardRefExoticComponent<SpinnerProps & {
|
7
|
+
children?: import("react").ReactNode;
|
8
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
2
|
+
export declare const spinnerVariants: (props?: ({
|
3
|
+
size?: "sm" | "md" | null | undefined;
|
4
|
+
intent?: "current" | "primary" | "secondary" | "success" | "alert" | "error" | "info" | "neutral" | null | undefined;
|
5
|
+
isBackgroundVisible?: boolean | null | undefined;
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
7
|
+
export type SpinnerVariantsProps = VariantProps<typeof spinnerVariants>;
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export { Spinner } from './Spinner';
|
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),l=require("@spark-ui/visually-hidden"),d=require("class-variance-authority").cva(["inline-block","border-solid","rounded-full","border-md","animate-spin"],{variants:{size:{sm:["w-sz-20","h-sz-20"],md:["w-sz-28","h-sz-28"]},intent:{current:["border-current"],primary:["border-primary"],secondary:["border-secondary"],success:["border-success"],alert:["border-alert"],error:["border-error"],info:["border-info"],neutral:["border-neutral"]},isBackgroundVisible:{true:["border-b-neutral-container","border-l-neutral-container"],false:["border-b-transparent","border-l-transparent"]}},defaultVariants:{intent:"current",size:"sm",isBackgroundVisible:!1}}),c=r.forwardRef(({className:n,size:a,intent:i,label:e,isBackgroundVisible:s,...t},o)=>r.createElement("div",{ref:o,className:d({className:n,size:a,intent:i,isBackgroundVisible:s}),...t},e&&r.createElement(l.VisuallyHidden,null,e)));exports.Spinner=c;
|
package/dist/index.mjs
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
import e, { forwardRef as d } from "react";
|
2
|
+
import { VisuallyHidden as l } from "@spark-ui/visually-hidden";
|
3
|
+
import { cva as c } from "class-variance-authority";
|
4
|
+
const b = c(["inline-block", "border-solid", "rounded-full", "border-md", "animate-spin"], { variants: { size: { sm: ["w-sz-20", "h-sz-20"], md: ["w-sz-28", "h-sz-28"] }, intent: { current: ["border-current"], primary: ["border-primary"], secondary: ["border-secondary"], success: ["border-success"], alert: ["border-alert"], error: ["border-error"], info: ["border-info"], neutral: ["border-neutral"] }, isBackgroundVisible: { true: ["border-b-neutral-container", "border-l-neutral-container"], false: ["border-b-transparent", "border-l-transparent"] } }, defaultVariants: { intent: "current", size: "sm", isBackgroundVisible: !1 } }), p = d(({ className: n, size: s, intent: a, label: r, isBackgroundVisible: i, ...o }, t) => e.createElement("div", { ref: t, className: b({ className: n, size: s, intent: a, isBackgroundVisible: i }), ...o }, r && e.createElement(l, null, r)));
|
5
|
+
export {
|
6
|
+
p as Spinner
|
7
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"name": "@spark-ui/spinner",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"description": "Spinners provide a visual cue that an action is processing awaiting a course of change or a result.",
|
5
|
+
"publishConfig": {
|
6
|
+
"access": "public"
|
7
|
+
},
|
8
|
+
"main": "./dist/index.js",
|
9
|
+
"module": "./dist/index.mjs",
|
10
|
+
"types": "./dist/index.d.ts",
|
11
|
+
"scripts": {
|
12
|
+
"build": "vite build"
|
13
|
+
},
|
14
|
+
"dependencies": {
|
15
|
+
"@spark-ui/visually-hidden": "0"
|
16
|
+
},
|
17
|
+
"gitHead": "c86977c12539bba059b82a1cf0c69da91d1919d8"
|
18
|
+
}
|
package/tsconfig.json
ADDED