-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into radiogroup-tokens
- Loading branch information
Showing
151 changed files
with
2,746 additions
and
880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@aws-amplify/ui-react": patch | ||
--- | ||
|
||
Add missing prop descriptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { CopyButton } from '@/components/CopyButton'; | ||
import { Tabs, TabItem } from '@aws-amplify/ui-react'; | ||
|
||
type WebFramework = 'react' | 'vue' | 'angular'; | ||
|
||
interface TerminalCommandProps { | ||
framework: WebFramework; | ||
packageManager: 'npm' | 'yarn'; | ||
} | ||
|
||
const TerminalCommand = ({ | ||
framework, | ||
packageManager, | ||
}: TerminalCommandProps) => { | ||
const frameworkInstallScript = `${ | ||
packageManager === 'npm' ? 'npm i' : 'yarn add' | ||
} @aws-amplify/ui-${framework} aws-amplify`; | ||
|
||
return ( | ||
<code className="install-code__container"> | ||
<p className="install-code__content">{frameworkInstallScript}</p> | ||
<CopyButton | ||
className="install-code__button" | ||
copyText={frameworkInstallScript} | ||
variation="link" | ||
/> | ||
</code> | ||
); | ||
}; | ||
|
||
interface InstallScriptsProps { | ||
framework: WebFramework; | ||
} | ||
|
||
export const InstallScripts = ({ framework }: InstallScriptsProps) => { | ||
return ( | ||
<Tabs maxWidth="42rem"> | ||
<TabItem title="npm"> | ||
<TerminalCommand framework={framework} packageManager="npm" /> | ||
</TabItem> | ||
<TabItem title="yarn"> | ||
<TerminalCommand framework={framework} packageManager="yarn" /> | ||
</TabItem> | ||
</Tabs> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Link, Flex, View } from '@aws-amplify/ui-react'; | ||
import { Fragment } from '@/components/Fragment'; | ||
import { ThemeAlert } from '@/components/ThemeAlert'; | ||
import { GITHUB_REPO_FILE } from '@/data/links'; | ||
import { DesignTokenIcon } from '@/components/Icons'; | ||
|
||
### Theme | ||
|
||
<ThemeAlert /> | ||
|
||
You can customize the appearance of all {props.component} components in your application with a [Theme](/theming). | ||
|
||
<Link | ||
className="docs-component-link" | ||
href={`${GITHUB_REPO_FILE}packages/ui/src/theme/tokens/components/${ | ||
props.link || | ||
props.component.charAt(0).toLowerCase() + props.component.slice(1) | ||
}.ts`} | ||
isExternal | ||
> | ||
<DesignTokenIcon ariaLabel="theme-source" marginInlineEnd="0.5rem" /> | ||
{props.component} Theme Source | ||
</Link> | ||
|
||
<View backgroundColor="white">{props.children}</View> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
docs/src/pages/[platform]/components/alert/examples/AlertThemeExample.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Alert, Flex, ThemeProvider, Theme } from '@aws-amplify/ui-react'; | ||
|
||
const theme: Theme = { | ||
name: 'alert-theme', | ||
tokens: { | ||
components: { | ||
alert: { | ||
// Default styles | ||
backgroundColor: { value: '{colors.teal.20}' }, | ||
|
||
icon: { | ||
size: { value: '{fontSizes.xxxl}' }, | ||
}, | ||
|
||
heading: { | ||
fontSize: { value: '{fontSizes.large}' }, | ||
fontWeight: { value: '{fontWeights.normal}' }, | ||
}, | ||
|
||
// Variations | ||
info: { | ||
color: { value: 'white' }, | ||
backgroundColor: { value: '{colors.blue.80}' }, | ||
}, | ||
|
||
success: { | ||
color: { value: 'black' }, | ||
backgroundColor: { value: '{colors.yellow.40}' }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const AlertThemeExample = () => ( | ||
<ThemeProvider theme={theme} colorMode="light"> | ||
<Flex direction="column"> | ||
<Alert heading="Default alert title">Hello</Alert> | ||
<Alert variation="info" heading="Info"> | ||
Here is some info | ||
</Alert> | ||
<Alert variation="success" heading="Success"> | ||
Hooray! | ||
</Alert> | ||
</Flex> | ||
</ThemeProvider> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,5 +126,4 @@ The following example customizes these slots with: | |
}, | ||
|
||
}}/> | ||
/> | ||
</Example> |
40 changes: 40 additions & 0 deletions
40
docs/src/pages/[platform]/components/badge/examples/BadgeThemeExample.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Badge, ThemeProvider, Theme, Flex } from '@aws-amplify/ui-react'; | ||
|
||
const theme: Theme = { | ||
name: 'badge-theme', | ||
tokens: { | ||
components: { | ||
badge: { | ||
// Default styles | ||
color: { value: '{colors.white}' }, | ||
fontWeight: { value: '{fontWeights.normal}' }, | ||
fontSize: { value: '{fontSizes.medium}' }, | ||
backgroundColor: { value: '{colors.blue.80}' }, | ||
paddingVertical: { value: '{space.small}' }, | ||
paddingHorizontal: { value: '{space.medium}' }, | ||
borderRadius: { value: '{radii.small}' }, | ||
|
||
// Variations | ||
success: { | ||
color: { value: '{colors.black}' }, | ||
backgroundColor: { value: '{colors.green.60}' }, | ||
}, | ||
|
||
// Sizes | ||
large: { | ||
fontSize: { value: '{fontSizes.xxl}' }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const BadgeThemeExample = () => ( | ||
<ThemeProvider theme={theme} colorMode="light"> | ||
<Flex alignItems="flex-end"> | ||
<Badge>Default</Badge> | ||
<Badge variation="success">Success</Badge> | ||
<Badge size="large">Large</Badge> | ||
</Flex> | ||
</ThemeProvider> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.