@versini/ui-pill 5.0.3 → 5.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/dist/index.d.ts +29 -29
- package/dist/index.js +86 -12
- package/package.json +9 -9
- package/dist/components/Pill/Pill.js +0 -46
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export {
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
export declare const Pill: ({ label, className, variant, description, }: PillProps) => JSX.Element;
|
|
4
|
+
|
|
5
|
+
export declare const PILL_CLASSNAME = "av-pill";
|
|
6
|
+
|
|
7
|
+
declare type PillProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Content of the Pill.
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* CSS class(es) to add to the main component wrapper.
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Hidden label adjacent to the pill text to provide added
|
|
18
|
+
* context for screen reader users, ideally no more
|
|
19
|
+
* than 2-3 words.
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Theme of the Pill.
|
|
24
|
+
* @default "information"
|
|
25
|
+
*/
|
|
26
|
+
variant?: "information" | "warning" | "error" | "success";
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,92 @@
|
|
|
1
|
-
import { PILL_CLASSNAME as o, Pill as I } from "./components/Pill/Pill.js";
|
|
2
1
|
/*!
|
|
3
|
-
@versini/ui-pill v5.0
|
|
2
|
+
@versini/ui-pill v5.1.0
|
|
4
3
|
© 2025 gizmette.com
|
|
5
4
|
*/
|
|
6
5
|
try {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
6
|
+
if (!window.__VERSINI_UI_PILL__) {
|
|
7
|
+
window.__VERSINI_UI_PILL__ = {
|
|
8
|
+
version: "5.1.0",
|
|
9
|
+
buildTime: "11/04/2025 03:45 PM EST",
|
|
10
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
11
|
+
license: "MIT",
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
} catch (error) {
|
|
15
|
+
// nothing to declare officer
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
import clsx from "clsx";
|
|
20
|
+
|
|
21
|
+
;// CONCATENATED MODULE: ./src/common/constants.ts
|
|
22
|
+
const PILL_CLASSNAME = "av-pill";
|
|
23
|
+
|
|
24
|
+
;// CONCATENATED MODULE: external "react/jsx-runtime"
|
|
25
|
+
|
|
26
|
+
;// CONCATENATED MODULE: external "clsx"
|
|
27
|
+
|
|
28
|
+
;// CONCATENATED MODULE: ./src/components/Pill/utilities.ts
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const getPillBorderClasses = ({ variant })=>{
|
|
32
|
+
return clsx("rounded-xs border", {
|
|
33
|
+
"border-border-information": variant === "information",
|
|
34
|
+
"border-border-warning": variant === "warning",
|
|
35
|
+
"border-border-success": variant === "success",
|
|
36
|
+
"border-border-error": variant === "error"
|
|
37
|
+
});
|
|
18
38
|
};
|
|
39
|
+
const getPillCopyClasses = ({ variant })=>{
|
|
40
|
+
return clsx("not-prose", {
|
|
41
|
+
"text-copy-information": variant === "information",
|
|
42
|
+
"text-copy-warning": variant === "warning",
|
|
43
|
+
"text-copy-success": variant === "success",
|
|
44
|
+
"text-copy-error": variant === "error"
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const getPillBackgroundClasses = ({ variant })=>{
|
|
48
|
+
return clsx({
|
|
49
|
+
"bg-surface-information": variant === "information",
|
|
50
|
+
"bg-surface-warning": variant === "warning",
|
|
51
|
+
"bg-surface-success": variant === "success",
|
|
52
|
+
"bg-surface-error": variant === "error"
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const getPillClasses = (props)=>{
|
|
56
|
+
const { className, variant } = props;
|
|
57
|
+
return clsx(PILL_CLASSNAME, "px-2 py-0.5 text-xs", getPillBorderClasses({
|
|
58
|
+
variant
|
|
59
|
+
}), getPillCopyClasses({
|
|
60
|
+
variant
|
|
61
|
+
}), getPillBackgroundClasses(props), className);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
;// CONCATENATED MODULE: ./src/components/Pill/Pill.tsx
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const Pill = ({ label, className, variant = "information", description })=>{
|
|
68
|
+
const pillClassName = getPillClasses({
|
|
69
|
+
label,
|
|
70
|
+
className,
|
|
71
|
+
variant
|
|
72
|
+
});
|
|
73
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
74
|
+
role: "text",
|
|
75
|
+
className: pillClassName,
|
|
76
|
+
children: [
|
|
77
|
+
description && /*#__PURE__*/ jsx("span", {
|
|
78
|
+
className: "sr-only",
|
|
79
|
+
children: description
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ jsx("span", {
|
|
82
|
+
children: label
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
;// CONCATENATED MODULE: ./src/components/index.ts
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
export { PILL_CLASSNAME, Pill };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-pill",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build:check": "tsc",
|
|
23
|
-
"build:js": "
|
|
24
|
-
"build:types": "
|
|
25
|
-
"build": "npm-run-all --serial clean build:check build:js
|
|
23
|
+
"build:js": "rslib build",
|
|
24
|
+
"build:types": "echo 'Types now built with rslib'",
|
|
25
|
+
"build": "npm-run-all --serial clean build:check build:js",
|
|
26
26
|
"clean": "rimraf dist tmp",
|
|
27
|
-
"dev:js": "
|
|
28
|
-
"dev:types": "
|
|
29
|
-
"dev": "
|
|
27
|
+
"dev:js": "rslib build --watch",
|
|
28
|
+
"dev:types": "echo 'Types now watched with rslib'",
|
|
29
|
+
"dev": "rslib build --watch",
|
|
30
30
|
"lint": "biome lint src",
|
|
31
31
|
"lint:fix": "biome check src --write --no-errors-on-unmatched",
|
|
32
32
|
"prettier": "biome check --write --no-errors-on-unmatched",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@tailwindcss/typography": "0.5.19",
|
|
44
44
|
"clsx": "2.1.1",
|
|
45
|
-
"tailwindcss": "4.1.
|
|
45
|
+
"tailwindcss": "4.1.16"
|
|
46
46
|
},
|
|
47
47
|
"sideEffects": [
|
|
48
48
|
"**/*.css"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "7484ad443b77ef31e52ae3a7d88b8129bc6cdf1d"
|
|
51
51
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import e from "clsx";
|
|
3
|
-
const i = "av-pill", a = ({ variant: r }) => e("rounded-xs border", {
|
|
4
|
-
"border-border-information": r === "information",
|
|
5
|
-
"border-border-warning": r === "warning",
|
|
6
|
-
"border-border-success": r === "success",
|
|
7
|
-
"border-border-error": r === "error"
|
|
8
|
-
}), u = ({ variant: r }) => e("not-prose", {
|
|
9
|
-
"text-copy-information": r === "information",
|
|
10
|
-
"text-copy-warning": r === "warning",
|
|
11
|
-
"text-copy-success": r === "success",
|
|
12
|
-
"text-copy-error": r === "error"
|
|
13
|
-
}), d = ({ variant: r }) => e({
|
|
14
|
-
"bg-surface-information": r === "information",
|
|
15
|
-
"bg-surface-warning": r === "warning",
|
|
16
|
-
"bg-surface-success": r === "success",
|
|
17
|
-
"bg-surface-error": r === "error"
|
|
18
|
-
}), g = (r) => {
|
|
19
|
-
const { className: o, variant: s } = r;
|
|
20
|
-
return e(
|
|
21
|
-
i,
|
|
22
|
-
"px-2 py-0.5 text-xs",
|
|
23
|
-
a({ variant: s }),
|
|
24
|
-
u({ variant: s }),
|
|
25
|
-
d(r),
|
|
26
|
-
o
|
|
27
|
-
);
|
|
28
|
-
}, f = ({
|
|
29
|
-
label: r,
|
|
30
|
-
className: o,
|
|
31
|
-
variant: s = "information",
|
|
32
|
-
description: n
|
|
33
|
-
}) => {
|
|
34
|
-
const t = g({
|
|
35
|
-
className: o,
|
|
36
|
-
variant: s
|
|
37
|
-
});
|
|
38
|
-
return /* @__PURE__ */ l("div", { role: "text", className: t, children: [
|
|
39
|
-
n && /* @__PURE__ */ c("span", { className: "sr-only", children: n }),
|
|
40
|
-
/* @__PURE__ */ c("span", { children: r })
|
|
41
|
-
] });
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
i as PILL_CLASSNAME,
|
|
45
|
-
f as Pill
|
|
46
|
-
};
|