Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d46a0aef
Unverified
Commit
d46a0aef
authored
Apr 05, 2020
by
Alejandro
Committed by
GitHub
Apr 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate with-atlaskit (#11269)
* Add with-atlaskit * Fix * Fix * Add babel
parent
52f9e911
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
196 additions
and
0 deletions
+196
-0
.babelrc
examples/with-atlaskit/.babelrc
+4
-0
README.md
examples/with-atlaskit/README.md
+13
-0
ButtonComponent.js
examples/with-atlaskit/components/ButtonComponent.js
+30
-0
CheckboxComponent.js
examples/with-atlaskit/components/CheckboxComponent.js
+30
-0
DateTimePickerComponent.js
examples/with-atlaskit/components/DateTimePickerComponent.js
+24
-0
DropdownMenuComponent.js
examples/with-atlaskit/components/DropdownMenuComponent.js
+26
-0
package.json
examples/with-atlaskit/package.json
+24
-0
_document.js
examples/with-atlaskit/pages/_document.js
+29
-0
index.js
examples/with-atlaskit/pages/index.js
+16
-0
No files found.
examples/with-atlaskit/.babelrc
0 → 100644
View file @
d46a0aef
{
"presets": ["next/babel"],
"plugins": [["styled-components", { "ssr": true }]]
}
examples/with-atlaskit/README.md
0 → 100644
View file @
d46a0aef
# Atlassian Atlaskit example
This example shows how to use Next.js along with Atlaskit of React. This is intended to show the integration of this UI toolkit with the Framework.
Install it and run:
```
bash
npm
install
npm run dev
# or
yarn
yarn dev
```
examples/with-atlaskit/components/ButtonComponent.js
0 → 100644
View file @
d46a0aef
import
React
from
'react'
import
Button
,
{
ButtonGroup
}
from
'@atlaskit/button'
export
default
()
=>
{
return
(
<
React
.
Fragment
>
<
Button
style
=
{{
margin
:
10
}}
>
Button
<
/Button
>
<
Button
style
=
{{
margin
:
10
}}
appearance
=
"primary"
>
Primary
Button
<
/Button
>
<
Button
style
=
{{
margin
:
10
}}
appearance
=
"danger"
>
Danger
Button
<
/Button
>
<
Button
style
=
{{
margin
:
10
}}
appearance
=
"warning"
>
Warning
Button
<
/Button
>
<
Button
style
=
{{
margin
:
10
}}
appearance
=
"link"
>
Link
Button
<
/Button
>
<
Button
style
=
{{
margin
:
10
}}
isDisabled
>
Disabled
Button
<
/Button
>
<
ButtonGroup
appearance
=
"primary"
>
<
Button
>
First
Button
<
/Button
>
<
Button
>
Second
Button
<
/Button
>
<
Button
>
Third
Button
<
/Button
>
<
/ButtonGroup
>
<
/React.Fragment
>
)
}
examples/with-atlaskit/components/CheckboxComponent.js
0 → 100644
View file @
d46a0aef
import
React
from
'react'
import
{
Checkbox
}
from
'@atlaskit/checkbox'
export
default
()
=>
{
return
(
<
React
.
Fragment
>
<
Checkbox
value
=
"Basic checkbox"
label
=
"Basic checkbox"
onChange
=
{()
=>
{}}
name
=
"checkbox-basic"
testId
=
"cb-basic"
/>
<
Checkbox
isDisabled
label
=
"Disabled"
value
=
"Disabled"
name
=
"checkbox-disabled"
testId
=
"cb-disabled"
/>
<
Checkbox
isInvalid
label
=
"Invalid"
value
=
"Invalid"
name
=
"checkbox-invalid"
testId
=
"cb-invalid"
/>
<
/React.Fragment
>
)
}
examples/with-atlaskit/components/DateTimePickerComponent.js
0 → 100644
View file @
d46a0aef
import
React
from
'react'
import
{
DatePicker
,
DateTimePicker
,
TimePicker
,
}
from
'@atlaskit/datetime-picker'
import
{
Label
}
from
'@atlaskit/field-base'
export
default
()
=>
{
return
(
<
React
.
Fragment
>
<
Label
label
=
"TimePicker - timeFormat (h:mm a)"
/>
<
TimePicker
onChange
=
{
console
.
log
}
timeFormat
=
"h:mm a"
/>
<
Label
label
=
"DatePicker - dateFormat (DD/MM/YYYY)"
/>
<
DatePicker
onChange
=
{
console
.
log
}
dateFormat
=
"DD/MM/YYYY"
/>
<
Label
label
=
"DateTimePicker - dateFormat (HH:mm) & timeFormat (Do MMMM YYYY)"
/>
<
DateTimePicker
onChange
=
{
console
.
log
}
timeFormat
=
"HH:mm"
dateFormat
=
"Do MMMM YYYY"
/>
<
/React.Fragment
>
)
}
examples/with-atlaskit/components/DropdownMenuComponent.js
0 → 100644
View file @
d46a0aef
import
React
from
'react'
import
DropdownMenu
,
{
DropdownItemGroup
,
DropdownItem
,
}
from
'@atlaskit/dropdown-menu'
import
{
Label
}
from
'@atlaskit/field-base'
export
default
()
=>
{
return
(
<
React
.
Fragment
>
<
Label
label
=
"DropdownMenu"
/>
<
DropdownMenu
trigger
=
"Cities in Australia"
triggerType
=
"button"
>
<
DropdownItemGroup
>
<
DropdownItem
>
Sydney
<
/DropdownItem
>
<
DropdownItem
>
Melbourne
<
/DropdownItem
>
<
DropdownItem
>
Adelaide
<
/DropdownItem
>
<
DropdownItem
>
Perth
<
/DropdownItem
>
<
DropdownItem
>
Brisbane
<
/DropdownItem
>
<
DropdownItem
>
Canberra
<
/DropdownItem
>
<
DropdownItem
>
Hobart
<
/DropdownItem
>
<
DropdownItem
>
Darwin
<
/DropdownItem
>
<
/DropdownItemGroup
>
<
/DropdownMenu
>
<
/React.Fragment
>
)
}
examples/with-atlaskit/package.json
0 → 100644
View file @
d46a0aef
{
"name"
:
"with-atlaskit"
,
"version"
:
"0.1.0"
,
"private"
:
true
,
"scripts"
:
{
"dev"
:
"next dev"
,
"build"
:
"next build"
,
"start"
:
"next start"
},
"dependencies"
:
{
"@atlaskit/button"
:
"^13.3.9"
,
"@atlaskit/checkbox"
:
"^10.1.10"
,
"@atlaskit/datetime-picker"
:
"^9.2.8"
,
"@atlaskit/dropdown-menu"
:
"^9.0.2"
,
"@atlaskit/field-base"
:
"^14.0.2"
,
"next"
:
"^9.3.1"
,
"react"
:
"^16.13.1"
,
"react-dom"
:
"^16.13.1"
,
"styled-components"
:
"^5.0.1"
},
"devDependencies"
:
{
"babel-plugin-styled-components"
:
"^1.10.7"
}
}
examples/with-atlaskit/pages/_document.js
0 → 100644
View file @
d46a0aef
import
Document
from
'next/document'
import
{
ServerStyleSheet
}
from
'styled-components'
export
default
class
MyDocument
extends
Document
{
static
async
getInitialProps
(
ctx
)
{
const
sheet
=
new
ServerStyleSheet
()
const
originalRenderPage
=
ctx
.
renderPage
try
{
ctx
.
renderPage
=
()
=>
originalRenderPage
({
enhanceApp
:
App
=>
props
=>
sheet
.
collectStyles
(
<
App
{...
props
}
/>
)
,
})
const
initialProps
=
await
Document
.
getInitialProps
(
ctx
)
return
{
...
initialProps
,
styles
:
(
<>
{
initialProps
.
styles
}
{
sheet
.
getStyleElement
()}
<
/
>
),
}
}
finally
{
sheet
.
seal
()
}
}
}
examples/with-atlaskit/pages/index.js
0 → 100644
View file @
d46a0aef
import
React
from
'react'
import
ButtonComponent
from
'../components/ButtonComponent'
import
CheckboxComponent
from
'../components/CheckboxComponent'
import
DateTimePickerComponent
from
'../components/DateTimePickerComponent'
import
DropdownMenuComponent
from
'../components/DropdownMenuComponent'
export
default
()
=>
{
return
(
<
React
.
Fragment
>
<
ButtonComponent
/>
<
CheckboxComponent
/>
<
DateTimePickerComponent
/>
<
DropdownMenuComponent
/>
<
/React.Fragment
>
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment