Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
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
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
91fa33cd
Commit
91fa33cd
authored
Mar 26, 2021
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Mar 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add button examples to pattern library
parent
f503edcc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
140 additions
and
0 deletions
+140
-0
PlaygroundApp.js
dev-server/ui-playground/components/PlaygroundApp.js
+6
-0
SharedButtonPatterns.js
...ui-playground/components/patterns/SharedButtonPatterns.js
+133
-0
ui-playground.scss
src/styles/ui-playground/ui-playground.scss
+1
-0
No files found.
dev-server/ui-playground/components/PlaygroundApp.js
View file @
91fa33cd
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
MenuPatterns
from
'./patterns/MenuPatterns'
;
import
MenuPatterns
from
'./patterns/MenuPatterns'
;
import
SharedButtonPatterns
from
'./patterns/SharedButtonPatterns'
;
import
{
useRoute
}
from
'../router'
;
import
{
useRoute
}
from
'../router'
;
...
@@ -24,6 +25,11 @@ const routes = [
...
@@ -24,6 +25,11 @@ const routes = [
title
:
'Menu'
,
title
:
'Menu'
,
component
:
MenuPatterns
,
component
:
MenuPatterns
,
},
},
{
route
:
'/shared-buttons'
,
title
:
'Buttons (Shared)'
,
component
:
SharedButtonPatterns
,
},
];
];
const
demoRoutes
=
routes
.
filter
(
r
=>
r
.
component
!==
HomeRoute
);
const
demoRoutes
=
routes
.
filter
(
r
=>
r
.
component
!==
HomeRoute
);
...
...
dev-server/ui-playground/components/patterns/SharedButtonPatterns.js
0 → 100644
View file @
91fa33cd
import
{
PatternPage
,
Pattern
,
PatternExamples
,
PatternExample
,
}
from
'../PatternPage'
;
import
{
IconButton
,
LabeledButton
,
LinkButton
,
}
from
'../../../../src/shared/components/buttons'
;
export
default
function
SharedButtonPatterns
()
{
return
(
<
PatternPage
title
=
"Buttons (Shared)"
>
<
Pattern
title
=
"IconButton"
>
<
p
>
A
button
containing
an
icon
and
no
label
(
text
)
<
/p
>
<
PatternExamples
>
<
PatternExample
details
=
"Basic usage"
>
<
IconButton
icon
=
"edit"
title
=
"Edit"
/>
<
/PatternExample
>
<
PatternExample
details
=
"Pressed"
>
<
IconButton
icon
=
"trash"
title
=
"Delete annotation"
pressed
/>
<
/PatternExample
>
<
PatternExample
details
=
"Expanded"
>
<
IconButton
icon
=
"trash"
title
=
"Delete annotation"
expanded
/>
<
/PatternExample
>
<
PatternExample
details
=
"Disabled"
>
<
IconButton
icon
=
"trash"
title
=
"Delete annotation"
disabled
/>
<
/PatternExample
>
<
PatternExample
details
=
"Primary variant"
>
<
IconButton
icon
=
"trash"
title
=
"Delete annotation"
variant
=
"primary"
/>
<
/PatternExample
>
<
/PatternExamples
>
<
/Pattern
>
<
Pattern
title
=
"LabeledButton"
>
<
p
>
A
button
with
a
label
(
text
)
and
optionally
an
icon
.
<
/p
>
<
PatternExamples
title
=
"Label only"
>
<
PatternExample
details
=
"Basic usage"
>
<
LabeledButton
>
Edit
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Pressed"
>
<
LabeledButton
pressed
>
Edit
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Expanded"
>
<
LabeledButton
expanded
>
Edit
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Disabled"
>
<
LabeledButton
disabled
>
Edit
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Primary variant"
>
<
LabeledButton
variant
=
"primary"
>
Edit
<
/LabeledButton
>
<
/PatternExample
>
<
/PatternExamples
>
<
PatternExamples
title
=
"Label and icon"
>
<
PatternExample
details
=
"Basic usage"
>
<
LabeledButton
icon
=
"profile"
>
Edit
User
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Pressed"
>
<
LabeledButton
icon
=
"profile"
pressed
>
Edit
User
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Expanded"
>
<
LabeledButton
icon
=
"profile"
expanded
>
Edit
User
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Disabled"
>
<
LabeledButton
icon
=
"profile"
disabled
>
Edit
User
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Right icon"
>
<
LabeledButton
icon
=
"profile"
iconPosition
=
"right"
>
Edit
User
<
/LabeledButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Primary variant"
>
<
LabeledButton
icon
=
"profile"
variant
=
"primary"
>
Edit
User
<
/LabeledButton
>
<
/PatternExample
>
<
/PatternExamples
>
<
/Pattern
>
<
Pattern
title
=
"LinkButton"
>
<
p
>
A
button
styled
to
look
like
a
link
(
anchor
tag
).
<
/p
>
<
PatternExamples
>
<
PatternExample
details
=
"Basic usage"
>
<
LinkButton
>
Show
replies
(
10
)
<
/LinkButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Pressed"
>
<
LinkButton
pressed
>
Show
replies
(
10
)
<
/LinkButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Expanded"
>
<
LinkButton
expanded
>
Show
replies
(
10
)
<
/LinkButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Disabled"
>
<
LinkButton
disabled
>
Show
replies
(
10
)
<
/LinkButton
>
<
/PatternExample
>
<
PatternExample
details
=
"Primary variant"
>
<
LinkButton
variant
=
"primary"
>
Show
replies
(
10
)
<
/LinkButton
>
<
/PatternExample
>
<
/PatternExamples
>
<
/Pattern
>
<
/PatternPage
>
);
}
src/styles/ui-playground/ui-playground.scss
View file @
91fa33cd
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
@use
'../mixins/layout'
;
@use
'../mixins/layout'
;
@use
'../variables'
as
var
;
@use
'../variables'
as
var
;
@use
'../shared'
;
@use
'../sidebar/components/Menu'
;
@use
'../sidebar/components/Menu'
;
@use
'../sidebar/components/MenuItem'
;
@use
'../sidebar/components/MenuItem'
;
...
...
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