@volksverpetzer/ui-web 0.4.0 → 0.5.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/dist/Badge.css +32 -8
- package/dist/Badge.d.ts +10 -3
- package/dist/Badge.js +9 -4
- package/dist/styles.css +32 -8
- package/package.json +3 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Volksverpetzer
|
|
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/dist/Badge.css
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
.vvp-ui-badge {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
|
+
gap: var(--vvp-spacing-xs, 4px);
|
|
4
5
|
border-radius: var(--vvp-radius-full, 9999px);
|
|
5
6
|
padding: var(--vvp-spacing-xs, 4px) var(--vvp-spacing-sm, 8px);
|
|
6
7
|
font-size: var(--vvp-font-size-xs, 12px);
|
|
7
|
-
font-weight:
|
|
8
|
-
line-height: 1.
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
line-height: 1.4;
|
|
10
|
+
white-space: nowrap;
|
|
9
11
|
}
|
|
10
12
|
|
|
13
|
+
.vvp-ui-badge__icon {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
width: 0.8em;
|
|
16
|
+
height: 0.8em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.vvp-ui-badge__icon svg {
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* Soft/tinted style: a light tint of the variant color as background, the
|
|
26
|
+
* variant color itself as text — reads as a label, not a button. Tints are
|
|
27
|
+
* derived with color-mix() rather than separate "light" tokens, so they
|
|
28
|
+
* stay in sync with the source color automatically.
|
|
29
|
+
*/
|
|
11
30
|
.vvp-ui-badge--primary {
|
|
12
|
-
background: var(--vvp-primary, #1b7194);
|
|
13
|
-
color: var(--vvp-
|
|
31
|
+
background: color-mix(in srgb, var(--vvp-primary, #1b7194) 15%, white);
|
|
32
|
+
color: var(--vvp-primary, #1b7194);
|
|
14
33
|
}
|
|
15
34
|
|
|
16
35
|
.vvp-ui-badge--accent {
|
|
17
|
-
background: var(--vvp-accent, #db2685);
|
|
18
|
-
color: var(--vvp-
|
|
36
|
+
background: color-mix(in srgb, var(--vvp-accent, #db2685) 15%, white);
|
|
37
|
+
color: var(--vvp-accent, #db2685);
|
|
19
38
|
}
|
|
20
39
|
|
|
21
40
|
.vvp-ui-badge--neutral {
|
|
@@ -24,6 +43,11 @@
|
|
|
24
43
|
}
|
|
25
44
|
|
|
26
45
|
.vvp-ui-badge--error {
|
|
27
|
-
background: var(--vvp-error, #c62828);
|
|
28
|
-
color: var(--vvp-
|
|
46
|
+
background: color-mix(in srgb, var(--vvp-error, #c62828) 15%, white);
|
|
47
|
+
color: var(--vvp-error, #c62828);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.vvp-ui-badge--pruefpunkt {
|
|
51
|
+
background: color-mix(in srgb, var(--vvp-pruefpunkt, #442674) 15%, white);
|
|
52
|
+
color: var(--vvp-pruefpunkt, #442674);
|
|
29
53
|
}
|
package/dist/Badge.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
import "./Badge.css";
|
|
3
|
-
export type BadgeVariant = "primary" | "accent" | "neutral" | "error";
|
|
3
|
+
export type BadgeVariant = "primary" | "accent" | "neutral" | "error" | "pruefpunkt";
|
|
4
4
|
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
5
|
variant?: BadgeVariant;
|
|
6
|
+
/** Rendered before the label — an SVG icon, sized to match the text. */
|
|
7
|
+
icon?: ReactNode;
|
|
6
8
|
children: ReactNode;
|
|
7
9
|
}
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Small pill label — category tags, status markers, counts. Soft/tinted
|
|
12
|
+
* style (a light tint of the variant color as background, the variant
|
|
13
|
+
* color itself as text) rather than a solid fill, so it reads as a label
|
|
14
|
+
* rather than a button.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Badge({ variant, icon, className, children, ...rest }: BadgeProps): import("react").JSX.Element;
|
package/dist/Badge.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "./Badge.css";
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Small pill label — category tags, status markers, counts. Soft/tinted
|
|
5
|
+
* style (a light tint of the variant color as background, the variant
|
|
6
|
+
* color itself as text) rather than a solid fill, so it reads as a label
|
|
7
|
+
* rather than a button.
|
|
8
|
+
*/
|
|
9
|
+
export function Badge({ variant = "neutral", icon, className, children, ...rest }) {
|
|
5
10
|
const classes = ["vvp-ui-badge", `vvp-ui-badge--${variant}`, className]
|
|
6
11
|
.filter(Boolean)
|
|
7
12
|
.join(" ");
|
|
8
|
-
return (
|
|
13
|
+
return (_jsxs("span", { className: classes, ...rest, children: [icon ? (_jsx("span", { className: "vvp-ui-badge__icon", "aria-hidden": "true", children: icon })) : null, children] }));
|
|
9
14
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
.vvp-ui-badge {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
|
+
gap: var(--vvp-spacing-xs, 4px);
|
|
4
5
|
border-radius: var(--vvp-radius-full, 9999px);
|
|
5
6
|
padding: var(--vvp-spacing-xs, 4px) var(--vvp-spacing-sm, 8px);
|
|
6
7
|
font-size: var(--vvp-font-size-xs, 12px);
|
|
7
|
-
font-weight:
|
|
8
|
-
line-height: 1.
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
line-height: 1.4;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.vvp-ui-badge__icon {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
width: 0.8em;
|
|
16
|
+
height: 0.8em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.vvp-ui-badge__icon svg {
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
9
22
|
}
|
|
10
23
|
|
|
24
|
+
/*
|
|
25
|
+
* Soft/tinted style: a light tint of the variant color as background, the
|
|
26
|
+
* variant color itself as text — reads as a label, not a button. Tints are
|
|
27
|
+
* derived with color-mix() rather than separate "light" tokens, so they
|
|
28
|
+
* stay in sync with the source color automatically.
|
|
29
|
+
*/
|
|
11
30
|
.vvp-ui-badge--primary {
|
|
12
|
-
background: var(--vvp-primary, #1b7194);
|
|
13
|
-
color: var(--vvp-
|
|
31
|
+
background: color-mix(in srgb, var(--vvp-primary, #1b7194) 15%, white);
|
|
32
|
+
color: var(--vvp-primary, #1b7194);
|
|
14
33
|
}
|
|
15
34
|
|
|
16
35
|
.vvp-ui-badge--accent {
|
|
17
|
-
background: var(--vvp-accent, #db2685);
|
|
18
|
-
color: var(--vvp-
|
|
36
|
+
background: color-mix(in srgb, var(--vvp-accent, #db2685) 15%, white);
|
|
37
|
+
color: var(--vvp-accent, #db2685);
|
|
19
38
|
}
|
|
20
39
|
|
|
21
40
|
.vvp-ui-badge--neutral {
|
|
@@ -24,8 +43,13 @@
|
|
|
24
43
|
}
|
|
25
44
|
|
|
26
45
|
.vvp-ui-badge--error {
|
|
27
|
-
background: var(--vvp-error, #c62828);
|
|
28
|
-
color: var(--vvp-
|
|
46
|
+
background: color-mix(in srgb, var(--vvp-error, #c62828) 15%, white);
|
|
47
|
+
color: var(--vvp-error, #c62828);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.vvp-ui-badge--pruefpunkt {
|
|
51
|
+
background: color-mix(in srgb, var(--vvp-pruefpunkt, #442674) 15%, white);
|
|
52
|
+
color: var(--vvp-pruefpunkt, #442674);
|
|
29
53
|
}
|
|
30
54
|
|
|
31
55
|
.vvp-ui-btn {
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volksverpetzer/ui-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Shared brand-visible React components (Button, Badge, Card) for vvp_link_shortener, vvp_divi5_extensions, and crowdfunding. Plain, hand-scoped CSS (vvp-ui-* class prefix) consuming the --vvp-* custom properties emitted by @volksverpetzer/design-tokens — no Tailwind classes, so it drops into a Tailwind app and Divi's WordPress-embedded CSS alike.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "https://github.com/Volksverpetzer/vvp_design_system.git",
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@types/react": "^19.2.18",
|
|
30
31
|
"react": "^19.2.3",
|
|
31
|
-
"typescript": "^
|
|
32
|
+
"typescript": "^6.0.3"
|
|
32
33
|
},
|
|
33
34
|
"scripts": {
|
|
34
35
|
"build": "tsc -p tsconfig.json && node scripts/bundle-css.mjs",
|