Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/@react-spectrum/button/docs/Button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,30 @@ function Example() {
## Visual Options

### Call To Action
[View guidelines](https://spectrum.adobe.com/page/button/#Call-to-action)

```tsx example
<Button variant="cta">Test</Button>
```

### Primary
[View guidelines](https://spectrum.adobe.com/page/button/#Primary)

```tsx example
<Button variant="primary">Test</Button>
<Button variant="primary" isQuiet>Test</Button>
```

### Secondary
[View guidelines](https://spectrum.adobe.com/page/button/#Secondary)

```tsx example
<Button variant="secondary">Test</Button>
<Button variant="secondary" isQuiet>Test</Button>
```

### Over Background
[View guidelines](https://spectrum.adobe.com/page/button/#Over-background)

```tsx example
<div style={{backgroundColor: 'rgb(15, 121, 125)', padding: '15px 20px'}}>
Expand All @@ -110,6 +114,7 @@ function Example() {
```

### Negative
[View guidelines](https://spectrum.adobe.com/page/button/#Negative)

```tsx example
<Button variant="negative">Test</Button>
Expand Down
22 changes: 22 additions & 0 deletions packages/@react-spectrum/icon/docs/Icon.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License. -->

import {Layout} from '@react-spectrum/docs';
export default Layout;

import docs from 'docs:@react-spectrum/icon';
import {HeaderInfo, PropTable} from '@react-spectrum/docs';
import packageData from '../package.json';

```jsx import
import {Icon} from '@react-spectrum/icon';
```

# Icon
<p>Docs coming soon</p>
27 changes: 26 additions & 1 deletion packages/@react-spectrum/icon/src/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,39 @@ import {useProvider} from '@react-spectrum/provider';
type Scale = 'M' | 'L'

interface IconProps extends DOMProps, StyleProps {
/**
* Alternate text for assistive technologies
*/
alt?: string,
/**
* The content to display. Should be an SVG
*/
children: ReactElement,
/**
* Size of Icon (changes based on scale)
*/
size?: 'XXS' | 'XS' | 'S' | 'M' | 'L' |'XL' | 'XXL',
/**
* TODO
*/
scale?: Scale,
/**
* TODO
*/
color?: string,
slot?: string
/**
* TODO
*/
slot?: string,
/**
* @default 'img'
*/
role?: string
}

/**
* Spectrum icons are clear, minimal, and consistent across platforms. They follow the focused and rational principles of the design system in both metaphor and style.
*/
export function Icon(props: IconProps) {
let {
children,
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-spectrum/well/docs/Well.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ However, if the Well does convey semantic meaning then a role must be specified

```tsx example
<Well role="region" aria-labelledby="wellLabel">
<Heading id="wellLabel" variant="subtitle1">Shipping Address</Heading>
<h3 id="wellLabel">Shipping Address</h3>
<p>601 Townsend Street<br /> San Francisco, CA 94103</p>
</Well>
```
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/parcel-transformer-docs/DocsTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ module.exports = new Transformer({
path.traverse({
ReturnStatement(path) {
let ret = path.node.argument;
if (t.isJSXElement(ret) || t.isJSXFragment(ret)) {
if (t.isJSXElement(ret) || t.isJSXFragment(ret) || isReactCall(path.get('argument'), 'cloneElement')) {
returnsJSX = true;
}
}
Expand Down