Skip to content

Commit 44cd92c

Browse files
author
Jacob Logan
committed
add api link legend
1 parent a439970 commit 44cd92c

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

src/components/ApiDocs/ReferencePage.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Fragment } from 'react';
22

33
import { FunctionReference } from './FunctionReference';
4-
import { Divider, View } from '@aws-amplify/ui-react';
4+
import { Divider, View, Flex } from '@aws-amplify/ui-react';
55
import { API_CATEGORIES, API_SUB_CATEGORIES } from '@/data/api-categories.mjs';
66
import references from '@/directory/apiReferences.json';
77

@@ -18,6 +18,20 @@ export const ReferencePage = ({ category }) => {
1818
<FunctionReference func={child} />
1919
</Fragment>
2020
))}
21+
<Flex className="api-legend-container">
22+
<Flex>
23+
<View as="span" className="api-legend interface" />
24+
Interface
25+
</Flex>
26+
<Flex>
27+
<View as="span" className="api-legend reference" />
28+
Reference
29+
</Flex>
30+
<Flex>
31+
<View as="span" className="api-legend union" />
32+
Union/Intersection
33+
</Flex>
34+
</Flex>
2135
</View>
2236
);
2337
};

src/styles/reference.scss

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
align-items: center;
2222
justify-content: center;
2323
z-index: 99999;
24+
2425
&--open {
2526
display: flex;
2627
}
@@ -55,19 +56,24 @@
5556
grid-template-columns: 1fr;
5657
grid-template-rows: auto;
5758
align-items: baseline;
59+
5860
dt {
5961
color: var(--amplify-colors-font-secondary);
6062
}
63+
6164
dd {
6265
padding-inline-start: var(--amplify-space-small);
6366
}
67+
6468
&__name {
6569
text-align: start;
6670
color: var(--amplify-colors-neutral-90);
6771
font-weight: bold;
6872
align-items: baseline;
6973
}
70-
&__description, &__value {
74+
75+
&__description,
76+
&__value {
7177
color: var(--amplify-colors-neutral-90);
7278
}
7379
}
@@ -90,6 +96,7 @@
9096
.api-modal__content {
9197
grid-template-columns: auto 1fr;
9298
gap: var(--amplify-space-small);
99+
93100
dt {
94101
text-align: end;
95102
}
@@ -113,13 +120,16 @@
113120
padding: 0;
114121
background: none;
115122
text-decoration: underline;
123+
116124
&:hover {
117125
text-decoration: none;
118126
}
127+
119128
&:focus-visible {
120129
outline: 2px solid var(--amplify-colors-border-focus);
121130
outline-offset: 2px;
122131
}
132+
123133
&.kind-2097152 {
124134
color: var(--amplify-colors-red-80);
125135
}
@@ -132,3 +142,26 @@
132142
color: var(--amplify-colors-blue-80);
133143
}
134144
}
145+
146+
.api-legend {
147+
width: 20px;
148+
height: 20px;
149+
border-radius: 20px;
150+
151+
&.interface {
152+
background-color: var(--amplify-colors-green-80);
153+
}
154+
155+
&.reference {
156+
background-color: var(--amplify-colors-red-80);
157+
}
158+
159+
&.union {
160+
background-color: var(--amplify-colors-blue-80);
161+
}
162+
}
163+
164+
.api-legend-container {
165+
margin: var(--amplify-space-medium);
166+
justify-content: space-between;
167+
}

0 commit comments

Comments
 (0)