@sdxc/ui 2026.10.27 → 2026.10.28

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/README.md CHANGED
@@ -358,6 +358,14 @@ Recipes for a `mix` array: `floatingSurface()`, `surfaceInset()`, `hitArea()`, `
358
358
  `rtlAwareGradientDirection(propertyName)`, `chartPalette(property, combinator?)` (one of
359
359
  `CHART_COLOR_SLOT_COUNT` chart colors from `data-color`) and `legendToggle()`.
360
360
 
361
+ Marketing / landing recipes (same entry): `marketingContainer()`,
362
+ `marketingSectionSpace("hero" | "normal" | "compact")`,
363
+ `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.
368
+
361
369
  ### Utilities
362
370
 
363
371
  - **Color** — `parseColor(input): RGBAColor | null`, `formatHex`, `formatRgb`, `formatHsl`,
@@ -14,6 +14,7 @@ export * from "./graphic-host.js";
14
14
  export * from "./hit-area.js";
15
15
  export * from "./interactive-transition.js";
16
16
  export * from "./legend-toggle.js";
17
+ export * from "./marketing.js";
17
18
  export * from "./output-caption-text.js";
18
19
  export * from "./panel-chrome.js";
19
20
  export * from "./range-thumb-appearance.js";
@@ -14,6 +14,7 @@ export * from "./graphic-host.js";
14
14
  export * from "./hit-area.js";
15
15
  export * from "./interactive-transition.js";
16
16
  export * from "./legend-toggle.js";
17
+ export * from "./marketing.js";
17
18
  export * from "./output-caption-text.js";
18
19
  export * from "./panel-chrome.js";
19
20
  export * from "./range-thumb-appearance.js";
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Style-mixin factories for marketing / landing bands: content measure and
3
+ * gutters, section spacing, band tones, display type, lead copy, hairlines,
4
+ * and logo-cloud marks. Pair a band host with `viewReveal()` from the
5
+ * animations entry so sections enter on scroll; reduced-motion is already
6
+ * collapsed there.
7
+ *
8
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
9
+ * @copyright Sergio Xalambrí 2026
10
+ */
11
+ import type { ElementProps, MixinDescriptor } from "remix/component";
12
+ import type { CSSStyles } from "../utils/css-styles.js";
13
+ /**
14
+ * How much block padding a marketing band leaves around its content.
15
+ * `"hero"` is the first viewport, `"normal"` the repeating mid-page rhythm,
16
+ * `"compact"` a tighter strip such as a proof row.
17
+ */
18
+ export type MarketingSectionSpacing = "hero" | "normal" | "compact";
19
+ /**
20
+ * What sits behind a marketing band: nothing, a quiet tint, a faded grid, or
21
+ * an inverted solid for a closing call-to-action.
22
+ */
23
+ export type MarketingBandTone = "plain" | "tinted" | "grid" | "inverse";
24
+ /**
25
+ * Outline depth {@link displayHeading} sizes for: `1` is the page H1,
26
+ * `2` a section chapter (~40–48px), `3` a quieter in-band title.
27
+ */
28
+ export type MarketingDisplayLevel = 1 | 2 | 3;
29
+ /**
30
+ * Centers a marketing content column at `--ui-marketing-measure` and pads
31
+ * its inline edges from `--ui-marketing-gutter`, stepping 1rem → 1.5rem → 2rem
32
+ * as the nearest container grows past `md` and `lg`.
33
+ *
34
+ * @returns A `css()` mixin ready for a content wrapper's `mix` prop.
35
+ * @example
36
+ * <div mix={[marketingContainer()]}>{children}</div>;
37
+ */
38
+ export declare function marketingContainer<Node extends Element = Element>(): MixinDescriptor<Node, [
39
+ styles: CSSStyles
40
+ ], ElementProps>;
41
+ /**
42
+ * Applies the band's block padding from the marketing section-space tokens.
43
+ *
44
+ * @param spacing Which of the three steps to apply. Defaults to `"normal"`.
45
+ * @returns A `css()` mixin ready for a band host's `mix` prop.
46
+ * @example
47
+ * <section mix={[marketingSectionSpace("hero")]}>{children}</section>;
48
+ */
49
+ export declare function marketingSectionSpace<Node extends Element = Element>(spacing?: MarketingSectionSpacing): MixinDescriptor<Node, [styles: CSSStyles], ElementProps>;
50
+ /**
51
+ * Paints a marketing band's background: a quiet neutral tint, a faded grid,
52
+ * an inverted solid, or nothing for `"plain"`.
53
+ *
54
+ * @param tone Which fill to apply. Defaults to `"plain"`.
55
+ * @returns A `css()` mixin ready for a band host's `mix` prop.
56
+ * @example
57
+ * <section mix={[marketingBandTone("tinted"), marketingSectionSpace()]}>{children}</section>;
58
+ * @example
59
+ * // Pair with viewReveal so the band enters as it scrolls into view:
60
+ * // mix={[marketingBandTone("grid"), viewReveal()]}
61
+ */
62
+ export declare function marketingBandTone<Node extends Element = Element>(tone?: MarketingBandTone): MixinDescriptor<Node, [styles: CSSStyles], ElementProps>;
63
+ /**
64
+ * Sets display typography for a marketing headline: the optional display
65
+ * family, light weight, tight tracking, and near-1.0 leading from the
66
+ * marketing tokens, with size stepping by outline depth.
67
+ *
68
+ * @param level Outline depth. Defaults to `1` (page H1).
69
+ * @returns A `css()` mixin ready for a heading's `mix` prop.
70
+ * @example
71
+ * <h1 mix={[displayHeading()]}>{title}</h1>;
72
+ * @example
73
+ * <h2 mix={[displayHeading(2)]}>{chapter}</h2>;
74
+ */
75
+ export declare function displayHeading<Node extends Element = Element>(level?: MarketingDisplayLevel): MixinDescriptor<Node, [styles: CSSStyles], ElementProps>;
76
+ /**
77
+ * Muted supporting copy under a marketing headline: lead size and measure,
78
+ * pretty wrapping, and balanced lines.
79
+ *
80
+ * @returns A `css()` mixin ready for a lead paragraph's `mix` prop.
81
+ * @example
82
+ * <p mix={[marketingLead()]}>{description}</p>;
83
+ */
84
+ export declare function marketingLead<Node extends Element = Element>(): MixinDescriptor<Node, [
85
+ styles: CSSStyles
86
+ ], ElementProps>;
87
+ /**
88
+ * A low-contrast 1px rule along the block-start edge — the hairline a sticky
89
+ * header, footer, or band uses to separate itself from what sits above.
90
+ *
91
+ * @returns A `css()` mixin ready for a host element's `mix` prop.
92
+ * @example
93
+ * <header mix={[marketingHairline()]}>{nav}</header>;
94
+ */
95
+ export declare function marketingHairline<Node extends Element = Element>(): MixinDescriptor<Node, [
96
+ styles: CSSStyles
97
+ ], ElementProps>;
98
+ /**
99
+ * Forces a logo-cloud mark to `--ui-marketing-logo-height` with muted
100
+ * currentColor treatment so adopter marks read as one quiet row.
101
+ *
102
+ * @returns A `css()` mixin ready for an `img` or inline SVG's `mix` prop.
103
+ * @example
104
+ * <img src={logo} alt="" mix={[logoCloudMark()]} />;
105
+ */
106
+ export declare function logoCloudMark<Node extends Element = Element>(): MixinDescriptor<Node, [
107
+ styles: CSSStyles
108
+ ], ElementProps>;
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Style-mixin factories for marketing / landing bands: content measure and
3
+ * gutters, section spacing, band tones, display type, lead copy, hairlines,
4
+ * and logo-cloud marks. Pair a band host with `viewReveal()` from the
5
+ * animations entry so sections enter on scroll; reduced-motion is already
6
+ * collapsed there.
7
+ *
8
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
9
+ * @copyright Sergio Xalambrí 2026
10
+ */
11
+ import { bg, borderEdge, fg } from "@sdxc/u/color";
12
+ import { opacity } from "@sdxc/u/effects";
13
+ import { combine, raw, var as varUtility } from "@sdxc/u/general";
14
+ import { relative } from "@sdxc/u/layout";
15
+ import { at, dark } from "@sdxc/u/responsive";
16
+ import { bs, is, maxIs, mi, pi } from "@sdxc/u/size";
17
+ import { before } from "@sdxc/u/state";
18
+ import { balance, font, pretty } from "@sdxc/u/typography";
19
+ /** Max content width a marketing column settles at. */
20
+ const MEASURE = varUtility("ui-marketing-measure", "72rem");
21
+ /** Inline padding at the narrowest container step. */
22
+ const GUTTER = varUtility("ui-marketing-gutter", "1rem");
23
+ /** Block padding for a normal marketing band. */
24
+ const SECTION_SPACE = varUtility("ui-marketing-section-space", "6rem");
25
+ /** Block padding for a compact marketing band. */
26
+ const SECTION_SPACE_COMPACT = varUtility("ui-marketing-section-space-compact", "4rem");
27
+ /** Block padding for a hero marketing band. */
28
+ const SECTION_SPACE_HERO = varUtility("ui-marketing-section-space-hero", "8rem");
29
+ /** Letter-spacing for display headlines. */
30
+ const DISPLAY_TRACKING = varUtility("ui-marketing-display-tracking", "-0.04em");
31
+ /** Font weight for display headlines. */
32
+ const DISPLAY_WEIGHT = varUtility("ui-marketing-display-weight", "500");
33
+ /** Line-height for display headlines. */
34
+ const DISPLAY_LEADING = varUtility("ui-marketing-display-leading", "1");
35
+ /** Max width of supporting lead copy under a headline. */
36
+ const LEAD_MEASURE = varUtility("ui-marketing-lead-measure", "40rem");
37
+ /** Font size of supporting lead copy. */
38
+ const LEAD_SIZE = varUtility("ui-marketing-lead-size", "1.125rem");
39
+ /** Font size of a marketing section H2 (chapter). */
40
+ const CHAPTER_SIZE = varUtility("ui-marketing-chapter-size", "2.75rem");
41
+ /** Forced height of a logo-cloud mark. */
42
+ const LOGO_HEIGHT = varUtility("ui-marketing-logo-height", "1rem");
43
+ /** Default spacing step {@link marketingSectionSpace} applies. */
44
+ const DEFAULT_SECTION_SPACING = "normal";
45
+ /** Default band fill {@link marketingBandTone} applies. */
46
+ const DEFAULT_BAND_TONE = "plain";
47
+ /** Default outline depth {@link displayHeading} draws at. */
48
+ const DEFAULT_DISPLAY_LEVEL = 1;
49
+ /**
50
+ * Centers a marketing content column at `--ui-marketing-measure` and pads
51
+ * its inline edges from `--ui-marketing-gutter`, stepping 1rem → 1.5rem → 2rem
52
+ * as the nearest container grows past `md` and `lg`.
53
+ *
54
+ * @returns A `css()` mixin ready for a content wrapper's `mix` prop.
55
+ * @example
56
+ * <div mix={[marketingContainer()]}>{children}</div>;
57
+ */
58
+ export function marketingContainer() {
59
+ return combine([
60
+ maxIs(MEASURE),
61
+ mi("auto"),
62
+ pi(GUTTER),
63
+ at("md", pi("1.5rem")),
64
+ at("lg", pi("2rem")),
65
+ ]);
66
+ }
67
+ /**
68
+ * Applies the band's block padding from the marketing section-space tokens.
69
+ *
70
+ * @param spacing Which of the three steps to apply. Defaults to `"normal"`.
71
+ * @returns A `css()` mixin ready for a band host's `mix` prop.
72
+ * @example
73
+ * <section mix={[marketingSectionSpace("hero")]}>{children}</section>;
74
+ */
75
+ export function marketingSectionSpace(spacing = DEFAULT_SECTION_SPACING) {
76
+ let padding = SECTION_SPACE;
77
+ if (spacing === "hero")
78
+ padding = SECTION_SPACE_HERO;
79
+ if (spacing === "compact")
80
+ padding = SECTION_SPACE_COMPACT;
81
+ return raw({ paddingBlock: padding });
82
+ }
83
+ /**
84
+ * Paints a marketing band's background: a quiet neutral tint, a faded grid,
85
+ * an inverted solid, or nothing for `"plain"`.
86
+ *
87
+ * @param tone Which fill to apply. Defaults to `"plain"`.
88
+ * @returns A `css()` mixin ready for a band host's `mix` prop.
89
+ * @example
90
+ * <section mix={[marketingBandTone("tinted"), marketingSectionSpace()]}>{children}</section>;
91
+ * @example
92
+ * // Pair with viewReveal so the band enters as it scrolls into view:
93
+ * // mix={[marketingBandTone("grid"), viewReveal()]}
94
+ */
95
+ export function marketingBandTone(tone = DEFAULT_BAND_TONE) {
96
+ switch (tone) {
97
+ case "tinted":
98
+ return combine([
99
+ bg("color.neutral.100"),
100
+ dark(bg("color.neutral.900")),
101
+ raw({
102
+ backgroundImage: "radial-gradient(60% 70% at 85% 0%, color-mix(in oklch, var(--ui-brand-bg-solid) 14%, transparent), transparent 70%)",
103
+ }),
104
+ ]);
105
+ case "grid":
106
+ return combine([
107
+ relative(),
108
+ before(raw({
109
+ content: '""',
110
+ position: "absolute",
111
+ inset: "0",
112
+ zIndex: "-1",
113
+ backgroundImage: "linear-gradient(to right, var(--ui-neutral-border) 1px, transparent 1px), linear-gradient(to bottom, var(--ui-neutral-border) 1px, transparent 1px)",
114
+ backgroundSize: "3rem 3rem",
115
+ opacity: "0.55",
116
+ maskImage: "radial-gradient(70% 80% at 70% 40%, black, transparent 75%)",
117
+ WebkitMaskImage: "radial-gradient(70% 80% at 70% 40%, black, transparent 75%)",
118
+ })),
119
+ ]);
120
+ case "inverse":
121
+ return combine([bg("neutral.solid"), fg("neutral.onSolid")]);
122
+ default:
123
+ return raw({});
124
+ }
125
+ }
126
+ /**
127
+ * Sets display typography for a marketing headline: the optional display
128
+ * family, light weight, tight tracking, and near-1.0 leading from the
129
+ * marketing tokens, with size stepping by outline depth.
130
+ *
131
+ * @param level Outline depth. Defaults to `1` (page H1).
132
+ * @returns A `css()` mixin ready for a heading's `mix` prop.
133
+ * @example
134
+ * <h1 mix={[displayHeading()]}>{title}</h1>;
135
+ * @example
136
+ * <h2 mix={[displayHeading(2)]}>{chapter}</h2>;
137
+ */
138
+ export function displayHeading(level = DEFAULT_DISPLAY_LEVEL) {
139
+ let size = varUtility("ui-text-xl", "1.25rem");
140
+ if (level === 1)
141
+ size = varUtility("ui-text-5xl", "3rem");
142
+ if (level === 2)
143
+ size = CHAPTER_SIZE;
144
+ return combine([
145
+ font("display"),
146
+ fg("neutral.emphasis"),
147
+ balance(),
148
+ raw({
149
+ fontWeight: DISPLAY_WEIGHT,
150
+ letterSpacing: DISPLAY_TRACKING,
151
+ lineHeight: DISPLAY_LEADING,
152
+ fontSize: size,
153
+ margin: "0",
154
+ }),
155
+ level === 1 ? at("lg", raw({ fontSize: varUtility("ui-text-7xl", "4.5rem") })) : [],
156
+ level === 2 ? at("md", raw({ fontSize: varUtility("ui-text-5xl", "3rem") })) : [],
157
+ ]);
158
+ }
159
+ /**
160
+ * Muted supporting copy under a marketing headline: lead size and measure,
161
+ * pretty wrapping, and balanced lines.
162
+ *
163
+ * @returns A `css()` mixin ready for a lead paragraph's `mix` prop.
164
+ * @example
165
+ * <p mix={[marketingLead()]}>{description}</p>;
166
+ */
167
+ export function marketingLead() {
168
+ return combine([
169
+ fg("neutral.muted"),
170
+ pretty(),
171
+ raw({
172
+ fontSize: LEAD_SIZE,
173
+ maxInlineSize: LEAD_MEASURE,
174
+ lineHeight: "1.625",
175
+ margin: "0",
176
+ }),
177
+ ]);
178
+ }
179
+ /**
180
+ * A low-contrast 1px rule along the block-start edge — the hairline a sticky
181
+ * header, footer, or band uses to separate itself from what sits above.
182
+ *
183
+ * @returns A `css()` mixin ready for a host element's `mix` prop.
184
+ * @example
185
+ * <header mix={[marketingHairline()]}>{nav}</header>;
186
+ */
187
+ export function marketingHairline() {
188
+ return borderEdge("block-start", { color: "neutral", width: 1, style: "solid" });
189
+ }
190
+ /**
191
+ * Forces a logo-cloud mark to `--ui-marketing-logo-height` with muted
192
+ * currentColor treatment so adopter marks read as one quiet row.
193
+ *
194
+ * @returns A `css()` mixin ready for an `img` or inline SVG's `mix` prop.
195
+ * @example
196
+ * <img src={logo} alt="" mix={[logoCloudMark()]} />;
197
+ */
198
+ export function logoCloudMark() {
199
+ return combine([
200
+ bs(LOGO_HEIGHT),
201
+ is("auto"),
202
+ opacity(65),
203
+ raw({
204
+ objectFit: "contain",
205
+ color: "currentColor",
206
+ }),
207
+ ]);
208
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdxc/ui",
3
- "version": "2026.10.27",
3
+ "version": "2026.10.28",
4
4
  "description": "Styled, accessible remix/component components rendered as server HTML",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "peerDependencies": {
27
27
  "remix": "3.1.0"
28
28
  },
29
- "gitHead": "33abc1099e147f3eb4af00cf5b25e50b8f1271a1",
29
+ "gitHead": "3925ab3050d9a10d86340267d73168bdc8d24531",
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
package/src/theme.css CHANGED
@@ -28,6 +28,11 @@
28
28
  * tone of whatever sits behind it; high contrast turns it into a solid line.
29
29
  * - `--ui-image-outline`, the inset hairline that keeps an image's edge
30
30
  * visible against a background of the same tone.
31
+ * - `--ui-marketing-*` layout and display tokens (measure, gutter, section
32
+ * space steps, display tracking/weight/leading, lead measure/size, chapter
33
+ * size, logo height, header height, CTA radius) plus `--ui-font-display`
34
+ * for landing bands. Apps override per brand; brand colors stay on the
35
+ * existing `--ui-color-*` / `--ui-*-*` scales.
31
36
  *
32
37
  * Dark Mode:
33
38
  * - Add .dark class to <html> for forced dark mode
@@ -93,6 +98,27 @@
93
98
 
94
99
  /* Images: an inset hairline that holds the edge against a same-tone background */
95
100
  --ui-image-outline: rgb(0 0 0 / 0.1);
101
+
102
+ /*
103
+ * Marketing layout: measure, gutters, band spacing, and display type for
104
+ * landing bands. Apps override per brand; 72rem matches a 1152px content
105
+ * column (override to 76rem where a wider frame is already shipping).
106
+ */
107
+ --ui-marketing-measure: 72rem;
108
+ --ui-marketing-gutter: 1rem;
109
+ --ui-marketing-section-space: 6rem;
110
+ --ui-marketing-section-space-compact: 4rem;
111
+ --ui-marketing-section-space-hero: 8rem;
112
+ --ui-marketing-display-tracking: -0.04em;
113
+ --ui-marketing-display-weight: 500;
114
+ --ui-marketing-display-leading: 1;
115
+ --ui-marketing-lead-measure: 40rem;
116
+ --ui-marketing-lead-size: 1.125rem;
117
+ --ui-marketing-chapter-size: 2.75rem;
118
+ --ui-marketing-logo-height: 1rem;
119
+ --ui-marketing-header-height: 4rem;
120
+ --ui-marketing-cta-radius: 0.5rem;
121
+ --ui-font-display: var(--ui-font-sans);
96
122
  }
97
123
 
98
124
  /* Touch input: grow every hitArea() target to the 44px a fingertip needs */