@volksverpetzer/ui-web 0.11.0 → 0.12.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/ToolPage.css CHANGED
@@ -19,6 +19,25 @@
19
19
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
20
20
  }
21
21
 
22
+ /*
23
+ * Unlike __background, this sits in normal document flow (not absolutely
24
+ * positioned, full opacity) — a real banner image pushes the rest of the
25
+ * page down instead of sitting faintly behind it.
26
+ */
27
+ .vvp-ui-tool-page__header-image {
28
+ position: relative;
29
+ z-index: 0;
30
+ width: 100%;
31
+ overflow: hidden;
32
+ line-height: 0;
33
+ }
34
+
35
+ .vvp-ui-tool-page__header-image img {
36
+ display: block;
37
+ width: 100%;
38
+ height: auto;
39
+ }
40
+
22
41
  .vvp-ui-tool-page__background svg {
23
42
  width: 100%;
24
43
  height: 100%;
@@ -60,6 +79,18 @@
60
79
  gap: var(--vvp-spacing-xl, 20px);
61
80
  }
62
81
 
82
+ /*
83
+ * Below ~640px the centered title runs the full viewport width and can
84
+ * reach right up under the fixed topbar (its ~16px offset + button height
85
+ * already eats into the default 40px top padding on its own). Push content
86
+ * down far enough to clear it instead of just the topbar's top offset.
87
+ */
88
+ @media (max-width: 640px) {
89
+ .vvp-ui-tool-page__inner {
90
+ padding-top: calc(var(--vvp-spacing-huge, 40px) * 2);
91
+ }
92
+ }
93
+
63
94
  /* Matches ai.volksverpetzer.de's pre-results state: the header/content/
64
95
  tags/help block sits in the vertical middle of the viewport rather than
65
96
  pinned to the top. */
@@ -18,6 +18,14 @@ export interface ToolPageProps extends Omit<HTMLAttributes<HTMLDivElement>, "tit
18
18
  githubUrl?: string;
19
19
  /** @default true */
20
20
  background?: boolean;
21
+ /**
22
+ * Full-width header image (e.g. a campaign banner), rendered above the
23
+ * title/content in normal document flow instead of the decorative
24
+ * jagged background shape — pass whatever `<img>`/`<Image>` element
25
+ * fits the consuming framework. Takes precedence over `background`
26
+ * when set (mutually exclusive, not layered).
27
+ */
28
+ headerImage?: ReactNode;
21
29
  /**
22
30
  * Vertically centers the icon/title/tags/content/helpText block in the
23
31
  * middle of the viewport — the pre-results look on ai.volksverpetzer.de.
@@ -34,6 +42,8 @@ export interface ToolPageProps extends Omit<HTMLAttributes<HTMLDivElement>, "tit
34
42
  * and this app's audio converter list. Centered icon/title/tags header,
35
43
  * full-width content slot, optional help text below it, a fixed top-right
36
44
  * corner with `ThemeToggle` and an optional GitHub link, and (by default)
37
- * a decorative jagged brand-blue shape along the top edge.
45
+ * a decorative jagged brand-blue shape along the top edge — or a full-width
46
+ * `headerImage` in its place for pages with a real banner (e.g. a campaign
47
+ * photo) instead of the abstract shape.
38
48
  */
39
- export declare function ToolPage({ icon, title, tags, children, helpText, githubUrl, background, centered, className, ...rest }: ToolPageProps): import("react").JSX.Element;
49
+ export declare function ToolPage({ icon, title, tags, children, helpText, githubUrl, background, headerImage, centered, className, ...rest }: ToolPageProps): import("react").JSX.Element;
package/dist/ToolPage.js CHANGED
@@ -9,9 +9,11 @@ const GithubIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", wid
9
9
  * and this app's audio converter list. Centered icon/title/tags header,
10
10
  * full-width content slot, optional help text below it, a fixed top-right
11
11
  * corner with `ThemeToggle` and an optional GitHub link, and (by default)
12
- * a decorative jagged brand-blue shape along the top edge.
12
+ * a decorative jagged brand-blue shape along the top edge — or a full-width
13
+ * `headerImage` in its place for pages with a real banner (e.g. a campaign
14
+ * photo) instead of the abstract shape.
13
15
  */
14
- export function ToolPage({ icon, title, tags, children, helpText, githubUrl, background = true, centered = false, className, ...rest }) {
16
+ export function ToolPage({ icon, title, tags, children, helpText, githubUrl, background = true, headerImage, centered = false, className, ...rest }) {
15
17
  const classes = ["vvp-ui-tool-page", className].filter(Boolean).join(" ");
16
18
  const innerClasses = [
17
19
  "vvp-ui-tool-page__inner",
@@ -19,5 +21,5 @@ export function ToolPage({ icon, title, tags, children, helpText, githubUrl, bac
19
21
  ]
20
22
  .filter(Boolean)
21
23
  .join(" ");
22
- return (_jsxs("div", { className: classes, ...rest, children: [background ? (_jsx("div", { className: "vvp-ui-tool-page__background", "aria-hidden": "true", children: _jsx("svg", { viewBox: "0 0 1440 320", preserveAspectRatio: "none", fill: "var(--vvp-primary, #1b7194)", children: _jsx("path", { d: "M0,0 L0,140 L75,70 L155,160 L235,50 L310,170 L390,80 L465,175 L545,60 L620,150 L700,40 L775,165 L855,75 L935,175 L1010,55 L1090,145 L1165,65 L1245,165 L1320,85 L1440,130 L1440,0 Z" }) }) })) : null, _jsxs("div", { className: "vvp-ui-tool-page__topbar", children: [githubUrl ? (_jsx("a", { href: githubUrl, target: "_blank", rel: "noopener noreferrer", "aria-label": "GitHub", className: "vvp-ui-btn vvp-ui-btn--ghost vvp-ui-btn--sm vvp-ui-tool-page__icon-link", children: _jsx(GithubIcon, {}) })) : null, _jsx(ThemeToggle, {})] }), _jsxs("div", { className: innerClasses, children: [_jsxs("div", { className: "vvp-ui-tool-page__header", children: [_jsxs("h1", { className: "vvp-ui-tool-page__title", children: [icon ? (_jsx("span", { className: "vvp-ui-tool-page__icon", "aria-hidden": "true", children: icon })) : null, title] }), tags && tags.length > 0 ? (_jsx("div", { className: "vvp-ui-tool-page__tags", children: tags.map((tag, index) => (_jsx(Badge, { variant: tag.variant ?? "neutral", size: "sm", children: tag.label }, index))) })) : null] }), _jsx("div", { className: "vvp-ui-tool-page__content", children: children }), helpText ? _jsx("p", { className: "vvp-ui-tool-page__help", children: helpText }) : null] })] }));
24
+ return (_jsxs("div", { className: classes, ...rest, children: [headerImage ? (_jsx("div", { className: "vvp-ui-tool-page__header-image", children: headerImage })) : background ? (_jsx("div", { className: "vvp-ui-tool-page__background", "aria-hidden": "true", children: _jsx("svg", { viewBox: "0 0 1440 320", preserveAspectRatio: "none", fill: "var(--vvp-primary, #1b7194)", children: _jsx("path", { d: "M0,0 L0,140 L75,70 L155,160 L235,50 L310,170 L390,80 L465,175 L545,60 L620,150 L700,40 L775,165 L855,75 L935,175 L1010,55 L1090,145 L1165,65 L1245,165 L1320,85 L1440,130 L1440,0 Z" }) }) })) : null, _jsxs("div", { className: "vvp-ui-tool-page__topbar", children: [githubUrl ? (_jsx("a", { href: githubUrl, target: "_blank", rel: "noopener noreferrer", "aria-label": "GitHub", className: "vvp-ui-btn vvp-ui-btn--ghost vvp-ui-btn--sm vvp-ui-tool-page__icon-link", children: _jsx(GithubIcon, {}) })) : null, _jsx(ThemeToggle, {})] }), _jsxs("div", { className: innerClasses, children: [_jsxs("div", { className: "vvp-ui-tool-page__header", children: [_jsxs("h1", { className: "vvp-ui-tool-page__title", children: [icon ? (_jsx("span", { className: "vvp-ui-tool-page__icon", "aria-hidden": "true", children: icon })) : null, title] }), tags && tags.length > 0 ? (_jsx("div", { className: "vvp-ui-tool-page__tags", children: tags.map((tag, index) => (_jsx(Badge, { variant: tag.variant ?? "neutral", size: "sm", children: tag.label }, index))) })) : null] }), _jsx("div", { className: "vvp-ui-tool-page__content", children: children }), helpText ? _jsx("p", { className: "vvp-ui-tool-page__help", children: helpText }) : null] })] }));
23
25
  }
package/dist/styles.css CHANGED
@@ -453,6 +453,25 @@
453
453
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
454
454
  }
455
455
 
456
+ /*
457
+ * Unlike __background, this sits in normal document flow (not absolutely
458
+ * positioned, full opacity) — a real banner image pushes the rest of the
459
+ * page down instead of sitting faintly behind it.
460
+ */
461
+ .vvp-ui-tool-page__header-image {
462
+ position: relative;
463
+ z-index: 0;
464
+ width: 100%;
465
+ overflow: hidden;
466
+ line-height: 0;
467
+ }
468
+
469
+ .vvp-ui-tool-page__header-image img {
470
+ display: block;
471
+ width: 100%;
472
+ height: auto;
473
+ }
474
+
456
475
  .vvp-ui-tool-page__background svg {
457
476
  width: 100%;
458
477
  height: 100%;
@@ -494,6 +513,18 @@
494
513
  gap: var(--vvp-spacing-xl, 20px);
495
514
  }
496
515
 
516
+ /*
517
+ * Below ~640px the centered title runs the full viewport width and can
518
+ * reach right up under the fixed topbar (its ~16px offset + button height
519
+ * already eats into the default 40px top padding on its own). Push content
520
+ * down far enough to clear it instead of just the topbar's top offset.
521
+ */
522
+ @media (max-width: 640px) {
523
+ .vvp-ui-tool-page__inner {
524
+ padding-top: calc(var(--vvp-spacing-huge, 40px) * 2);
525
+ }
526
+ }
527
+
497
528
  /* Matches ai.volksverpetzer.de's pre-results state: the header/content/
498
529
  tags/help block sits in the vertical middle of the viewport rather than
499
530
  pinned to the top. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volksverpetzer/ui-web",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Shared brand-visible React components (Button, Badge, Card, ProgressBar, Input, Alert, Slider, ThemeToggle, InputButton) for vvp_link_shortener, vvp_divi5_extensions, crowdfunding, and vectorcrawl. 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",