Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.

Commit 7a3917b

Browse files
authored
0.2.1 (#536)
* Added aditional pages to the PoC to test components * be flexible about array children * Simplify proptypes * add a tiny * next to required fields * add default, move type to description * add meta from md to component-metadata.json * move metadata call to right place * add unstable tag, redesign them * remove unstable from child * 0.2.1: Update version and changelog (#535)
1 parent 5cae1ff commit 7a3917b

File tree

19 files changed

+231
-31
lines changed

19 files changed

+231
-31
lines changed

changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## 0.2.1 [May 8, 2018]
9+
10+
### Fixed
11+
12+
* Fix persistent warning in `Form.Actions` [#529]
13+
14+
### Changed
15+
16+
* Added information on defaults and required fields in docs [#533]
17+
818
## 0.2.0 [April 26, 2018]
919

1020
### Fixed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cosmos",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"engine": "^7.0.0",
55
"private": true,
66
"workspaces": [

src/components/molecules/button-group/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ ButtonGroup.propTypes = {
4848
/** Make Buttons stick to each other */
4949
compressed: PropTypes.bool,
5050
/** Should container only Buttons */
51-
children: PropTypes.oneOfType([
52-
PropTypes.element, // just one button for dynamic cases like Form Actions
53-
PropTypes.arrayOf(PropTypes.element)
54-
])
51+
children: PropTypes.node
5552
}
5653

5754
ButtonGroup.defaultProps = {

src/components/molecules/resource-list/item/item.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
```meta
22
category: Layout
33
description: "A single item in a ResourceList"
4-
unstable: true
54
```
65
76
A `ResourceList.Item` is a single item that is displayed in a [ResourceList](/docs/resource-list). You won't typically use this directly, except to return it as a result from a `renderItem()` function passed to a `ResourceList`.

src/docs/docs-components/tag.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ import React from 'react'
22
import styled from 'styled-components'
33
import PropTypes from 'prop-types'
44

5-
import { fonts } from '@auth0/cosmos/tokens'
5+
import { colors, fonts, misc } from '@auth0/cosmos-tokens'
6+
console.log(misc)
67

78
const StyledTag = styled.span`
8-
background-color: red;
99
display: inline-block;
10-
background-color: #777;
11-
border-radius: 10px;
10+
color: ${props => (props.warning ? colors.base.orangeLighter : colors.base.gray)};
11+
border: 1px solid;
12+
border-color: ${props => (props.warning ? colors.base.orangeLighter : colors.base.gray)};
13+
border-radius: 5px;
1214
min-width: 10px;
1315
padding: 4px 8px;
14-
color: white;
1516
line-height: 1;
1617
vertical-align: middle;
1718
white-space: nowrap;
@@ -21,7 +22,7 @@ const StyledTag = styled.span`
2122

2223
const Tag = props => {
2324
/* you can pass on all the props to the component like this */
24-
return <StyledTag>{props.text}</StyledTag>
25+
return <StyledTag {...props}>{props.text}</StyledTag>
2526
}
2627

2728
Tag.propTypes = {

src/docs/sidebar/link.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ const StyledLink = styled.div`
2727
`
2828

2929
const TagWrapper = styled.span`
30-
color: ${colors.base.grayMedium};
3130
float: right;
3231
`
3332

3433
const Link = props => {
3534
const { displayName, documentation, implemented } = props.component
3635
const url = `/docs/${kebabCase(displayName)}`
36+
const unstable = props.component.meta && props.component.meta.unstable
3737

3838
return (
3939
<StyledLink disabled={!documentation} isChild={props.parent}>
@@ -52,6 +52,11 @@ const Link = props => {
5252
<Tag text="Not documented" />
5353
</TagWrapper>
5454
)}
55+
{unstable ? (
56+
<TagWrapper>
57+
<Tag warning text="Experimental" />
58+
</TagWrapper>
59+
) : null}
5560
{implemented ? null : (
5661
<TagWrapper>
5762
<Tag text="Not implemented" />

src/docs/spec/default-props.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,11 @@ const addDefaultValues = propData => {
99
return propData
1010
}
1111

12+
const getDefaultValue = propData => {
13+
if (propData.defaultValue && propData.defaultValue.value !== 'null') {
14+
return propData.defaultValue.value
15+
}
16+
}
17+
1218
export default addDefaultValues
19+
export { getDefaultValue }

src/docs/spec/props.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styled from 'styled-components'
44
import { spacing, colors, fonts, misc } from '@auth0/cosmos/tokens'
55
import { Code } from '@auth0/cosmos'
66
import parseType from './prop-type'
7-
import addDefaultValues from './default-props'
7+
import addDefaultValues, { getDefaultValue } from './default-props'
88
import getConflictingProps from './prop-conflicts'
99
import PropSwitcher from './prop-switcher'
1010

@@ -18,6 +18,7 @@ const Table = styled.table`
1818
padding: ${spacing.small} ${spacing.small};
1919
vertical-align: middle;
2020
position: relative;
21+
color: ${colors.base.grayDark};
2122
}
2223
th {
2324
border-bottom: 2px solid #ddd;
@@ -36,15 +37,18 @@ const Table = styled.table`
3637
const Type = styled.div`
3738
font-size: 13px;
3839
font-family: ${fonts.family.code};
39-
color: ${colors.base.grayDark};
4040
padding: 0 ${spacing.xsmall};
4141
border-radius: ${misc.radius};
4242
position: relative;
4343
left: -${spacing.xsmall};
4444
`
4545

46-
const Description = styled.span`
47-
color: ${colors.base.grayDark};
46+
const Required = styled.span`
47+
color: ${colors.base.orange};
48+
&:after {
49+
content: '*';
50+
font-size: 16px;
51+
}
4852
`
4953

5054
class Props extends React.Component {
@@ -90,7 +94,7 @@ class Props extends React.Component {
9094
<tr>
9195
<th>Name</th>
9296
<th>Description</th>
93-
<th>Type</th>
97+
<th>Default</th>
9498
<th />
9599
</tr>
96100
</thead>
@@ -99,14 +103,13 @@ class Props extends React.Component {
99103
<tr key={key}>
100104
<td>
101105
<Code>{key}</Code>
106+
{propData[key].required && <Required />}
102107
</td>
103108
<td>
104-
<Description>{propData[key].description}</Description>
105-
</td>
106-
<td>
107-
<Type>{parseType(propData[key].type)}</Type>
109+
{propData[key].description}
110+
<Type>type: {parseType(propData[key].type)}</Type>
108111
</td>
109-
112+
<td>{getDefaultValue(propData[key])}</td>
110113
<td>
111114
<PropSwitcher
112115
propName={key}

src/manage/components/page.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { BrowserRouter as Router, Route } from 'react-router-dom'
44
import ClientIndex from '../pages/clients'
55
import ClientDetail from '../pages/client-detail'
66
import EmailsIndex from '../pages/emails'
7+
import RulesIndex from '../pages/rules'
8+
import SsoIndex from '../pages/sso-integrations'
9+
import AnomalyDetectionIndex from '../pages/anomaly-detection'
10+
import LogsIndex from '../pages/slogs'
11+
import ApisIndex from '../pages/apis'
12+
import UsersIndex from '../pages/users'
713

814
const Page = () => (
915
<div
@@ -18,6 +24,12 @@ const Page = () => (
1824
<Route exact path="/manage/clients" component={ClientIndex} />
1925
<Route exact path="/manage/clients/:clientId" component={ClientDetail} />
2026
<Route exact path="/manage/emails" component={EmailsIndex} />
27+
<Route exact path="/manage/rules" component={RulesIndex} />
28+
<Route exact path="/manage/logs" component={LogsIndex} />
29+
<Route exact path="/manage/users" component={UsersIndex} />
30+
<Route exact path="/manage/apis" component={ApisIndex} />
31+
<Route exact path="/manage/anomaly" component={AnomalyDetectionIndex} />
32+
<Route exact path="/manage/sso-integrations" component={SsoIndex} />
2133
</div>
2234
</Router>
2335
</div>

src/manage/components/side-navigation.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ export default () => (
1212
>
1313
<Sidebar>
1414
<Sidebar.Link icon="dashboard" label="Dashboard" url="/manage" />
15-
<Sidebar.Link icon="clients" label="Clients" url="/manage/clients" selected />
15+
<Sidebar.Link icon="clients" label="Clients" url="/manage/clients" />
1616
<Sidebar.Link icon="apis" label="APIs" url="/manage/apis" />
17-
<Sidebar.Link icon="sso-integrations" label="SSO Integrations" url="/manage/externalapps" />
17+
<Sidebar.Link
18+
icon="sso-integrations"
19+
label="SSO Integrations"
20+
url="/manage/sso-integrations"
21+
/>
1822
<Sidebar.LinkGroup icon="connections" label="Connections">
1923
<Sidebar.Link label="Database" url="/manage/connections/database" />
2024
<Sidebar.Link label="Social" url="/manage/connections/social" />
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react'
2+
3+
import { PageHeader } from '@auth0/cosmos'
4+
5+
class AnomalyDetectionIndex extends React.Component {
6+
render() {
7+
return (
8+
<div>
9+
<PageHeader
10+
title="Anomaly Detection"
11+
description={{
12+
text:
13+
'Provide extra layer of security to your customers by enabling shields​ that protect you and your users against different types of attacks and user access anomalies.'
14+
}}
15+
/>
16+
</div>
17+
)
18+
}
19+
}
20+
21+
export default AnomalyDetectionIndex

src/manage/pages/apis/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from 'react'
2+
3+
import { PageHeader } from '@auth0/cosmos'
4+
5+
class ApisIndex extends React.Component {
6+
render() {
7+
return (
8+
<div>
9+
<PageHeader
10+
title="APIs"
11+
description={{
12+
text: 'Define APIs that you can consume from your authorized applications.',
13+
learnMore: '/'
14+
}}
15+
primaryAction={{
16+
label: 'Create API',
17+
icon: 'plus',
18+
method: null
19+
}}
20+
/>
21+
</div>
22+
)
23+
}
24+
}
25+
26+
export default ApisIndex

src/manage/pages/clients/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import React from 'react'
2-
import styled from 'styled-components'
3-
42
import { PageHeader } from '@auth0/cosmos'
53

64
import CreateClientDialog from './create-client-dialog'
75
import ClientList from '../../components/client-list'
86

9-
const ClientsContent = styled.div``
10-
117
class ClientIndex extends React.Component {
128
constructor(props) {
139
super(props)
@@ -20,7 +16,7 @@ class ClientIndex extends React.Component {
2016

2117
render() {
2218
return (
23-
<ClientsContent>
19+
<div>
2420
<PageHeader
2521
title="Clients"
2622
description={{
@@ -42,7 +38,7 @@ class ClientIndex extends React.Component {
4238
<ClientList />
4339

4440
<CreateClientDialog open={this.state.dialogOpen} onClose={this.setDialogOpen(false)} />
45-
</ClientsContent>
41+
</div>
4642
)
4743
}
4844
}

src/manage/pages/rules/index.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from 'react'
2+
3+
import { PageHeader } from '@auth0/cosmos'
4+
5+
class RulesIndex extends React.Component {
6+
render() {
7+
return (
8+
<div>
9+
<PageHeader
10+
title="Rules"
11+
description={{
12+
text:
13+
'Custom Javascript snippets that run in a secure, isolated sandbox in the Auth0 service as part of your authentication pipeline.',
14+
learnMore: '/'
15+
}}
16+
primaryAction={{
17+
label: 'Create Rule',
18+
icon: 'plus',
19+
method: null
20+
}}
21+
secondaryAction={{
22+
label: 'Tutorial',
23+
icon: 'play-circle',
24+
method: () => {}
25+
}}
26+
/>
27+
</div>
28+
)
29+
}
30+
}
31+
32+
export default RulesIndex

src/manage/pages/slogs/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react'
2+
3+
import { PageHeader } from '@auth0/cosmos'
4+
5+
class LogsIndex extends React.Component {
6+
render() {
7+
return (
8+
<div>
9+
<PageHeader
10+
title="Logs"
11+
description={{
12+
text:
13+
'Storage of log data of both actions taken in the dashboard by the administrators, as well as authentications made by your users.',
14+
learnMore: '/'
15+
}}
16+
/>
17+
</div>
18+
)
19+
}
20+
}
21+
22+
export default LogsIndex
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react'
2+
3+
import { EmptyState } from '@auth0/cosmos'
4+
5+
class SsoIndex extends React.Component {
6+
render() {
7+
return (
8+
<div>
9+
<EmptyState
10+
title="SSO Integrations"
11+
icon="sso-integrations"
12+
helpUrl="http://auth0.com"
13+
action={{
14+
icon: 'plus',
15+
text: 'Create SSO Integration'
16+
}}
17+
/>
18+
</div>
19+
)
20+
}
21+
}
22+
23+
export default SsoIndex

0 commit comments

Comments
 (0)