@volksverpetzer/ui-web 0.5.0 → 0.6.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/Badge.css +8 -1
- package/dist/Badge.d.ts +4 -1
- package/dist/Badge.js +7 -2
- package/dist/styles.css +8 -1
- package/package.json +1 -1
package/dist/Badge.css
CHANGED
|
@@ -4,12 +4,19 @@
|
|
|
4
4
|
gap: var(--vvp-spacing-xs, 4px);
|
|
5
5
|
border-radius: var(--vvp-radius-full, 9999px);
|
|
6
6
|
padding: var(--vvp-spacing-xs, 4px) var(--vvp-spacing-sm, 8px);
|
|
7
|
-
font-size: var(--vvp-font-size-xs, 12px);
|
|
8
7
|
font-weight: 600;
|
|
9
8
|
line-height: 1.4;
|
|
10
9
|
white-space: nowrap;
|
|
11
10
|
}
|
|
12
11
|
|
|
12
|
+
.vvp-ui-badge--size-sm {
|
|
13
|
+
font-size: var(--vvp-font-size-xs, 12px);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.vvp-ui-badge--size-md {
|
|
17
|
+
font-size: var(--vvp-font-size-base, 16px);
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
.vvp-ui-badge__icon {
|
|
14
21
|
display: inline-flex;
|
|
15
22
|
width: 0.8em;
|
package/dist/Badge.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
import "./Badge.css";
|
|
3
3
|
export type BadgeVariant = "primary" | "accent" | "neutral" | "error" | "pruefpunkt";
|
|
4
|
+
export type BadgeSize = "sm" | "md";
|
|
4
5
|
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
6
|
variant?: BadgeVariant;
|
|
7
|
+
/** @default "md" */
|
|
8
|
+
size?: BadgeSize;
|
|
6
9
|
/** Rendered before the label — an SVG icon, sized to match the text. */
|
|
7
10
|
icon?: ReactNode;
|
|
8
11
|
children: ReactNode;
|
|
@@ -13,4 +16,4 @@ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
13
16
|
* color itself as text) rather than a solid fill, so it reads as a label
|
|
14
17
|
* rather than a button.
|
|
15
18
|
*/
|
|
16
|
-
export declare function Badge({ variant, icon, className, children, ...rest }: BadgeProps): import("react").JSX.Element;
|
|
19
|
+
export declare function Badge({ variant, size, icon, className, children, ...rest }: BadgeProps): import("react").JSX.Element;
|
package/dist/Badge.js
CHANGED
|
@@ -6,8 +6,13 @@ import "./Badge.css";
|
|
|
6
6
|
* color itself as text) rather than a solid fill, so it reads as a label
|
|
7
7
|
* rather than a button.
|
|
8
8
|
*/
|
|
9
|
-
export function Badge({ variant = "neutral", icon, className, children, ...rest }) {
|
|
10
|
-
const classes = [
|
|
9
|
+
export function Badge({ variant = "neutral", size = "md", icon, className, children, ...rest }) {
|
|
10
|
+
const classes = [
|
|
11
|
+
"vvp-ui-badge",
|
|
12
|
+
`vvp-ui-badge--${variant}`,
|
|
13
|
+
`vvp-ui-badge--size-${size}`,
|
|
14
|
+
className,
|
|
15
|
+
]
|
|
11
16
|
.filter(Boolean)
|
|
12
17
|
.join(" ");
|
|
13
18
|
return (_jsxs("span", { className: classes, ...rest, children: [icon ? (_jsx("span", { className: "vvp-ui-badge__icon", "aria-hidden": "true", children: icon })) : null, children] }));
|
package/dist/styles.css
CHANGED
|
@@ -4,12 +4,19 @@
|
|
|
4
4
|
gap: var(--vvp-spacing-xs, 4px);
|
|
5
5
|
border-radius: var(--vvp-radius-full, 9999px);
|
|
6
6
|
padding: var(--vvp-spacing-xs, 4px) var(--vvp-spacing-sm, 8px);
|
|
7
|
-
font-size: var(--vvp-font-size-xs, 12px);
|
|
8
7
|
font-weight: 600;
|
|
9
8
|
line-height: 1.4;
|
|
10
9
|
white-space: nowrap;
|
|
11
10
|
}
|
|
12
11
|
|
|
12
|
+
.vvp-ui-badge--size-sm {
|
|
13
|
+
font-size: var(--vvp-font-size-xs, 12px);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.vvp-ui-badge--size-md {
|
|
17
|
+
font-size: var(--vvp-font-size-base, 16px);
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
.vvp-ui-badge__icon {
|
|
14
21
|
display: inline-flex;
|
|
15
22
|
width: 0.8em;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volksverpetzer/ui-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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
6
|
"license": "MIT",
|