@spark-ui/badge 2.1.0 → 2.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 +8 -0
- package/README.md +6 -7
- package/dist/index.js +1 -1
- package/dist/index.mjs +8 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [2.1.1](https://github.com/adevinta/spark/compare/@spark-ui/badge@2.1.0...@spark-ui/badge@2.1.1) (2023-10-06)
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
- **badge:** border-box ([15d41ff](https://github.com/adevinta/spark/commit/15d41ffd56f62360301647ead953b3a157976cd4))
|
11
|
+
- **badge:** change rings for borders ([cd7911b](https://github.com/adevinta/spark/commit/cd7911be77457f8adaf8e4591d6b38b41e1b855a))
|
12
|
+
- **badge:** doc ([b649238](https://github.com/adevinta/spark/commit/b64923806799065834e5d9ab4b056c6842c2afb5))
|
13
|
+
|
6
14
|
# [2.1.0](https://github.com/adevinta/spark/compare/@spark-ui/badge@2.0.11...@spark-ui/badge@2.1.0) (2023-09-28)
|
7
15
|
|
8
16
|
### Bug Fixes
|
package/README.md
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
# Badge
|
2
2
|
> @spark-ui/badge
|
3
3
|
|
4
|
-
](https://sparkui.vercel.app/?path=/docs/components-badge--docs)
|
5
|
+
[](https://sparkui-adv.vercel.app/docs/components/badge)
|
6
|
+
[](https://github.com/adevinta/spark/issues/new?&projects=4&template=bug-report.yml&assignees=&labels=component,badge)
|
7
|
+
[](https://www.npmjs.com/package/@spark-ui/badge)
|
9
8
|
|
10
9
|
This package is part of the [`@spark-ui`](https://github.com/adevinta/spark) react-js user interface component library project.
|
11
10
|
|
12
|
-

|
11
|
+
[](https://github.com/adevinta/spark/issues?q=is%3Aopen+label%3Acomponent+label%3Abadge)
|
12
|
+
[](https://github.com/adevinta/spark/blob/main/packages/components/badge/LICENSE.md)
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),l=require("@spark-ui/internal-utils"),x=require("class-variance-authority"),
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),l=require("@spark-ui/internal-utils"),x=require("class-variance-authority"),d="danger",b="relative",y=x.cva(["inline-flex h-fit","empty:p-none","text-center font-bold","rounded-full box-content"],{variants:{intent:l.makeVariants({main:["bg-main","text-on-main","border-on-main"],support:["bg-support","text-on-support","border-on-support"],accent:["bg-accent","text-on-accent","border-on-accent"],success:["bg-success","text-on-success","border-on-success"],alert:["bg-alert","text-on-alert","border-on-alert"],danger:["bg-error","text-on-error","border-on-error"],info:["bg-info","text-on-info","border-on-info"],neutral:["bg-neutral","text-on-neutral","border-on-neutral"],surface:["bg-surface","text-on-surface","border-on-surface"],basic:["bg-basic","text-on-basic","border-on-basic"]}),size:l.makeVariants({sm:["text-small","px-[var(--sz-6)] py-[var(--sz-2)]","empty:h-sz-12 empty:w-sz-12"],md:["text-caption","px-md py-sm","empty:h-sz-16 empty:w-sz-16"]}),type:{relative:["absolute right-none translate-x-2/4 -translate-y-2/4 border-md"],standalone:[]}},defaultVariants:{intent:d,size:"md",type:b}}),i=e.forwardRef(({intent:t=d,size:r="md",type:n=b,count:a,overflowCount:o=99,"aria-label":s,className:m,...u},p)=>{const f=a&&a>o,g={...u,"aria-label":typeof s=="function"?s({count:a,overflowCount:o}):s};return e.createElement("span",{ref:p,"data-spark-component":"badge",role:"status",className:y({intent:t,size:r,type:n,className:m}),...g},f?`${o}+`:a)});i.displayName="BadgeItem";const c=e.forwardRef(({children:t,...r},n)=>t?e.createElement("div",{className:"relative inline-flex"},t,e.createElement(i,{ref:n,...r})):e.createElement(i,{ref:n,type:"standalone",...r}));c.displayName="Badge",exports.Badge=c;
|
package/dist/index.mjs
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import r, { forwardRef as
|
2
|
-
import { makeVariants as
|
3
|
-
import { cva as
|
4
|
-
const m = "danger",
|
5
|
-
const
|
6
|
-
return r.createElement("span", { ref: u, "data-spark-component": "badge", role: "status", className: y({ intent: e, size: t, type:
|
1
|
+
import r, { forwardRef as i } from "react";
|
2
|
+
import { makeVariants as c } from "@spark-ui/internal-utils";
|
3
|
+
import { cva as g } from "class-variance-authority";
|
4
|
+
const m = "danger", d = "relative", y = g(["inline-flex h-fit", "empty:p-none", "text-center font-bold", "rounded-full box-content"], { variants: { intent: c({ main: ["bg-main", "text-on-main", "border-on-main"], support: ["bg-support", "text-on-support", "border-on-support"], accent: ["bg-accent", "text-on-accent", "border-on-accent"], success: ["bg-success", "text-on-success", "border-on-success"], alert: ["bg-alert", "text-on-alert", "border-on-alert"], danger: ["bg-error", "text-on-error", "border-on-error"], info: ["bg-info", "text-on-info", "border-on-info"], neutral: ["bg-neutral", "text-on-neutral", "border-on-neutral"], surface: ["bg-surface", "text-on-surface", "border-on-surface"], basic: ["bg-basic", "text-on-basic", "border-on-basic"] }), size: c({ sm: ["text-small", "px-[var(--sz-6)] py-[var(--sz-2)]", "empty:h-sz-12 empty:w-sz-12"], md: ["text-caption", "px-md py-sm", "empty:h-sz-16 empty:w-sz-16"] }), type: { relative: ["absolute right-none translate-x-2/4 -translate-y-2/4 border-md"], standalone: [] } }, defaultVariants: { intent: m, size: "md", type: d } }), l = i(({ intent: e = m, size: t = "md", type: a = d, count: n, overflowCount: o = 99, "aria-label": s, className: p, ...b }, u) => {
|
5
|
+
const f = n && n > o, x = { ...b, "aria-label": typeof s == "function" ? s({ count: n, overflowCount: o }) : s };
|
6
|
+
return r.createElement("span", { ref: u, "data-spark-component": "badge", role: "status", className: y({ intent: e, size: t, type: a, className: p }), ...x }, f ? `${o}+` : n);
|
7
7
|
});
|
8
|
-
|
9
|
-
const v =
|
8
|
+
l.displayName = "BadgeItem";
|
9
|
+
const v = i(({ children: e, ...t }, a) => e ? r.createElement("div", { className: "relative inline-flex" }, e, r.createElement(l, { ref: a, ...t })) : r.createElement(l, { ref: a, type: "standalone", ...t }));
|
10
10
|
v.displayName = "Badge";
|
11
11
|
export {
|
12
12
|
v as Badge
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spark-ui/badge",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.1",
|
4
4
|
"description": "Badge component is a visual indicator for numeric values such as tallies and scores.",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -46,5 +46,5 @@
|
|
46
46
|
},
|
47
47
|
"homepage": "https://sparkui.vercel.app",
|
48
48
|
"license": "MIT",
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "8004dfcde56caeb54c5b88dbc206861ec3e69ae4"
|
50
50
|
}
|