@guardian/interactive-component-library 0.8.1 → 0.8.5-alpha.7

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.
@@ -14,6 +14,7 @@ const PageSection = forwardRef(
14
14
  layout = SectionLayout.default,
15
15
  styles,
16
16
  borderTop = false,
17
+ borderLeftCol = true,
17
18
  backgroundColor = "transparent"
18
19
  }, ref) => {
19
20
  styles = mergeStyles({ ...defaultStyles }, styles);
@@ -25,15 +26,21 @@ const PageSection = forwardRef(
25
26
  setMinHeight(headerElement.offsetHeight);
26
27
  }
27
28
  }, [children]);
29
+ const classes = [styles.section, styles[layout]];
30
+ if (borderTop) {
31
+ classes.push(styles.borderTop);
32
+ }
33
+ if (borderLeftCol) {
34
+ classes.push(styles.borderLeftCol);
35
+ }
28
36
  return /* @__PURE__ */ jsxs(
29
37
  "section",
30
38
  {
31
39
  id,
32
40
  ref,
33
- className: [styles.section, styles[layout]].join(" "),
41
+ className: classes.join(" "),
34
42
  style: { "--background-color": backgroundColor, minHeight },
35
43
  children: [
36
- borderTop && /* @__PURE__ */ jsx("div", { className: styles.borderTop }),
37
44
  children.header && /* @__PURE__ */ jsx(
38
45
  "div",
39
46
  {
@@ -1,16 +1,19 @@
1
- const borderTop = "_borderTop_1v72w_9";
2
- const section = "_section_1v72w_39";
3
- const fullWidth = "_fullWidth_1v72w_39";
4
- const header = "_header_1v72w_150";
5
- const content = "_content_1v72w_187";
1
+ const section = "_section_s7ln2_9";
2
+ const fullWidth = "_fullWidth_s7ln2_58";
3
+ const borderLeftCol = "_borderLeftCol_s7ln2_75";
4
+ const header = "_header_s7ln2_82";
5
+ const content = "_content_s7ln2_87";
6
+ const borderTop = "_borderTop_s7ln2_92";
6
7
  const defaultStyles = {
7
- borderTop,
8
8
  section,
9
9
  fullWidth,
10
+ borderLeftCol,
10
11
  header,
11
- content
12
+ content,
13
+ borderTop
12
14
  };
13
15
  export {
16
+ borderLeftCol,
14
17
  borderTop,
15
18
  content,
16
19
  defaultStyles as default,
package/dist/style.css CHANGED
@@ -2185,206 +2185,91 @@ body.android {
2185
2185
  --top-inset: 58px;
2186
2186
  }
2187
2187
 
2188
- ._borderTop_1v72w_9 {
2189
- border-top: 1px solid var(--border-divider-color);
2190
- transform: translate(-10px);
2191
- width: calc(100% + 20px);
2192
- }
2193
- @media (min-width: 30em) {
2194
- ._borderTop_1v72w_9 {
2195
- transform: translate(-20px);
2196
- width: calc(100% + 40px);
2197
- }
2198
- }
2199
- @media (min-width: 46.25em) {
2200
- ._borderTop_1v72w_9 {
2201
- width: calc(100% + 40px);
2202
- }
2203
- }
2204
- @media (min-width: 71.25em) {
2205
- ._borderTop_1v72w_9 {
2206
- transform: translate(-180px);
2207
- width: calc(100% + 197px);
2208
- background-color: transparent;
2209
- }
2210
- }
2211
- @media (min-width: 81.25em) {
2212
- ._borderTop_1v72w_9 {
2213
- transform: translate(-260px);
2214
- width: calc(100% + 279px);
2215
- }
2216
- }
2217
-
2218
- ._section_1v72w_39._fullWidth_1v72w_39 ._borderTop_1v72w_9 {
2219
- transform: none;
2220
- width: calc(100% - 1px);
2221
- }
2222
-
2223
- ._section_1v72w_39 {
2224
- position: relative;
2225
- z-index: 0;
2226
- padding-bottom: var(--space-8);
2227
- }
2228
-
2229
- ._section_1v72w_39._fullWidth_1v72w_39 {
2230
- transform: translate(-10px);
2231
- width: calc(100% + 20px);
2232
- margin: 0;
2233
- padding: 0;
2234
- }
2235
- @media (min-width: 30em) {
2236
- ._section_1v72w_39._fullWidth_1v72w_39 {
2237
- transform: translate(-20px);
2238
- width: calc(100% + 40px);
2239
- }
2240
- }
2241
- @media (min-width: 46.25em) {
2242
- ._section_1v72w_39._fullWidth_1v72w_39 {
2243
- transform: translate(-20px);
2244
- width: calc(100% + 40px);
2245
- }
2246
- }
2247
- @media (min-width: 71.25em) {
2248
- ._section_1v72w_39._fullWidth_1v72w_39 {
2249
- transform: translate(-180px);
2250
- width: calc(100% + 197px);
2251
- }
2252
- }
2253
- @media (min-width: 81.25em) {
2254
- ._section_1v72w_39._fullWidth_1v72w_39 {
2255
- transform: translate(-260px);
2256
- width: calc(100% + 280px);
2257
- }
2258
- }
2259
-
2260
- ._section_1v72w_39::before {
2261
- display: block;
2262
- content: "";
2263
- position: absolute;
2264
- top: 0;
2265
- left: 0;
2266
- transform: translate(-10px);
2267
- width: calc(100% + 20px);
2268
- height: 100%;
2269
- z-index: -1;
2188
+ ._section_s7ln2_9 {
2270
2189
  background-color: var(--background-color);
2190
+ display: grid;
2191
+ grid-column-gap: 10px;
2192
+ grid-row-gap: 10px;
2193
+ grid-template-areas: "header" "content";
2194
+ --padding: 10px;
2195
+ --bleed: 10px;
2196
+ width: calc(100% + var(--bleed) * 2);
2197
+ padding-left: var(--padding);
2198
+ padding-right: var(--padding);
2199
+ margin-left: calc(var(--bleed) * -1);
2200
+ margin-right: calc(var(--bleed) * -1);
2271
2201
  }
2272
- @media (min-width: 30em) {
2273
- ._section_1v72w_39::before {
2274
- transform: translate(-20px);
2275
- width: calc(100% + 40px);
2276
- }
2277
- }
2278
- @media (min-width: 46.25em) {
2279
- ._section_1v72w_39::before {
2280
- width: calc(100% + 40px);
2202
+ @media (min-width: 480px) {
2203
+ ._section_s7ln2_9 {
2204
+ --padding: 20px;
2205
+ --bleed: 20px;
2281
2206
  }
2282
2207
  }
2283
- @media (min-width: 71.25em) {
2284
- ._section_1v72w_39::before {
2285
- transform: translateX(-9px);
2286
- width: calc(100% + 26px);
2208
+ @media (min-width: 740px) and (max-width: 1140px) {
2209
+ ._section_s7ln2_9 {
2210
+ --bleed: 0px;
2287
2211
  }
2288
2212
  }
2289
- @media (min-width: 81.25em) {
2290
- ._section_1v72w_39::before {
2291
- width: calc(100% + 27px);
2292
- }
2293
- }
2294
-
2295
- ._section_1v72w_39._fullWidth_1v72w_39::before {
2296
- transform: none;
2297
- width: calc(100% - 3px);
2298
- height: 100%;
2299
- left: 1px;
2300
- background-color: var(--background-color);
2301
- transform: translate(-10px);
2302
- width: calc(100% + 20px);
2303
- }
2304
- @media (min-width: 30em) {
2305
- ._section_1v72w_39._fullWidth_1v72w_39::before {
2306
- transform: translate(-20px);
2307
- width: calc(100% + 40px);
2213
+ @media (min-width: 980px) {
2214
+ ._section_s7ln2_9 {
2215
+ width: calc(100% + var(--bleed) * 2 - 2px);
2216
+ grid-template-columns: 620px;
2308
2217
  }
2309
2218
  }
2310
- @media (min-width: 46.25em) {
2311
- ._section_1v72w_39._fullWidth_1v72w_39::before {
2312
- width: 100%;
2313
- transform: translateX(-1px);
2219
+ @media (min-width: 1140px) and (max-width: 1300px) {
2220
+ ._section_s7ln2_9 {
2221
+ margin-left: calc(var(--bleed) * -1 - 1px);
2314
2222
  }
2315
2223
  }
2316
- @media (min-width: 71.25em) {
2317
- ._section_1v72w_39._fullWidth_1v72w_39::before {
2318
- transform: translateX(-1px);
2319
- width: 100%;
2224
+ @media (min-width: 1140px) {
2225
+ ._section_s7ln2_9 {
2226
+ grid-template-columns: 140px 1px 620px 1fr;
2227
+ grid-template-areas: "header border content .";
2320
2228
  }
2321
2229
  }
2322
- @media (min-width: 81.25em) {
2323
- ._section_1v72w_39._fullWidth_1v72w_39::before {
2324
- transform: none;
2325
- width: calc(100% - 3px);
2230
+ @media (min-width: 1300px) {
2231
+ ._section_s7ln2_9 {
2232
+ grid-template-columns: 219px 1px 620px;
2326
2233
  }
2327
2234
  }
2328
2235
 
2329
- ._header_1v72w_150 {
2330
- color: var(--primary-text-color);
2331
- padding-top: var(--space-2);
2332
- margin-bottom: var(--space-5);
2333
- }
2334
-
2335
- @media (min-width: 71.25em) {
2336
- body:not(.ios, .android) ._header_1v72w_150 {
2337
- position: absolute;
2338
- max-width: 160px;
2339
- transform: translateX(-170px);
2340
- margin-bottom: 0;
2236
+ @media (min-width: 980px) {
2237
+ ._section_s7ln2_9._fullWidth_s7ln2_58 {
2238
+ grid-template-columns: 1fr;
2341
2239
  }
2342
2240
  }
2343
- @media (min-width: 81.25em) {
2344
- body:not(.ios, .android) ._header_1v72w_150 {
2345
- max-width: 220px;
2346
- transform: translateX(-250px);
2241
+ @media (min-width: 1140px) {
2242
+ ._section_s7ln2_9._fullWidth_s7ln2_58 {
2243
+ grid-template-columns: 140px 1px 1fr;
2244
+ grid-template-areas: "header border content";
2347
2245
  }
2348
2246
  }
2349
-
2350
- body ._header_1v72w_150._fullWidth_1v72w_39 {
2351
- position: absolute;
2352
- top: 0;
2353
- left: 0;
2354
- z-index: 2;
2355
- transform: none;
2356
- padding-top: 0;
2357
- margin-bottom: var(--space-2);
2358
- max-width: 100%;
2359
- }
2360
- @media (min-width: 71.25em) {
2361
- body ._header_1v72w_150._fullWidth_1v72w_39 {
2362
- margin-bottom: 0;
2247
+ @media (min-width: 1300px) {
2248
+ ._section_s7ln2_9._fullWidth_s7ln2_58 {
2249
+ grid-template-columns: 219px 1px 1fr;
2363
2250
  }
2364
2251
  }
2365
2252
 
2366
- ._content_1v72w_187 {
2367
- position: relative;
2368
- padding-top: 0;
2369
- z-index: 0;
2370
- color: var(--primary-text-color);
2371
- }
2372
- @media (min-width: 71.25em) {
2373
- ._content_1v72w_187 {
2374
- padding-top: var(--space-2);
2253
+ @media (min-width: 1140px) {
2254
+ ._section_s7ln2_9._borderLeftCol_s7ln2_75:before {
2255
+ content: "";
2256
+ grid-area: border;
2257
+ border-left: 1px solid var(--border-divider-color);
2375
2258
  }
2376
2259
  }
2377
2260
 
2378
- :not(._header_1v72w_150) + ._content_1v72w_187 {
2379
- padding-top: var(--space-2);
2261
+ ._header_s7ln2_82 {
2262
+ padding-top: 10px;
2263
+ grid-area: header;
2380
2264
  }
2381
2265
 
2382
- ._content_1v72w_187._fullWidth_1v72w_39 {
2383
- padding-top: 0;
2266
+ ._content_s7ln2_87 {
2267
+ padding-top: 10px;
2268
+ grid-area: content;
2384
2269
  }
2385
2270
 
2386
- ._content_1v72w_187._fullWidth_1v72w_39::before {
2387
- display: none;
2271
+ ._borderTop_s7ln2_92 {
2272
+ border-top: 1px solid var(--border-divider-color);
2388
2273
  }._text_1ci1k_1 {
2389
2274
  font-family: var(--text-sans);
2390
2275
  fill: var(--primary-text-color);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guardian/interactive-component-library",
3
3
  "private": false,
4
- "version": "0.8.1",
4
+ "version": "0.8.5-alpha.7",
5
5
  "packageManager": "pnpm@8.4.0",
6
6
  "repository": {
7
7
  "type": "git",