@hraness/design-kit 0.40.3 → 0.41.1

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.
@@ -133,16 +133,22 @@ function MarketingActions({
133
133
  * gutter for every direct child role. Products set `--hraness-site-accent`
134
134
  * on this element or on a parent.
135
135
  */
136
+ /** Where a product landscape draws (see LANDSCAPE.md): behind the whole page, behind one element, or nowhere. */
137
+ export type ProductLandscapeHost = "page" | "contained" | "off";
138
+
136
139
  export function MarketingPage({
137
140
  children,
138
141
  className,
139
142
  id,
143
+ landscape,
140
144
  preset,
141
145
  pattern,
142
146
  }: Readonly<{
143
147
  children: ReactNode;
144
148
  className?: string;
145
149
  id?: string;
150
+ /** Draw the product landscape from product-landscape.css behind this page. */
151
+ landscape?: ProductLandscapeHost;
146
152
  /** Opt in to the separately imported product-marketing-preset.css contract. */
147
153
  preset?: MarketingPreset;
148
154
  /**
@@ -153,9 +159,10 @@ export function MarketingPage({
153
159
  pattern?: MarketingPattern;
154
160
  }>) {
155
161
  if (preset !== undefined && preset !== "editorial" && preset !== "minimal") throw new RangeError("Unknown marketing preset.");
162
+ if (landscape !== undefined && landscape !== "page" && landscape !== "contained" && landscape !== "off") throw new RangeError("Unknown landscape host.");
156
163
  assertMarketingPattern(pattern);
157
164
  return (
158
- <div className={classNames("hraness-marketing-page", className)} data-hraness-marketing="page" data-hraness-marketing-preset={preset} data-hraness-pattern={pattern} id={id}>
165
+ <div className={classNames("hraness-marketing-page", className)} data-hraness-landscape={landscape} data-hraness-marketing="page" data-hraness-marketing-preset={preset} data-hraness-pattern={pattern} id={id}>
159
166
  {children}
160
167
  </div>
161
168
  );
@@ -738,7 +745,8 @@ export function marketingProofFrameAddress(url: string): string {
738
745
  * A captioned frame around a screenshot, recording, or code-built mockup.
739
746
  * `chrome` draws a window title bar, a browser address bar, or a terminal
740
747
  * title bar above the content. A `title` without `chrome` keeps the window
741
- * bar. The browser bar shows `url` as host and path.
748
+ * bar. The browser bar shows `url` as host and path. A window or terminal
749
+ * bar without a title draws only the window lights.
742
750
  */
743
751
  export function MarketingProofFrame({
744
752
  caption,
@@ -766,8 +774,8 @@ export function MarketingProofFrame({
766
774
  if (url !== undefined && chrome !== "browser") throw new RangeError("Proof frame url needs chrome=\"browser\".");
767
775
  const bar = chrome ?? (title === undefined ? undefined : "window");
768
776
  const label = bar === "browser" ? (url === undefined ? title : marketingProofFrameAddress(url)) : title;
769
- if (bar !== undefined && (label === undefined || label.trim() === "")) {
770
- throw new RangeError(`Proof frame chrome=${bar} needs ${bar === "browser" ? "a url or title" : "a title"}.`);
777
+ if (bar === "browser" && (label === undefined || label.trim() === "")) {
778
+ throw new RangeError("Proof frame chrome=browser needs a url or title.");
771
779
  }
772
780
  return (
773
781
  <figure
@@ -786,7 +794,9 @@ export function MarketingProofFrame({
786
794
  </span>
787
795
  {bar === "browser"
788
796
  ? <span className={classNames("hraness-marketing-proof-frame__address")}>{label}</span>
789
- : <span className={classNames("hraness-marketing-proof-frame__title", undefined, bar === "terminal" ? "terminal" : "default")}>{label}</span>}
797
+ : label === undefined || label.trim() === ""
798
+ ? null
799
+ : <span className={classNames("hraness-marketing-proof-frame__title", undefined, bar === "terminal" ? "terminal" : "default")}>{label}</span>}
790
800
  </div>
791
801
  )}
792
802
  <div className={classNames("hraness-marketing-proof-frame__content")}>{children}</div>
@@ -1161,6 +1171,8 @@ export function MarketingStatStrip({
1161
1171
  export interface MarketingInterface {
1162
1172
  readonly example?: ReactNode;
1163
1173
  readonly label: string;
1174
+ /** A reference link pinned to the foot of the card, aligned to the end. */
1175
+ readonly link?: MarketingLink;
1164
1176
  readonly summary: string;
1165
1177
  }
1166
1178
 
@@ -1205,6 +1217,13 @@ export function MarketingInterfaceGrid({
1205
1217
  </Heading>
1206
1218
  <p className={classNames("hraness-marketing-interface__summary")}>{entry.summary}</p>
1207
1219
  {entry.example}
1220
+ {entry.link === undefined
1221
+ ? null
1222
+ : (
1223
+ <p className={classNames("hraness-marketing-interface__action")}>
1224
+ <a className={classNames("hraness-marketing-interface__link")} data-hraness-marketing="interfaces" href={entry.link.href}>{entry.link.label}</a>
1225
+ </p>
1226
+ )}
1208
1227
  </article>
1209
1228
  ))}
1210
1229
  </div>
package/src/styles.css CHANGED
@@ -19,6 +19,7 @@
19
19
  @import "./status-page.css";
20
20
  @import "./product-marketing.css";
21
21
  @import "./product-marketing-foundation.css";
22
+ @import "./product-landscape.css";
22
23
  @import "./design-gallery.css";
23
24
  @import "./mockups.css";
24
25
  @import "./palette-bridge.css";