@sdxc/ui 2026.10.28 → 2026.10.29

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.
Files changed (64) hide show
  1. package/README.md +41 -4
  2. package/dist/components/accordion.d.ts +3 -1
  3. package/dist/components/accordion.js +3 -1
  4. package/dist/components/button.d.ts +4 -0
  5. package/dist/components/button.js +2 -0
  6. package/dist/components/card.d.ts +6 -4
  7. package/dist/components/carousel.d.ts +15 -0
  8. package/dist/components/carousel.js +15 -0
  9. package/dist/components/cta-group.d.ts +45 -0
  10. package/dist/components/cta-group.js +26 -0
  11. package/dist/components/empty.d.ts +5 -3
  12. package/dist/components/feature.d.ts +102 -0
  13. package/dist/components/feature.js +151 -0
  14. package/dist/components/heading.d.ts +20 -4
  15. package/dist/components/heading.js +25 -11
  16. package/dist/components/index.d.ts +7 -0
  17. package/dist/components/index.js +7 -0
  18. package/dist/components/link-button.d.ts +2 -0
  19. package/dist/components/logo-cloud.d.ts +42 -0
  20. package/dist/components/logo-cloud.js +41 -0
  21. package/dist/components/marketing-header.d.ts +71 -0
  22. package/dist/components/marketing-header.js +81 -0
  23. package/dist/components/marketing-section.d.ts +81 -0
  24. package/dist/components/marketing-section.js +103 -0
  25. package/dist/components/nav-link.d.ts +2 -1
  26. package/dist/components/split.d.ts +66 -0
  27. package/dist/components/split.js +115 -0
  28. package/dist/components/stat-strip.d.ts +52 -0
  29. package/dist/components/stat-strip.js +64 -0
  30. package/dist/patterns/accent-text.d.ts +30 -0
  31. package/dist/patterns/accent-text.js +17 -0
  32. package/dist/patterns/announcement-chip.d.ts +41 -0
  33. package/dist/patterns/announcement-chip.js +49 -0
  34. package/dist/patterns/bento.d.ts +67 -0
  35. package/dist/patterns/bento.js +95 -0
  36. package/dist/patterns/check-row.d.ts +67 -0
  37. package/dist/patterns/check-row.js +76 -0
  38. package/dist/patterns/closing-cta.d.ts +60 -0
  39. package/dist/patterns/closing-cta.js +31 -0
  40. package/dist/patterns/code-stage.d.ts +63 -0
  41. package/dist/patterns/code-stage.js +82 -0
  42. package/dist/patterns/faq-band.d.ts +67 -0
  43. package/dist/patterns/faq-band.js +43 -0
  44. package/dist/patterns/feature-band.d.ts +85 -0
  45. package/dist/patterns/feature-band.js +50 -0
  46. package/dist/patterns/icon-well.d.ts +38 -0
  47. package/dist/patterns/icon-well.js +38 -0
  48. package/dist/patterns/index.d.ts +23 -0
  49. package/dist/patterns/index.js +23 -0
  50. package/dist/patterns/install-tabs.d.ts +77 -0
  51. package/dist/patterns/install-tabs.js +87 -0
  52. package/dist/patterns/landing-hero.d.ts +93 -0
  53. package/dist/patterns/landing-hero.js +126 -0
  54. package/dist/patterns/product-frame.d.ts +60 -0
  55. package/dist/patterns/product-frame.js +70 -0
  56. package/dist/patterns/proof-strip.d.ts +48 -0
  57. package/dist/patterns/proof-strip.js +29 -0
  58. package/dist/patterns/step-list.d.ts +45 -0
  59. package/dist/patterns/step-list.js +84 -0
  60. package/dist/patterns/tabbed-stage.d.ts +74 -0
  61. package/dist/patterns/tabbed-stage.js +77 -0
  62. package/dist/styles/marketing.d.ts +12 -0
  63. package/dist/styles/marketing.js +17 -0
  64. package/package.json +3 -2
package/README.md CHANGED
@@ -222,6 +222,7 @@ Every export carries JSDoc, so the editor shows each full signature.
222
222
  ### Components: layout and content
223
223
 
224
224
  - `Card`, `Item`, `Group`, `Section`, `Separator`, `Toolbar` — panels, rows, groupings and dividers.
225
+ Prefer `Feature` over `Card`/`Empty` for marketing claim cells.
225
226
  - `ImagePlaceholder`, `Avatar`, `Logo` — an image with fallback, and its round and rounded-square
226
227
  presets.
227
228
  - `AspectRatio`, `Resizable`, `ScrollArea`, `Carousel` — a ratio lock, split panes, a scroll region,
@@ -233,10 +234,46 @@ Every export carries JSDoc, so the editor shows each full signature.
233
234
  - `ShortcutList` — a `<dl>` pairing actions with key caps.
234
235
  - `Highlight` — `{ text, match }` segments rendered with each match in a `<mark>`.
235
236
  - `HeadingScope`, `Heading` — a heading-depth scope, and the `<h1>`–`<h6>` that reads it.
237
+ `Heading` accepts `size="display" | "chapter"` for marketing type recipes.
236
238
  - `SharedElement` — a host with a stable view-transition name across page loads.
237
239
  - `Calendar`, `RangeCalendar`, `DatePicker`, `DateRangePicker` — month grids for a day or a range,
238
240
  and popover pickers around them; `Calendar` without children renders `<input type="date">`.
239
241
 
242
+ ### Components: marketing
243
+
244
+ - `MarketingSection` — landing band (`tone`, `spacing`, `align`, `ruled`, `variant="frame"`).
245
+ - `MarketingHeader` — eyebrow + chapter title + lead (`eyebrowVariant`: `pill` | `mono` | `chip`).
246
+ - `CtaGroup` — wrapping primary/secondary actions; pair nav `sm` (~32px) with hero `lg` (~48px).
247
+ - `Split`, `Split.Copy`, `Split.Media` — two-column band content (`lean`, optional `checks`).
248
+ - `StatStrip`, `StatStrip.Item` — numeric proof strip (`ruled` | `gap`).
249
+ - `LogoCloud` — muted adopter marks at `--ui-marketing-logo-height`.
250
+ - `Feature`, `Feature.Grid` — claim cells and a hairline-ruled grid (`variant="panel"` optional).
251
+
252
+ ### Patterns (`@sdxc/ui/patterns`)
253
+
254
+ Marketing building blocks and composition craft. Import from `@sdxc/ui/patterns` so product
255
+ chrome on the root catalog stays free of landing weight.
256
+
257
+ **Building blocks**
258
+
259
+ - `LandingHero` — eyebrow, display title, lead, `CtaGroup`, media (`mediaPlacement`: `end` | `below` | `background`).
260
+ - `ProofStrip` — compact ruled band for `LogoCloud` and/or `StatStrip` children.
261
+ - `FeatureBand` — header + `layout`: `split` | `grid` | `steps`.
262
+ - `FaqBand` — header + one or two `Accordion` columns (`columns={1|2}`).
263
+ - `ClosingCta` — inverse/tinted close with title, lead, and actions.
264
+
265
+ **Composition craft**
266
+
267
+ - `ProductFrame` — window/device chrome (`lights`, `title`, `url`).
268
+ - `CodeStage` / `TerminalPanel` — titled mono panel with optional actions slot.
269
+ - `InstallTabs`, `InstallTabs.Option` — radio dialect strip (no JS).
270
+ - `TabbedStage`, `TabbedStage.Item` — pill tabs controlling a media panel (no JS).
271
+ - `CheckList`, `CheckRow` — checked claims (`orientation`: `stacked` | `horizontal`).
272
+ - `IconWell` — tinted marketing glyph well (`sm` | `md` | `lg`).
273
+ - `Bento`, `Bento.Cell` — hairline-ruled equal columns.
274
+ - `StepList`, `StepList.Item` — numbered how-it-works steps.
275
+ - `AnnouncementChip`, `AccentText` — louder chip; emphasized phrase inside a headline.
276
+
240
277
  ### Component helpers
241
278
 
242
279
  - `readFormContext(handle): Form.Context | undefined` and
@@ -361,10 +398,10 @@ Recipes for a `mix` array: `floatingSurface()`, `surfaceInset()`, `hitArea()`, `
361
398
  Marketing / landing recipes (same entry): `marketingContainer()`,
362
399
  `marketingSectionSpace("hero" | "normal" | "compact")`,
363
400
  `marketingBandTone("plain" | "tinted" | "grid" | "inverse")`, `displayHeading(1 | 2 | 3)`,
364
- `marketingLead()`, `marketingHairline()`, `logoCloudMark()`. They read the `--ui-marketing-*`
365
- tokens and optional `--ui-font-display` from `theme.css`. Apply `viewReveal()` from
366
- `@sdxc/ui/animations` on band hosts for scroll entry; reduced-motion is handled there — no
367
- separate marketing animation system.
401
+ `marketingLead()`, `marketingHairline()`, `logoCloudMark()`, `marketingCtaChrome()`. They read
402
+ the `--ui-marketing-*` tokens and optional `--ui-font-display` from `theme.css`. Apply
403
+ `viewReveal()` from `@sdxc/ui/animations` on band hosts for scroll entry; reduced-motion is
404
+ handled there — no separate marketing animation system.
368
405
 
369
406
  ### Utilities
370
407
 
@@ -38,7 +38,9 @@ export declare namespace Accordion {
38
38
  /**
39
39
  * Renders the list's root host: a plain `<div>` that stacks
40
40
  * {@link Accordion.Item} sections in normal block flow, each drawing its own
41
- * divider so the whole list reads as one continuous group.
41
+ * divider so the whole list reads as one continuous group. A marketing FAQ
42
+ * lays two of these in a container-query grid under a {@link MarketingHeader},
43
+ * sharing one `name` across columns so only one item opens at a time.
42
44
  *
43
45
  * @param handle Runtime handle carrying the host `<div>`'s props.
44
46
  * @returns The render function producing the list's markup.
@@ -11,7 +11,9 @@ import { Disclosure } from "./disclosure.js";
11
11
  /**
12
12
  * Renders the list's root host: a plain `<div>` that stacks
13
13
  * {@link Accordion.Item} sections in normal block flow, each drawing its own
14
- * divider so the whole list reads as one continuous group.
14
+ * divider so the whole list reads as one continuous group. A marketing FAQ
15
+ * lays two of these in a container-query grid under a {@link MarketingHeader},
16
+ * sharing one `name` across columns so only one item opens at a time.
15
17
  *
16
18
  * @param handle Runtime handle carrying the host `<div>`'s props.
17
19
  * @returns The render function producing the list's markup.
@@ -25,6 +25,8 @@ export declare namespace Button {
25
25
  type Variant = "solid" | "outline" | "ghost";
26
26
  /**
27
27
  * Size variant controlling the button's padding and font size.
28
+ * Marketing pairing: `"sm"` is ~32px for nav rows, `"lg"` is ~48px for
29
+ * hero {@link CtaGroup} actions — keep those slots on different sizes.
28
30
  */
29
31
  type Size = "sm" | "md" | "lg";
30
32
  /**
@@ -74,5 +76,7 @@ export declare namespace Button {
74
76
  * <Button color="danger" variant="outline" size="sm">{t("actions.delete")}</Button>
75
77
  * @example
76
78
  * <Button type="submit" isPending={isSubmitting}>{t("actions.save")}</Button>
79
+ * @example
80
+ * <Button size="lg" color="brand" mix={[marketingCtaChrome()]}>{t("hero.cta")}</Button>
77
81
  */
78
82
  export declare function Button(handle: Handle<Button.Props>): () => import("remix/component").RemixElement;
@@ -50,6 +50,8 @@ function holdsOnlyAGlyph(children) {
50
50
  * <Button color="danger" variant="outline" size="sm">{t("actions.delete")}</Button>
51
51
  * @example
52
52
  * <Button type="submit" isPending={isSubmitting}>{t("actions.save")}</Button>
53
+ * @example
54
+ * <Button size="lg" color="brand" mix={[marketingCtaChrome()]}>{t("hero.cta")}</Button>
53
55
  */
54
56
  export function Button(handle) {
55
57
  return () => {
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * A bounded container grouping a header, body content, and footer actions
3
- * into one ring-edged, softly lifted panel tinted by a semantic color role.
4
- * The role colors border, background, and text together, so {@link Card.Title}
5
- * and {@link Card.Description} inherit their text color from the root through
6
- * ordinary CSS inheritance.
3
+ * into one ring-edged, softly lifted panel tinted by a semantic color role —
4
+ * product chrome, plan tiles, settings panels. Landing claim cells stay on
5
+ * the lighter {@link Feature} (use `variant="panel"` only when the cell itself
6
+ * is the interaction). The role colors border, background, and text together,
7
+ * so {@link Card.Title} and {@link Card.Description} inherit their text color
8
+ * from the root through ordinary CSS inheritance.
7
9
  *
8
10
  * @author [Sergio Xalambrí](https://sergiodxa.com)
9
11
  * @copyright Sergio Xalambrí 2026
@@ -84,6 +84,21 @@ export declare namespace Carousel {
84
84
  * <Carousel.Next commandfor="gallery-viewport" aria-label={t("gallery.next")} />
85
85
  * </Carousel.Controls>
86
86
  * </Carousel>
87
+ * @example
88
+ * // Marketing browser-flow strip: widen `--ui-carousel-slide-size` for product
89
+ * // frames and keep Previous/Next on `size="sm"` so controls stay quiet.
90
+ * <Carousel
91
+ * aria-label={t("flows.label")}
92
+ * style={{ "--ui-carousel-slide-size": "28rem" }}
93
+ * >
94
+ * <Carousel.Viewport id="flows" mix={[carouselControls()]}>
95
+ * <Carousel.Track>{slides}</Carousel.Track>
96
+ * </Carousel.Viewport>
97
+ * <Carousel.Controls>
98
+ * <Carousel.Previous commandfor="flows" aria-label={t("flows.previous")} />
99
+ * <Carousel.Next commandfor="flows" aria-label={t("flows.next")} />
100
+ * </Carousel.Controls>
101
+ * </Carousel>
87
102
  */
88
103
  export declare function Carousel(handle: Handle<Carousel.Props>): () => import("remix/component").RemixElement;
89
104
  export declare namespace Carousel {
@@ -56,6 +56,21 @@ const DEFAULT_NEXT_COMMAND = "--ui-next";
56
56
  * <Carousel.Next commandfor="gallery-viewport" aria-label={t("gallery.next")} />
57
57
  * </Carousel.Controls>
58
58
  * </Carousel>
59
+ * @example
60
+ * // Marketing browser-flow strip: widen `--ui-carousel-slide-size` for product
61
+ * // frames and keep Previous/Next on `size="sm"` so controls stay quiet.
62
+ * <Carousel
63
+ * aria-label={t("flows.label")}
64
+ * style={{ "--ui-carousel-slide-size": "28rem" }}
65
+ * >
66
+ * <Carousel.Viewport id="flows" mix={[carouselControls()]}>
67
+ * <Carousel.Track>{slides}</Carousel.Track>
68
+ * </Carousel.Viewport>
69
+ * <Carousel.Controls>
70
+ * <Carousel.Previous commandfor="flows" aria-label={t("flows.previous")} />
71
+ * <Carousel.Next commandfor="flows" aria-label={t("flows.next")} />
72
+ * </Carousel.Controls>
73
+ * </Carousel>
59
74
  */
60
75
  export function Carousel(handle) {
61
76
  return () => {
@@ -0,0 +1,45 @@
1
+ /**
2
+ * A horizontal cluster of primary and secondary marketing actions that wraps
3
+ * onto a second row when the container is narrow. Children are the page's own
4
+ * {@link Button} / {@link LinkButton} instances — pair nav rows at `size="sm"`
5
+ * (~32px) with hero rows at `size="lg"` (~48px).
6
+ *
7
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
8
+ * @copyright Sergio Xalambrí 2026
9
+ */
10
+ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
11
+ /**
12
+ * Prop types for {@link CtaGroup}.
13
+ */
14
+ export declare namespace CtaGroup {
15
+ /**
16
+ * Props accepted by {@link CtaGroup}.
17
+ */
18
+ interface Props extends TagProps<"div"> {
19
+ /**
20
+ * Action controls — typically a solid primary {@link Button} or
21
+ * {@link LinkButton} beside an outline secondary. The group does not
22
+ * invent buttons of its own.
23
+ */
24
+ children: RemixNode;
25
+ }
26
+ }
27
+ /**
28
+ * Lays action children in a wrapping inline-flex row with a compact gap so a
29
+ * primary and secondary CTA read as one cluster. Radius and size stay on the
30
+ * buttons; override `--ui-marketing-cta-radius` per brand for pill vs soft-rect
31
+ * corners when composing marketing CTAs.
32
+ *
33
+ * @param handle Runtime handle carrying the host `<div>`'s props.
34
+ * @returns The render function producing the group's markup.
35
+ * @example
36
+ * <CtaGroup>
37
+ * <Button size="lg" color="brand">{t("hero.cta")}</Button>
38
+ * <LinkButton href={docs} size="lg" variant="outline">{t("hero.docs")}</LinkButton>
39
+ * </CtaGroup>
40
+ * @example
41
+ * <CtaGroup>
42
+ * <LinkButton href={signin} size="sm">{t("nav.signin")}</LinkButton>
43
+ * </CtaGroup>
44
+ */
45
+ export declare function CtaGroup(handle: Handle<CtaGroup.Props>): () => import("remix/component").RemixElement;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "remix/component/jsx-runtime";
2
+ import { flexWrap, gap, inlineFlex, items } from "@sdxc/u/layout";
3
+ /**
4
+ * Lays action children in a wrapping inline-flex row with a compact gap so a
5
+ * primary and secondary CTA read as one cluster. Radius and size stay on the
6
+ * buttons; override `--ui-marketing-cta-radius` per brand for pill vs soft-rect
7
+ * corners when composing marketing CTAs.
8
+ *
9
+ * @param handle Runtime handle carrying the host `<div>`'s props.
10
+ * @returns The render function producing the group's markup.
11
+ * @example
12
+ * <CtaGroup>
13
+ * <Button size="lg" color="brand">{t("hero.cta")}</Button>
14
+ * <LinkButton href={docs} size="lg" variant="outline">{t("hero.docs")}</LinkButton>
15
+ * </CtaGroup>
16
+ * @example
17
+ * <CtaGroup>
18
+ * <LinkButton href={signin} size="sm">{t("nav.signin")}</LinkButton>
19
+ * </CtaGroup>
20
+ */
21
+ export function CtaGroup(handle) {
22
+ return () => {
23
+ let { mix, ...rest } = handle.props;
24
+ return (_jsx("div", { ...rest, "data-slot": "cta-group", mix: [inlineFlex(), items("center"), flexWrap(), gap(3), mix] }));
25
+ };
26
+ }
@@ -1,8 +1,10 @@
1
1
  /**
2
- * A placeholder for a section that currently has nothing to show — a
2
+ * A placeholder for a product section that currently has nothing to show — a
3
3
  * dashed-bordered panel that composes an icon, a title, a description, and
4
- * an action into one empty-state layout. The compound parts let a consumer
5
- * include only the pieces a given empty state needs.
4
+ * an action into one empty-state layout. Marketing claim cells belong on
5
+ * {@link Feature} instead; {@link Empty} stays for in-app zero-data states.
6
+ * The compound parts let a consumer include only the pieces a given empty
7
+ * state needs.
6
8
  *
7
9
  * @author [Sergio Xalambrí](https://sergiodxa.com)
8
10
  * @copyright Sergio Xalambrí 2026
@@ -0,0 +1,102 @@
1
+ /**
2
+ * One marketing claim cell — icon, title, description, optional link chrome —
3
+ * and an optional {@link Feature.Grid} that lays cells as a hairline-ruled
4
+ * track via container queries. Default chrome stays light; pass
5
+ * `variant="panel"` only when a filled panel is the right container for the
6
+ * interaction.
7
+ *
8
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
9
+ * @copyright Sergio Xalambrí 2026
10
+ */
11
+ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
12
+ /**
13
+ * Prop types for {@link Feature} and its compound parts.
14
+ */
15
+ export declare namespace Feature {
16
+ /**
17
+ * Cell chrome: a light claim with no fill, or a panel when the cell itself
18
+ * is the interaction surface.
19
+ */
20
+ type Variant = "plain" | "panel";
21
+ /**
22
+ * How many cells a wide {@link Feature.Grid} puts on one row.
23
+ */
24
+ type Columns = 2 | 3;
25
+ /**
26
+ * Props accepted by {@link Feature}.
27
+ */
28
+ interface Props extends TagProps<"div"> {
29
+ /** Cell chrome. Defaults to {@link DEFAULT_VARIANT}. */
30
+ variant?: Variant;
31
+ /**
32
+ * Optional destination for the claim. When set with a trailing action
33
+ * child, the cell can surface link chrome; the href itself is left for
34
+ * the consumer's {@link LinkButton} or anchor.
35
+ */
36
+ href?: string;
37
+ /**
38
+ * Compound parts: {@link Feature.Icon}, {@link Feature.Title},
39
+ * {@link Feature.Description}, {@link Feature.Action}, or other content.
40
+ */
41
+ children: RemixNode;
42
+ }
43
+ /**
44
+ * Props accepted by {@link Feature.Icon}.
45
+ */
46
+ interface IconProps extends TagProps<"span"> {
47
+ /** Glyph rendered inside the tinted icon well. */
48
+ children: RemixNode;
49
+ }
50
+ /**
51
+ * Props accepted by {@link Feature.Title}. The rendered tag follows the
52
+ * nearest ambient heading level.
53
+ */
54
+ interface TitleProps extends TagProps<"h1"> {
55
+ /** Title copy for the claim. */
56
+ children: RemixNode;
57
+ }
58
+ /**
59
+ * Props accepted by {@link Feature.Description}.
60
+ */
61
+ interface DescriptionProps extends TagProps<"div"> {
62
+ /** Supporting copy for the claim. */
63
+ children: RemixNode;
64
+ }
65
+ /**
66
+ * Props accepted by {@link Feature.Action}.
67
+ */
68
+ interface ActionProps extends TagProps<"div"> {
69
+ /** Trailing link or button chrome for the claim. */
70
+ children: RemixNode;
71
+ }
72
+ /**
73
+ * Props accepted by {@link Feature.Grid}.
74
+ */
75
+ interface GridProps extends TagProps<"div"> {
76
+ /** Columns above the stack breakpoint. Defaults to {@link DEFAULT_COLUMNS}. */
77
+ columns?: Columns;
78
+ /** {@link Feature} cells to lay out. */
79
+ children: RemixNode;
80
+ }
81
+ }
82
+ /**
83
+ * Renders one claim cell. Compose {@link Feature.Icon}, {@link Feature.Title},
84
+ * {@link Feature.Description}, and {@link Feature.Action} inside it.
85
+ *
86
+ * @param handle Runtime handle carrying the host `<div>`'s props.
87
+ * @returns The render function producing the cell's markup.
88
+ * @example
89
+ * <Feature>
90
+ * <Feature.Icon><ZapIcon size={18} aria-hidden="true" /></Feature.Icon>
91
+ * <Feature.Title>{t("feature.title")}</Feature.Title>
92
+ * <Feature.Description>{t("feature.body")}</Feature.Description>
93
+ * </Feature>
94
+ */
95
+ export declare function Feature(handle: Handle<Feature.Props>): () => import("remix/component").RemixElement;
96
+ export declare namespace Feature {
97
+ var Icon: (handle: Handle<Feature.IconProps>) => () => import("remix/component").RemixElement;
98
+ var Title: (handle: Handle<Feature.TitleProps>) => () => import("remix/component").RemixElement;
99
+ var Description: (handle: Handle<Feature.DescriptionProps>) => () => import("remix/component").RemixElement;
100
+ var Action: (handle: Handle<Feature.ActionProps>) => () => import("remix/component").RemixElement;
101
+ var Grid: (handle: Handle<Feature.GridProps>) => () => import("remix/component").RemixElement;
102
+ }
@@ -0,0 +1,151 @@
1
+ import { jsx as _jsx } from "remix/component/jsx-runtime";
2
+ import { bg, border, fg } from "@sdxc/u/color";
3
+ import { rounded } from "@sdxc/u/effects";
4
+ import { raw } from "@sdxc/u/general";
5
+ import { center, container, gap, grid, gridTemplate, hstack, inlineFlex, repeat, vstack, } from "@sdxc/u/layout";
6
+ import { overflow } from "@sdxc/u/overflow";
7
+ import { at } from "@sdxc/u/responsive";
8
+ import { bs, is, m, mbs, p } from "@sdxc/u/size";
9
+ import { when } from "@sdxc/u/state";
10
+ import { leading, pretty, text, tracking, weight } from "@sdxc/u/typography";
11
+ import { resolveHeadingLevel, TAG_BY_LEVEL } from "./heading-scope.js";
12
+ /** Cell chrome {@link Feature} applies when `variant` is omitted. */
13
+ const DEFAULT_VARIANT = "plain";
14
+ /** How many cells a wide {@link Feature.Grid} puts on one row. */
15
+ const DEFAULT_COLUMNS = 2;
16
+ /**
17
+ * Renders one claim cell. Compose {@link Feature.Icon}, {@link Feature.Title},
18
+ * {@link Feature.Description}, and {@link Feature.Action} inside it.
19
+ *
20
+ * @param handle Runtime handle carrying the host `<div>`'s props.
21
+ * @returns The render function producing the cell's markup.
22
+ * @example
23
+ * <Feature>
24
+ * <Feature.Icon><ZapIcon size={18} aria-hidden="true" /></Feature.Icon>
25
+ * <Feature.Title>{t("feature.title")}</Feature.Title>
26
+ * <Feature.Description>{t("feature.body")}</Feature.Description>
27
+ * </Feature>
28
+ */
29
+ export function Feature(handle) {
30
+ return () => {
31
+ let { href, mix, variant, ...rest } = handle.props;
32
+ let resolvedVariant = variant ?? DEFAULT_VARIANT;
33
+ return (_jsx("div", { ...rest, "data-variant": resolvedVariant, "data-href": href || undefined, "data-slot": "feature", mix: [
34
+ vstack({ gap: 4, align: "stretch" }),
35
+ bg(),
36
+ p(8, 6),
37
+ at("md", p(10, 10)),
38
+ when('&[data-variant="panel"]', [
39
+ bg("neutral.tint"),
40
+ border({ color: "neutral", width: 1, style: "solid" }),
41
+ rounded("xl"),
42
+ ]),
43
+ mix,
44
+ ] }));
45
+ };
46
+ }
47
+ /**
48
+ * Tinted rounded well that holds the claim's glyph.
49
+ *
50
+ * @param handle Runtime handle carrying the host `<span>`'s props.
51
+ * @returns The render function producing the icon well.
52
+ */
53
+ Feature.Icon = function FeatureIcon(handle) {
54
+ return () => {
55
+ let { mix, ...rest } = handle.props;
56
+ return (_jsx("span", { ...rest, "data-slot": "feature-icon", mix: [
57
+ inlineFlex(),
58
+ center(),
59
+ is(10),
60
+ bs(10),
61
+ rounded("lg"),
62
+ bg("brand.tint"),
63
+ fg("brand"),
64
+ border({ color: "brand", width: 1, style: "solid" }),
65
+ mix,
66
+ ] }));
67
+ };
68
+ };
69
+ /**
70
+ * Claim title at the ambient heading depth, sized for a feature cell.
71
+ *
72
+ * @param handle Runtime handle carrying the host heading's props.
73
+ * @returns The render function producing the title.
74
+ */
75
+ Feature.Title = function FeatureTitle(handle) {
76
+ return () => {
77
+ let { mix, ...rest } = handle.props;
78
+ let resolved = resolveHeadingLevel(handle);
79
+ let Tag = TAG_BY_LEVEL[resolved];
80
+ return (_jsx(Tag, { ...rest, "data-slot": "feature-title", "data-heading-level": resolved, mix: [m(0), text("xl"), weight("medium"), tracking("tight"), fg("neutral.emphasis"), mix] }));
81
+ };
82
+ };
83
+ /**
84
+ * Supporting copy under the claim title.
85
+ *
86
+ * @param handle Runtime handle carrying the host `<div>`'s props.
87
+ * @returns The render function producing the description.
88
+ */
89
+ Feature.Description = function FeatureDescription(handle) {
90
+ return () => {
91
+ let { mix, ...rest } = handle.props;
92
+ return (_jsx("div", { ...rest, "data-slot": "feature-description", mix: [vstack({ gap: 2 }), text("base"), leading("relaxed"), pretty(), fg("neutral"), mix] }));
93
+ };
94
+ };
95
+ /**
96
+ * Trailing action slot for a link or button under the claim body.
97
+ *
98
+ * @param handle Runtime handle carrying the host `<div>`'s props.
99
+ * @returns The render function producing the action slot.
100
+ */
101
+ Feature.Action = function FeatureAction(handle) {
102
+ return () => {
103
+ let { mix, ...rest } = handle.props;
104
+ return _jsx("div", { ...rest, "data-slot": "feature-action", mix: [mbs(2), hstack({ gap: 2 }), mix] });
105
+ };
106
+ };
107
+ /**
108
+ * Hairline-ruled grid of {@link Feature} cells. Collapses to one column below
109
+ * `md` on its own named container; above it, `columns` caps the row width and
110
+ * a lone trailing cell spans the remaining tracks.
111
+ *
112
+ * @param handle Runtime handle carrying the host `<div>`'s props.
113
+ * @returns The render function producing the grid.
114
+ * @example
115
+ * <Feature.Grid columns={3}>
116
+ * <Feature>...</Feature>
117
+ * <Feature>...</Feature>
118
+ * <Feature>...</Feature>
119
+ * </Feature.Grid>
120
+ */
121
+ Feature.Grid = function FeatureGrid(handle) {
122
+ return () => {
123
+ let { columns, mix, ...rest } = handle.props;
124
+ let resolvedColumns = columns ?? DEFAULT_COLUMNS;
125
+ return (_jsx("div", { ...rest, "data-columns": String(resolvedColumns), "data-slot": "feature-grid", mix: [
126
+ container("ui-marketing-feature-grid"),
127
+ grid(),
128
+ gap("1px"),
129
+ rounded("xl"),
130
+ overflow("hidden"),
131
+ border({ color: "neutral", width: 1, style: "solid" }),
132
+ raw({
133
+ backgroundColor: "var(--ui-neutral-border)",
134
+ textAlign: "start",
135
+ }),
136
+ gridTemplate({ columns: "minmax(0, 1fr)" }),
137
+ at("md", "ui-marketing-feature-grid", [
138
+ gridTemplate({
139
+ columns: repeat(resolvedColumns, "minmax(0, 1fr)"),
140
+ }),
141
+ resolvedColumns === 2
142
+ ? when("& > :last-child:nth-child(odd)", raw({ gridColumn: "1 / -1" }))
143
+ : [
144
+ when("& > :last-child:nth-child(3n + 1)", raw({ gridColumn: "1 / -1" })),
145
+ when("& > :last-child:nth-child(3n + 2)", raw({ gridColumn: "span 2" })),
146
+ ],
147
+ ]),
148
+ mix,
149
+ ] }));
150
+ };
151
+ };
@@ -6,7 +6,9 @@
6
6
  * it, and a heading with no scope wrapping it at all renders as `<h1>`.
7
7
  * Choosing a level changes only the document outline the element contributes to
8
8
  * assistive technology; its rendered size stays fixed, so nesting sections
9
- * correctly never requires a visual trade-off.
9
+ * correctly never requires a visual trade-off. Pass `size="display"` or
10
+ * `size="chapter"` for marketing headlines that read the `--ui-marketing-*`
11
+ * display tokens (light weight, tight tracking, near-1.0 leading).
10
12
  *
11
13
  * @author [Sergio Xalambrí](https://sergiodxa.com)
12
14
  * @copyright Sergio Xalambrí 2026
@@ -22,6 +24,11 @@ export declare namespace Heading {
22
24
  * matching native heading element.
23
25
  */
24
26
  type Level = HeadingLevel;
27
+ /**
28
+ * Visual size recipe: the catalog default, a page H1 display scale, or a
29
+ * section chapter (~40–48px) from the marketing tokens.
30
+ */
31
+ type Size = "default" | "display" | "chapter";
25
32
  /**
26
33
  * Every native heading-element attribute, unchanged, plus the `mix`
27
34
  * passthrough and a `level` prop choosing which native element the
@@ -33,12 +40,19 @@ export declare namespace Heading {
33
40
  * depth, or `1` where no scope wraps this heading at all.
34
41
  */
35
42
  level?: Level;
43
+ /**
44
+ * Visual size recipe. Defaults to {@link DEFAULT_SIZE}. Marketing
45
+ * pages reach for `"display"` (H1) or `"chapter"` (section H2); app
46
+ * chrome keeps `"default"`.
47
+ */
48
+ size?: Size;
36
49
  }
37
50
  }
38
51
  /**
39
- * Renders its children inside the native heading element matching `level`,
40
- * styled at one fixed emphasis size — semibold, tight-tracked, and colored for
41
- * emphasis, with line height collapsed for compact wrapping.
52
+ * Renders its children inside the native heading element matching `level`.
53
+ * The default size is semibold, tight-tracked emphasis at `lg`; `"display"`
54
+ * and `"chapter"` swap in {@link displayHeading} so large marketing titles
55
+ * stay light-weighted.
42
56
  *
43
57
  * @param handle Runtime handle carrying the host heading element's props.
44
58
  * @returns The render function producing the heading's markup.
@@ -46,5 +60,7 @@ export declare namespace Heading {
46
60
  * <Heading level={1}>Page title</Heading>
47
61
  * @example
48
62
  * <Heading>Section title</Heading>
63
+ * @example
64
+ * <Heading size="chapter">{t("section.title")}</Heading>
49
65
  */
50
66
  export declare function Heading(handle: Handle<Heading.Props>): () => import("remix/component").RemixElement;
@@ -1,11 +1,15 @@
1
1
  import { jsx as _jsx } from "remix/component/jsx-runtime";
2
2
  import { fg } from "@sdxc/u/color";
3
3
  import { balance, fontSize, leading, tracking, weight } from "@sdxc/u/typography";
4
+ import { displayHeading } from "../styles/marketing.js";
4
5
  import { resolveHeadingLevel, TAG_BY_LEVEL } from "./heading-scope.js";
6
+ /** Visual size {@link Heading} applies when `size` is omitted. */
7
+ const DEFAULT_SIZE = "default";
5
8
  /**
6
- * Renders its children inside the native heading element matching `level`,
7
- * styled at one fixed emphasis size — semibold, tight-tracked, and colored for
8
- * emphasis, with line height collapsed for compact wrapping.
9
+ * Renders its children inside the native heading element matching `level`.
10
+ * The default size is semibold, tight-tracked emphasis at `lg`; `"display"`
11
+ * and `"chapter"` swap in {@link displayHeading} so large marketing titles
12
+ * stay light-weighted.
9
13
  *
10
14
  * @param handle Runtime handle carrying the host heading element's props.
11
15
  * @returns The render function producing the heading's markup.
@@ -13,19 +17,29 @@ import { resolveHeadingLevel, TAG_BY_LEVEL } from "./heading-scope.js";
13
17
  * <Heading level={1}>Page title</Heading>
14
18
  * @example
15
19
  * <Heading>Section title</Heading>
20
+ * @example
21
+ * <Heading size="chapter">{t("section.title")}</Heading>
16
22
  */
17
23
  export function Heading(handle) {
18
24
  return () => {
19
- let { level, mix, ...rest } = handle.props;
25
+ let { level, mix, size, ...rest } = handle.props;
20
26
  let resolved = resolveHeadingLevel(handle, level);
27
+ let resolvedSize = size ?? DEFAULT_SIZE;
21
28
  let Tag = TAG_BY_LEVEL[resolved];
22
- return (_jsx(Tag, { ...rest, "data-heading-level": resolved, mix: [
23
- weight("semibold"),
24
- tracking("tight"),
25
- fg("neutral.emphasis"),
26
- fontSize("lg"),
27
- leading("none"),
28
- balance(),
29
+ let isMarketing = resolvedSize === "display" || resolvedSize === "chapter";
30
+ return (_jsx(Tag, { ...rest, "data-heading-level": resolved, "data-size": resolvedSize, mix: [
31
+ resolvedSize === "display" ? displayHeading(1) : [],
32
+ resolvedSize === "chapter" ? displayHeading(2) : [],
33
+ isMarketing
34
+ ? []
35
+ : [
36
+ weight("semibold"),
37
+ tracking("tight"),
38
+ fg("neutral.emphasis"),
39
+ fontSize("lg"),
40
+ leading("none"),
41
+ balance(),
42
+ ],
29
43
  mix,
30
44
  ] }));
31
45
  };