Skip to content

Commit 4d06066

Browse files
authored
Merge branch 'v2-preview' into fix-platform-persistence-issues
2 parents 60cc746 + 7b99f7c commit 4d06066

File tree

106 files changed

+3695
-1758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3695
-1758
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ amplify/backend/awscloudformation
5555
build/
5656
dist/
5757
node_modules/
58-
client/src/aws-exports.js
5958
client/src/aws-exports.ts
6059
awsconfiguration.json
6160
amplifyconfiguration.json
6261
amplify-gradle-config.json
63-
amplifyxc.config
62+
amplifyxc.config
63+
amplify/team-provider-info.json

amplify/team-provider-info.json

-38
This file was deleted.

client/src/amplify-ui/styles/variables.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const variablesStyle = css`
3232
--github-gray: #333;
3333
--youtube-red: #c4302b;
3434
35+
--primary-color: var(--color-orange-hv);
3536
--font-color: var(--color-ink-hv);
3637
--font-color-secondary: var(--color-grey-hv);
3738
--secondary-color: var(--color-ink-hv);

client/src/amplify-ui/toc/toc-content/toc-content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class AmplifyTOCContent {
1111
*/
1212
@Prop() readonly setContent?: SetContent;
1313

14-
componentDidLoad() {
14+
componentDidRender() {
1515
this.setContent && this.content && this.setContent(this.content);
1616
}
1717

client/src/amplify-ui/toc/toc-provider/toc-provider.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ export class AmplifyTOCProvider {
1414

1515
setContent: SetContent = (content: HTMLElement) => (this.content = content);
1616

17-
setElements = () =>
18-
this.content &&
19-
(this.elements = Array.from(
20-
this.content.querySelectorAll("h2, h3"),
21-
).filter((e) => headingIsVisible(e)) as HTMLElement[]);
17+
setElements = () => {
18+
if (this.content) {
19+
this.elements = Array.from(
20+
this.content.querySelectorAll("h2, h3"),
21+
).filter((e) => headingIsVisible(e)) as HTMLElement[];
22+
}
23+
};
2224

2325
// @ts-ignore
2426
@Watch("content")

client/src/amplify-ui/toc/toc/toc.tsx

+15-16
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,23 @@ export class AmplifyTOC {
6464
return (
6565
<Host class={tocStyle}>
6666
<div>
67-
{this.elements && this.elements.length > 0 && (
67+
{this.elements && (
6868
<h4 class={headerStyle}>{this.pageTitle || "Contents"}</h4>
6969
)}
70-
{this.elements &&
71-
this.elements.map((e, i) => {
72-
const headingAnchorClass = headingStyleByTagName[e.tagName];
73-
return (
74-
<docs-in-page-link
75-
targetId={e.id}
76-
class={{
77-
active: i === this.activeLinkI,
78-
[headingAnchorClass]: true,
79-
}}
80-
>
81-
<div innerHTML={e.innerHTML} />
82-
</docs-in-page-link>
83-
);
84-
})}
70+
{this.elements?.map((e, i) => {
71+
const headingAnchorClass = headingStyleByTagName[e.tagName];
72+
return (
73+
<docs-in-page-link
74+
targetId={e.id}
75+
class={{
76+
active: i === this.activeLinkI,
77+
[headingAnchorClass]: true,
78+
}}
79+
>
80+
<div innerHTML={e.innerHTML} />
81+
</docs-in-page-link>
82+
);
83+
})}
8584
</div>
8685
</Host>
8786
);

client/src/aws-exports.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
2+
3+
const awsmobile = {
4+
"aws_project_region": "us-west-2",
5+
"aws_cognito_identity_pool_id": "us-west-2:4b632a29-b6d8-487f-bac4-c4311a5ab725",
6+
"aws_cognito_region": "us-west-2",
7+
"oauth": {},
8+
"aws_mobile_analytics_app_id": "53496f1ec97f4f57b6f9b1b5df579cda",
9+
"aws_mobile_analytics_app_region": "us-west-2"
10+
};
11+
12+
13+
export default awsmobile;

client/src/components.d.ts

+8
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ export namespace Components {
376376
* * component tag for documented component page
377377
*/
378378
"tag": string;
379+
/**
380+
* * whether or not the table contains header tags
381+
*/
382+
"useTableHeaders": boolean;
379383
}
380384
}
381385
declare global {
@@ -1068,6 +1072,10 @@ declare namespace LocalJSX {
10681072
* * component tag for documented component page
10691073
*/
10701074
"tag"?: string;
1075+
/**
1076+
* * whether or not the table contains header tags
1077+
*/
1078+
"useTableHeaders"?: boolean;
10711079
}
10721080
interface IntrinsicElements {
10731081
"amplify-callout": AmplifyCallout;

client/src/docs-ui/menu/menu.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ export class DocsMenu {
5151
<docs-version-switch
5252
leftOption={{
5353
title: "Latest",
54-
subTitle: "(v2)",
5554
href: "/ui",
5655
}}
5756
rightOption={{
5857
title: "Legacy",
59-
subTitle: "(v1)",
6058
href: "/ui-legacy",
6159
}}
6260
/>

client/src/docs-ui/page/__snapshots__/page.spec.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`docs-page Render logic should render 1`] = `
44
<docs-page class="css-mg8ajq">
55
<docs-universal-nav blend="" brand-icon="/assets/logo-light.svg" brand-icon-blend="/assets/logo-dark.svg" heading="Amplify Docs"></docs-universal-nav>
66
<docs-secondary-nav></docs-secondary-nav>
7-
<div class="css-1dm9jwm">
7+
<div class="css-1o5ehio">
88
<amplify-toc-provider>
99
<amplify-sidebar-layout>
1010
<amplify-sidebar-layout-main class="css-1j9n6qe" slot="main">

client/src/docs-ui/page/page.style.ts

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export const sidebarLayoutStyle = css`
2121
}
2222
}
2323
24+
amplify-toc-contents h4 {
25+
margin-bottom: 1rem;
26+
}
27+
2428
amplify-sidebar-layout-toggle {
2529
position: fixed;
2630
right: 1rem;

client/src/docs-ui/secondary-nav/__snapshots__/secondary-nav.spec.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ exports[`docs-secondary-nav Render logic should render 1`] = `
3333
</amplify-external-link>
3434
</div>
3535
</div>
36-
<div class="css-1bbteyh">
36+
<div class="css-153d8ox">
3737
<div>
3838
<div>
3939
<input class="three-dee-effect" id="amplify-docs-search-input" placeholder="Search" type="search">

client/src/docs-ui/secondary-nav/secondary-nav.style.ts

+31
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,37 @@ export const searchStyle = css`
106106
display: block;
107107
width: 100%;
108108
}
109+
110+
.algolia-autocomplete .ds-dropdown-menu * {
111+
white-space: normal
112+
}
113+
114+
.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column-text {
115+
white-space: normal;
116+
}
117+
118+
.algolia-autocomplete .algolia-docsearch-suggestion--content > .algolia-docsearch-suggestion--text > .algolia-docsearch-suggestion--highlight {
119+
box-shadow: inset 0 -2px 0 0 var(--color-orange-hv)
120+
}
121+
122+
.algolia-autocomplete .algolia-docsearch-suggestion--title {
123+
font-weight: bold;
124+
color: black;
125+
}
126+
127+
.algolia-autocomplete .algolia-docsearch-suggestion--text {
128+
font-size: 0.8rem;
129+
color: gray;
130+
}
131+
132+
.ds-cursor .algolia-docsearch-suggestion--content {
133+
background-color: var(--bg-color-hover) !important;
134+
}
135+
136+
.algolia-autocomplete .algolia-docsearch-suggestion--highlight {
137+
color: var(--color-orange-hv);
138+
background: var(--bg-color-hover);
139+
}
109140
110141
input {
111142
position: relative;

client/src/docs-ui/ui-component-props/__snapshots__/ui-component-props.spec.ts.snap

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
exports[`ui-component-props Render logic should render 1`] = `
44
<ui-component-props>
5-
<docs-in-page-link targetid="props-undefined">
6-
<h2 id="props-undefined">
7-
Properties
8-
</h2>
9-
</docs-in-page-link>
5+
<h4>
6+
Properties
7+
</h4>
108
</ui-component-props>
119
`;

client/src/docs-ui/ui-component-props/ui-component-props.spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ describe("ui-component-props", () => {
88

99
it("should init `tag` as `undefined`", () =>
1010
expect(uiComponentProps.tag).toBeUndefined());
11-
1211
});
1312

1413
describe("Render logic", () => {

client/src/docs-ui/ui-component-props/ui-component-props.style.ts

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,24 @@ import {css} from "emotion";
33
export const tableStyle = css`
44
text-align: left;
55
width: 100%;
6+
font-size: 0.875rem;
7+
margin-bottom: 1rem;
8+
69
thead tr {
710
background-color: var(--bg-color-tertiary);
811
}
912
tbody tr th {
1013
width: 5rem;
1114
}
12-
h3 {
13-
font-size: 1.25rem;
14-
margin-top: 0.75rem;
15-
}
15+
`;
16+
17+
export const sectionHeaderStyle = css`
18+
font-size: 1.2rem;
19+
font-weight: bold;
20+
margin-bottom: 1rem;
21+
`;
22+
23+
export const tableHeaderStyle = css`
24+
font-size: 1rem;
25+
margin: 0.75rem 0;
1626
`;

client/src/docs-ui/ui-component-props/ui-component-props.tsx

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import {Component, h, Prop, Host, State} from "@stencil/core";
22
import docs from "@aws-amplify/ui-components/dist/docs";
33
import {JsonDocsComponent} from "@stencil/core/internal";
4-
import {tableStyle} from "./ui-component-props.style";
4+
import {tableStyle, tableHeaderStyle} from "./ui-component-props.style";
55

66
@Component({tag: "ui-component-props", shadow: false})
77
export class DocsUIComponentProps {
88
/*** component tag for documented component page */
99
@Prop() readonly tag: string;
10+
/*** whether or not the table contains header tags */
11+
@Prop() readonly useTableHeaders: boolean = false;
1012

1113
@State() component: JsonDocsComponent | undefined;
1214

@@ -22,9 +24,14 @@ export class DocsUIComponentProps {
2224

2325
return (
2426
<Host>
25-
<docs-in-page-link targetId={sectionId}>
26-
<h2 id={sectionId}>Properties</h2>
27-
</docs-in-page-link>
27+
{this.useTableHeaders ? (
28+
<docs-in-page-link targetId={sectionId}>
29+
<h2 id={sectionId}>Properties</h2>
30+
</docs-in-page-link>
31+
) : (
32+
<h4>Properties</h4>
33+
)}
34+
2835
{this.component?.props.map((prop) => {
2936
const groupId = `prop-${prop.attr || String(count)}`;
3037
if (!prop.attr) {
@@ -36,9 +43,13 @@ export class DocsUIComponentProps {
3643
<thead>
3744
<tr>
3845
<th colSpan={2}>
39-
<docs-in-page-link targetId={groupId}>
40-
<h3 id={groupId}>{prop.name}</h3>
41-
</docs-in-page-link>
46+
{this.useTableHeaders ? (
47+
<docs-in-page-link targetId={groupId}>
48+
<h3 id={groupId}>{prop.name}</h3>
49+
</docs-in-page-link>
50+
) : (
51+
<div class={tableHeaderStyle}>{prop.name}</div>
52+
)}
4253
</th>
4354
</tr>
4455
</thead>

0 commit comments

Comments
 (0)