@spark-ui/badge 2.1.3 → 2.1.5
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 +10 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +8 -8
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@
|
|
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.5](https://github.com/adevinta/spark/compare/@spark-ui/badge@2.1.4...@spark-ui/badge@2.1.5) (2024-03-15)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @spark-ui/badge
|
9
|
+
|
10
|
+
## [2.1.4](https://github.com/adevinta/spark/compare/@spark-ui/badge@2.1.3...@spark-ui/badge@2.1.4) (2024-02-28)
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
- **badge:** badge outline now utilizes "surface" token ([79feadf](https://github.com/adevinta/spark/commit/79feadf159e93a2d26703108fec915d0a09ff6a5)), closes [#1906](https://github.com/adevinta/spark/issues/1906)
|
15
|
+
|
6
16
|
## [2.1.3](https://github.com/adevinta/spark/compare/@spark-ui/badge@2.1.2...@spark-ui/badge@2.1.3) (2024-01-29)
|
7
17
|
|
8
18
|
### Bug Fixes
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),i=require("@spark-ui/internal-utils"),p=require("class-variance-authority").cva(["inline-flex h-fit","empty:p-none","text-center font-bold","rounded-full box-content"],{variants:{intent:i.makeVariants({main:["bg-main","text-on-main","border-surface"],support:["bg-support","text-on-support","border-surface"],accent:["bg-accent","text-on-accent","border-surface"],success:["bg-success","text-on-success","border-surface"],alert:["bg-alert","text-on-alert","border-surface"],danger:["bg-error","text-on-error","border-surface"],info:["bg-info","text-on-info","border-surface"],neutral:["bg-neutral","text-on-neutral","border-surface"],surface:["bg-surface","text-on-surface","border-surface"],basic:["bg-basic","text-on-basic","border-surface"]}),size:i.makeVariants({sm:["text-small","px-[var(--sz-6)] py-[var(--sz-2)]","empty:size-sz-8"],md:["text-caption","px-md py-sm","empty:size-sz-16"]}),type:{relative:["absolute right-none border-md","translate-x-1/2 -translate-y-1/2"],standalone:[]}},defaultVariants:{intent:"danger",size:"md",type:"relative"}}),c=e.forwardRef(({intent:t="danger",size:r="md",type:a="relative",count:n,overflowCount:s=99,"aria-label":o,className:d,...u},f)=>{const b=n&&n>s,m={...u,"aria-label":typeof o=="function"?o({count:n,overflowCount:s}):o};return e.createElement("span",{ref:f,"data-spark-component":"badge",role:"status",className:p({intent:t,size:r,type:a,className:d}),...m},b?`${s}+`:n)});c.displayName="BadgeItem";const l=e.forwardRef(({children:t,...r},a)=>t?e.createElement("div",{className:"relative inline-flex"},t,e.createElement(c,{ref:a,...r})):e.createElement(c,{ref:a,type:"standalone",...r}));l.displayName="Badge",exports.Badge=l;
|
package/dist/index.mjs
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import n, { forwardRef as
|
2
|
-
import { makeVariants as
|
3
|
-
import { cva as
|
4
|
-
const x =
|
5
|
-
const
|
6
|
-
return n.createElement("span", { ref:
|
1
|
+
import n, { forwardRef as l } from "react";
|
2
|
+
import { makeVariants as i } from "@spark-ui/internal-utils";
|
3
|
+
import { cva as p } from "class-variance-authority";
|
4
|
+
const x = p(["inline-flex h-fit", "empty:p-none", "text-center font-bold", "rounded-full box-content"], { variants: { intent: i({ main: ["bg-main", "text-on-main", "border-surface"], support: ["bg-support", "text-on-support", "border-surface"], accent: ["bg-accent", "text-on-accent", "border-surface"], success: ["bg-success", "text-on-success", "border-surface"], alert: ["bg-alert", "text-on-alert", "border-surface"], danger: ["bg-error", "text-on-error", "border-surface"], info: ["bg-info", "text-on-info", "border-surface"], neutral: ["bg-neutral", "text-on-neutral", "border-surface"], surface: ["bg-surface", "text-on-surface", "border-surface"], basic: ["bg-basic", "text-on-basic", "border-surface"] }), size: i({ sm: ["text-small", "px-[var(--sz-6)] py-[var(--sz-2)]", "empty:size-sz-8"], md: ["text-caption", "px-md py-sm", "empty:size-sz-16"] }), type: { relative: ["absolute right-none border-md", "translate-x-1/2 -translate-y-1/2"], standalone: [] } }, defaultVariants: { intent: "danger", size: "md", type: "relative" } }), c = l(({ intent: e = "danger", size: t = "md", type: a = "relative", count: r, overflowCount: s = 99, "aria-label": o, className: d, ...f }, m) => {
|
5
|
+
const u = r && r > s, b = { ...f, "aria-label": typeof o == "function" ? o({ count: r, overflowCount: s }) : o };
|
6
|
+
return n.createElement("span", { ref: m, "data-spark-component": "badge", role: "status", className: x({ intent: e, size: t, type: a, className: d }), ...b }, u ? `${s}+` : r);
|
7
7
|
});
|
8
|
-
|
9
|
-
const g =
|
8
|
+
c.displayName = "BadgeItem";
|
9
|
+
const g = l(({ children: e, ...t }, a) => e ? n.createElement("div", { className: "relative inline-flex" }, e, n.createElement(c, { ref: a, ...t })) : n.createElement(c, { ref: a, type: "standalone", ...t }));
|
10
10
|
g.displayName = "Badge";
|
11
11
|
export {
|
12
12
|
g 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.5",
|
4
4
|
"description": "Badge component is a visual indicator for numeric values such as tallies and scores.",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"url": "https://github.com/adevinta/spark/issues?q=is%3Aopen+label%3Acomponent+label%3Abadge"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@spark-ui/internal-utils": "^2.
|
38
|
+
"@spark-ui/internal-utils": "^2.3.0",
|
39
39
|
"class-variance-authority": "0.7.0"
|
40
40
|
},
|
41
41
|
"peerDependencies": {
|
@@ -46,5 +46,5 @@
|
|
46
46
|
},
|
47
47
|
"homepage": "https://sparkui.vercel.app",
|
48
48
|
"license": "MIT",
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "017b58f0d658252f4548068dd2ec6f962c9202fd"
|
50
50
|
}
|