Skip to content

Commit d06b005

Browse files
authored
DOC-423 (hotfix) responsive replicator table (#914)
1 parent f95fca2 commit d06b005

6 files changed

Lines changed: 120 additions & 21 deletions

File tree

src/components/replicator-coverage/ReplicatorCoverage.tsx

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,23 @@ function StrategyBadge({
8989
);
9090
}
9191

92+
function ResourceType({ value }: { value: string }) {
93+
return (
94+
<>
95+
{value.split('::').map((part, index) => (
96+
<React.Fragment key={`${part}-${index}`}>
97+
{index > 0 && (
98+
<>
99+
::<wbr />
100+
</>
101+
)}
102+
{part}
103+
</React.Fragment>
104+
))}
105+
</>
106+
);
107+
}
108+
92109
function PolicyList({ statements }: { statements: string[] }) {
93110
if (!statements.length) {
94111
return (
@@ -98,7 +115,10 @@ function PolicyList({ statements }: { statements: string[] }) {
98115
);
99116
}
100117
return (
101-
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '6px' }}>
118+
<div
119+
className="replicator-policy-list"
120+
style={{ display: 'flex', flexWrap: 'wrap', gap: '6px' }}
121+
>
102122
{statements.map((statement) => (
103123
<code
104124
key={statement}
@@ -126,6 +146,7 @@ function Identifier({ value }: { value: string | null }) {
126146
}
127147
return (
128148
<code
149+
className="replicator-identifier"
129150
style={{
130151
fontSize: '12px',
131152
padding: '2px 6px',
@@ -194,7 +215,13 @@ function Field({ label, children }: { label: string; children: React.ReactNode }
194215

195216
function ResourceDetails({ resource }: { resource: ResourceCoverage }) {
196217
return (
197-
<div style={{ padding: '16px 20px', background: 'var(--sl-color-gray-7, var(--sl-color-gray-6))' }}>
218+
<div
219+
className="replicator-details"
220+
style={{
221+
padding: '16px 20px',
222+
background: 'var(--sl-color-gray-7, var(--sl-color-gray-6))',
223+
}}
224+
>
198225
{resource.single && (
199226
<DetailSection strategy="single">
200227
<Field label="Identifier">
@@ -220,7 +247,10 @@ function ResourceDetails({ resource }: { resource: ResourceCoverage }) {
220247
{resource.resource_tree && (
221248
<DetailSection strategy="tree">
222249
<Field label="Replicated related resources">
223-
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '6px' }}>
250+
<div
251+
className="replicator-related-resources"
252+
style={{ display: 'flex', flexWrap: 'wrap', gap: '6px' }}
253+
>
224254
{resource.resource_tree.resources.map((r) => (
225255
<code
226256
key={r}
@@ -288,7 +318,10 @@ export default function ReplicatorCoverage() {
288318
setExpanded((prev) => ({ ...prev, [resourceType]: !prev[resourceType] }));
289319

290320
return (
291-
<div className="w-full" style={{ fontFamily: 'var(--font-aeonik-fono)' }}>
321+
<div
322+
className="replicator-coverage w-full"
323+
style={{ fontFamily: 'var(--font-aeonik-fono)' }}
324+
>
292325
<div
293326
style={{
294327
display: 'flex',
@@ -312,6 +345,7 @@ export default function ReplicatorCoverage() {
312345

313346
<div
314347
role="table"
348+
className="replicator-coverage-table"
315349
style={{
316350
border: '1px solid var(--sl-color-gray-5)',
317351
borderRadius: '8px',
@@ -321,7 +355,7 @@ export default function ReplicatorCoverage() {
321355
>
322356
<div
323357
role="row"
324-
className="hidden md:grid"
358+
className="replicator-coverage-header"
325359
style={{
326360
gridTemplateColumns:
327361
'1.75rem minmax(0, 1fr) 9rem minmax(0, 14rem)',
@@ -355,7 +389,7 @@ export default function ReplicatorCoverage() {
355389
type="button"
356390
onClick={() => toggle(resource.resource_type)}
357391
aria-expanded={isOpen}
358-
className="replicator-row w-full grid items-start gap-x-3 gap-y-2 grid-cols-[1.75rem_minmax(0,1fr)] md:grid-cols-[1.75rem_minmax(0,1fr)_9rem_minmax(0,14rem)] md:items-center hover:bg-[var(--sl-color-gray-6)] transition-colors"
392+
className="replicator-row w-full hover:bg-[var(--sl-color-gray-6)] transition-colors"
359393
style={{
360394
background: 'transparent',
361395
border: 'none',
@@ -377,31 +411,25 @@ export default function ReplicatorCoverage() {
377411
}}
378412
/>
379413
<code
414+
className="replicator-resource-type"
380415
style={{
381-
minWidth: 0,
382416
fontSize: '13px',
383417
padding: '2px 6px',
384418
borderRadius: '4px',
385419
background: 'var(--sl-color-gray-6)',
386420
border: '1px solid var(--sl-color-gray-5)',
387-
whiteSpace: 'normal',
388-
overflowWrap: 'anywhere',
389-
wordBreak: 'break-word',
390-
justifySelf: 'start',
391421
}}
392422
>
393-
{resource.resource_type}
423+
<ResourceType value={resource.resource_type} />
394424
</code>
395425
<span
396-
className="col-start-2 md:col-start-auto"
426+
className="replicator-service"
397427
style={{
398428
fontSize: '14px',
399-
overflowWrap: 'anywhere',
400-
minWidth: 0,
401429
}}
402430
>
403431
<span
404-
className="md:hidden"
432+
className="replicator-mobile-label"
405433
style={{
406434
color: 'var(--sl-color-gray-3)',
407435
marginRight: '6px',
@@ -412,7 +440,7 @@ export default function ReplicatorCoverage() {
412440
{resource.service}
413441
</span>
414442
<div
415-
className="col-start-2 md:col-start-auto"
443+
className="replicator-strategies"
416444
style={{ display: 'flex', gap: '6px', flexWrap: 'wrap' }}
417445
>
418446
<StrategyBadge strategy="single" active={!!resource.single} />

src/content/docs/aws/getting-started/ci-cd.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Most CI jobs should start with a clean LocalStack instance. A fresh instance mak
203203
If your pipeline needs state across jobs or workflow stages, use one of the state management options documented outside this getting started page:
204204

205205
- [Cloud Pods](/aws/developer-tools/snapshots/cloud-pods/) to save and restore named LocalStack state snapshots.
206-
- [State export and import](/aws/developer-tools/snapshots/export-import-state/) to move state through artifacts or caches.
206+
- [State export and import](/aws/developer-tools/snapshots/saving-snapshots-locally/) to move state through artifacts or caches.
207207
- [Persistence](/aws/developer-tools/snapshots/persistence/) when the same runner keeps a mounted LocalStack volume.
208208

209209
## Next steps

src/content/docs/snowflake/features/glue-catalog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Snowflake emulator can connect to this Glue Iceberg REST endpoint through a
1212

1313
## Getting started
1414

15-
This guide walks through creating an Iceberg table in S3 Tables through the Glue Iceberg REST endpoint, registering that table with the Snowflake emulator through a Glue catalog integration, and querying it with SQL. It assumes basic knowledge of the AWS CLI, our [`awslocal`](/aws/connecting/aws-cli/#localstack-aws-cli-awslocal) wrapper, and Snowflake.
15+
This guide walks through creating an Iceberg table in S3 Tables through the Glue Iceberg REST endpoint, registering that table with the Snowflake emulator through a Glue catalog integration, and querying it with SQL. It assumes basic knowledge of the AWS CLI, our [`awslocal`](/aws/connecting/infrastructure-as-code/deprecated-wrapper-scripts/#awslocal) wrapper, and Snowflake.
1616

1717
In this guide, you will:
1818

src/content/docs/snowflake/tutorials/aws-lambda-localstack-snowpark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The code in this tutorial is available on [GitHub](https://github.com/localstack
2121

2222
- [`localstack` CLI](/snowflake/getting-started/) with a [`LOCALSTACK_AUTH_TOKEN`](/snowflake/getting-started/auth-token/)
2323
- [LocalStack for Snowflake](/snowflake/getting-started/)
24-
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) & [`awslocal` wrapper](/aws/connecting/aws-cli/#localstack-aws-cli-awslocal)
24+
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) & [`awslocal` wrapper](/aws/connecting/infrastructure-as-code/deprecated-wrapper-scripts/#awslocal)
2525
- Python 3.10 installed locally
2626

2727
## Create the Lambda function

src/content/docs/snowflake/tutorials/s3-tables-iceberg-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ With LocalStack's Snowflake emulator, you can create catalog integrations that c
2020

2121
- [`localstack` CLI](/snowflake/getting-started/) with a [`LOCALSTACK_AUTH_TOKEN`](/snowflake/getting-started/auth-token/)
2222
- [LocalStack for Snowflake](/snowflake/getting-started/)
23-
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) & [`awslocal` wrapper](/aws/connecting/aws-cli/#localstack-aws-cli-awslocal)
23+
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) & [`awslocal` wrapper](/aws/connecting/infrastructure-as-code/deprecated-wrapper-scripts/#awslocal)
2424
- Python 3.10+ with `pyiceberg` and `pyarrow` installed
2525

2626
## Start LocalStack

src/styles/global.css

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,77 @@ h3 {
7474
}
7575
}
7676

77+
/* The coverage component can be narrower than the viewport when Starlight sidebars are visible. */
78+
.replicator-coverage {
79+
container-type: inline-size;
80+
}
81+
82+
.replicator-coverage-header,
83+
.replicator-row {
84+
display: grid;
85+
grid-template-columns: 1.75rem minmax(0, 1fr) 9rem minmax(0, 14rem);
86+
align-items: center;
87+
gap: 12px;
88+
}
89+
90+
.replicator-resource-type {
91+
display: block;
92+
min-width: 0;
93+
max-width: 100%;
94+
padding: 2px 6px;
95+
white-space: normal;
96+
overflow-wrap: normal;
97+
word-break: normal;
98+
}
99+
100+
.replicator-service,
101+
.replicator-strategies {
102+
min-width: 0;
103+
}
104+
105+
.replicator-mobile-label {
106+
display: none;
107+
}
108+
109+
.replicator-policy-list code,
110+
.replicator-related-resources code,
111+
.replicator-identifier {
112+
display: inline-block;
113+
max-width: 100%;
114+
overflow-x: auto;
115+
}
116+
117+
@container (max-width: 46rem) {
118+
.replicator-coverage-header {
119+
display: none;
120+
}
121+
122+
.replicator-row {
123+
grid-template-columns: 1.75rem minmax(0, 1fr);
124+
align-items: start;
125+
}
126+
127+
.replicator-resource-type,
128+
.replicator-service,
129+
.replicator-strategies {
130+
grid-column: 2;
131+
}
132+
133+
.replicator-mobile-label {
134+
display: inline;
135+
}
136+
}
137+
138+
@container (max-width: 24rem) {
139+
.replicator-row {
140+
padding: 12px !important;
141+
}
142+
143+
.replicator-details {
144+
padding: 16px !important;
145+
}
146+
}
147+
77148
/* Product Cards Styles */
78149
.product-card {
79150
color: #ffffff !important;

0 commit comments

Comments
 (0)