Skip to content

Commit

Permalink
chore: add basic styles and BootstrapVue components to styleguide (#2163
Browse files Browse the repository at this point in the history
)

* Add typography styles

* Add more typography styles

* Add colors to styleguide

* Add shadows to styleguide. Remove unused scss variables

* Refactor typography into bv table

* Add border-radius styles to styleguide

* Add b-alert to styleguide

* Add b-breadcrumb to styleguide

* Add b-card to styleguide and start a styleguide image library

* Add Dropdown to styleguide

* Add b-form and form inputs to styleguide

* Add b-link to styleguide

* Add b-list-group to styleguide

* Add b-modal to styleguide

* Add b-nav to styleguide

* Add b-navbar to styleguide

* Add b-sidebar to styleguide

* Add b-table to styleguide

* Add b-tabs to styleguide

* Add b-toast to styleguide

* Add b-tooltip to styleguide

* Add used by in descriptions

* Clean up bootstrap vue components

* Clean up style tables

* Add renamed component folders and start using styleguide images module

* Fix imports

* Use global dummy-data mixin for styleguide

* Add grey background wrapper for white buttons

* Move dummy data to portal docs

* chore: rename "dummy" data to "sample" data

* clean up

* Link and clean up used by components lists

* Extend the typography table with responsive styles and example use cases

* chore: kebab-case props

---------

Co-authored-by: Richard Doe <[email protected]>
  • Loading branch information
LeoniePeters and rwd authored Jan 12, 2024
1 parent f9b1d12 commit a71bc67
Show file tree
Hide file tree
Showing 31 changed files with 1,223 additions and 240 deletions.
15 changes: 15 additions & 0 deletions packages/portal/docs/sample-data.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions packages/portal/docs/style/BootstrapVue/Alert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Customised BootstrapVue alert component.

Docs including more features and variants: https://bootstrap-vue.org/docs/components/alert

Used by:
- AlertMessage
- [InfoMessage](/#/Components/Generic?id=infomessage)
- SearchFilters (Newspaper/WWI api filter alert)

```jsx
<b-alert show dismissible class="mb-4">
This is a default info variant alert and it is configured to be dismissible
</b-alert>
<b-alert
show
variant="dark"
>
This is a dark variant alert and it is configured to not be dismissible
</b-alert>
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Customised BootstrapVue badge component. AKA 'pill', 'chip' or 'tag'
Customised BootstrapVue badge component. AKA 'pill', 'chip' or 'tag'.

Docs: https://bootstrap-vue.org/docs/components/badge

Used by:
- LinkBadge
- [RelatedCategoryTags](/#/Components/Related?id=relatedcategorytags)

Variant "secondary": regular, pill<br>
*Used as default*
```jsx
Expand All @@ -26,7 +30,7 @@ Variant "secondary": regular, pill<br>
class="img-chip"
>
<b-img
src="https://api.europeana.eu/api/v2/thumbnail-by-url.json?uri=http%3A%2F%2Fcc.museon.nl%2Fimageproxy.aspx%3Fserver%3Dlocalhost%26port%3D17512%26filename%3Dimages%2Fscreen2%2F116201a.jpg&type=IMAGE&size=w200"
:src="thumbnails[1]"
rounded="circle"
class="mr-2"
/>
Expand Down Expand Up @@ -70,7 +74,7 @@ Variant "primary":
class="img-chip"
>
<b-img
src="https://api.europeana.eu/api/v2/thumbnail-by-url.json?uri=http%3A%2F%2Fcc.museon.nl%2Fimageproxy.aspx%3Fserver%3Dlocalhost%26port%3D17512%26filename%3Dimages%2Fscreen2%2F116201a.jpg&type=IMAGE&size=w200"
:src="thumbnails[2]"
rounded="circle"
class="mr-2"
/>
Expand Down Expand Up @@ -114,7 +118,7 @@ Variant "outline-primary":
class="img-chip"
>
<b-img
src="https://api.europeana.eu/api/v2/thumbnail-by-url.json?uri=http%3A%2F%2Fcc.museon.nl%2Fimageproxy.aspx%3Fserver%3Dlocalhost%26port%3D17512%26filename%3Dimages%2Fscreen2%2F116201a.jpg&type=IMAGE&size=w200"
:src="thumbnails[3]"
rounded="circle"
class="mr-2"
/>
Expand Down Expand Up @@ -159,7 +163,7 @@ Variant "primary-light":
class="img-chip"
>
<b-img
src="https://api.europeana.eu/api/v2/thumbnail-by-url.json?uri=http%3A%2F%2Fcc.museon.nl%2Fimageproxy.aspx%3Fserver%3Dlocalhost%26port%3D17512%26filename%3Dimages%2Fscreen2%2F116201a.jpg&type=IMAGE&size=w200"
:src="thumbnails[4]"
rounded="circle"
class="mr-2"
/>
Expand Down Expand Up @@ -204,7 +208,7 @@ Variant "light":
class="img-chip"
>
<b-img
src="https://api.europeana.eu/api/v2/thumbnail-by-url.json?uri=http%3A%2F%2Fcc.museon.nl%2Fimageproxy.aspx%3Fserver%3Dlocalhost%26port%3D17512%26filename%3Dimages%2Fscreen2%2F116201a.jpg&type=IMAGE&size=w200"
:src="thumbnails[5]"
rounded="circle"
class="mr-2"
/>
Expand Down
20 changes: 20 additions & 0 deletions packages/portal/docs/style/BootstrapVue/Breadcrumb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Customised BootstrapVue breadcrumb component.

Docs: https://bootstrap-vue.org/docs/components/breadcrumb

Used by:
- default layout (only populated by blog and exhibitions)

```jsx
<div style="margin-left: -16px; margin-right: -16px;">
<b-breadcrumb
:items="[{ text: 'Main page',
to: '#' },
{ text: 'Sub page',
to: '#' },
{ text: 'Sub page',
active: true
}]"
/>
</div>
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
### Button

Customised BootstrapVue Button component.

Docs: https://bootstrap-vue.org/docs/components/button
Expand Down Expand Up @@ -229,38 +227,40 @@ Variant "link":
Variant "light":
```jsx
<b-container>
<b-button
variant="light"
>
label
</b-button>
<div style="background-color: #ededed; margin: -16px; padding: 16px;">
<b-button
variant="light"
class="d-inline-flex align-items-center"
>
<span class="icon-pinterest d-inline-flex pr-1" />
label
</b-button>
<b-button
variant="light"
class="d-inline-flex align-items-center"
>
label
<span class="icon-pinterest d-inline-flex pl-1" />
</b-button>
<b-button
variant="light"
class="d-inline-flex align-items-center"
aria-label="label for textless button"
>
<span class="icon-pinterest" />
</b-button>
<b-button
variant="light"
disabled
>
label
</b-button>
variant="light"
>
label
</b-button>
<b-button
variant="light"
class="d-inline-flex align-items-center"
>
<span class="icon-pinterest d-inline-flex pr-1" />
label
</b-button>
<b-button
variant="light"
class="d-inline-flex align-items-center"
>
label
<span class="icon-pinterest d-inline-flex pl-1" />
</b-button>
<b-button
variant="light"
class="d-inline-flex align-items-center"
aria-label="label for textless button"
>
<span class="icon-pinterest" />
</b-button>
<b-button
variant="light"
disabled
>
label
</b-button>
</div>
</b-container>
```

Expand Down Expand Up @@ -369,28 +369,36 @@ Variant "overlay"<br>
<b-container>
<b-button
variant="overlay"
class="p-3 mb-3 mr-3"
>
<span>Label</span>
<span>Label overlay button without image</span>
</b-button>
<b-button
variant="overlay"
style='background-image: url("https://api.europeana.eu/thumbnail/v2/url.json?size=w400&type=IMAGE&uri=https%3A%2F%2Fwww.rijksmuseum.nl%2Fassetimage2.jsp%3Fid%3DSK-C-214");'
class="w-100 text-left"
:style="`background-image: url(${thumbnails[10]});`"
class="p-3 mb-3 text-left"
>
<span>Label: add to gallery</span>
<span>Label overlay button with image</span>
</b-button>
</b-container>
```

Variant "outline-overlay"<br>
*Used in the themes swiper*
```jsx
<b-container>
<div style='margin: -16px; padding: 16px; background-image: url("https://api.europeana.eu/thumbnail/v2/url.json?size=w400&type=IMAGE&uri=https%3A%2F%2Fwww.rijksmuseum.nl%2Fassetimage2.jsp%3Fid%3DSK-C-214");'>
<b-container class="d-flex flex-wrap">
<div class="mr-3 mb-3" :style="`{ margin: -16px; padding: 32px; background-color: #000; }`">
<b-button
variant="outline-overlay"
>
<span>Label no image</span>
</b-button>
</div>
<div class="mr-3 mb-3" :style="`{ margin: -16px; padding: 32px; background-image: url(${thumbnails[3]}); background-size: cover; }`">
<b-button
variant="outline-overlay"
>
<span>Label</span>
<span>Label with image</span>
</b-button>
</div>
</b-container>
Expand Down
99 changes: 99 additions & 0 deletions packages/portal/docs/style/BootstrapVue/Card.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
Customised BootstrapVue card component. Currently it is not directly used as in the examples, but could be and forms the base of other card components.

Docs: https://bootstrap-vue.org/docs/components/card

Used by:
- [ContentCard](/#/Components/Content?id=contentcard)
- [EntityHeader](/#/Components/Entity?id=entityheader)
- [InfoCard](/#/Components/Generic?id=infocard)
- [ItemPreviewCard](/#/Components/Item?id=itempreviewcard)
- MetadataBox
- RelatedCollectionsCard
- [RelatedEditorial](/#/Components/Related?id=relatededitorial)
- RelatedGalleries
- [UserCreateSetButton](/#/Components/User?id=usercreatesetbutton)

With top image, header, footer, title, subtitle, text and links
```jsx
<b-card-group
class="card-deck-3-cols align-items-start"
deck
>
<b-card
:img-src="thumbnails[6]"
title="Card title default to h4"
style="flex: 0 0 18rem;"
class="mb-4"
no-body
>
<template #header>
<h4 class="mb-0">This is a header</h4>
</template>
<b-card-body>
<b-card-text>
Card text. Besides text it is possible to insert any kind of element: buttons, links, lists etc.
</b-card-text>
<a href="#" class="card-link">Card link</a>
<a href="#" class="card-link">Another link</a>
</b-card-body>
<b-card-footer>This is a footer</b-card-footer>
</b-card>
<b-card
:img-src="thumbnails[6]"
title="Card title default to h4"
sub-title="Card subtitle default to h6"
style="flex: 0 0 18rem;"
class="mb-4"
>
<b-card-text>
Card text. Besides text it is possible to insert any kind of element to the body: buttons, links, lists etc.
</b-card-text>
</b-card>
<b-card
title="Card without image"
sub-title="Card subtitle default to h6"
style="flex: 0 0 18rem;"
class="mb-4"
>
<b-card-text>
Card text. Besides text it is possible to insert any kind of element to the body: buttons, links, lists etc.
</b-card-text>
</b-card>
<b-card
:img-src="thumbnails[6]"
img-bottom
title="Card with bottom image"
sub-title="Card subtitle default to h6"
style="flex: 0 0 18rem;"
class="mb-4"
>
<b-card-text>
Card text. Besides text it is possible to insert any kind of element to the body: buttons, links, lists etc.
</b-card-text>
</b-card>
<b-card
:img-src="thumbnails[6]"
img-left
title="Card with left image"
sub-title="Card subtitle default to h6"
style="flex: 0 0 90%;"
class="mb-4"
>
<b-card-text>
Card text. Besides text it is possible to insert any kind of element to the body: buttons, links, lists etc.
</b-card-text>
</b-card>
<b-card
:img-src="thumbnails[6]"
img-right
title="Card with right image"
sub-title="Card subtitle default to h6"
style="flex: 0 0 90%;"
class="mb-4"
>
<b-card-text>
Card text. Besides text it is possible to insert any kind of element to the body: buttons, links, lists etc.
</b-card-text>
</b-card>
</b-card-group>
```
45 changes: 45 additions & 0 deletions packages/portal/docs/style/BootstrapVue/Dropdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Customised BootstrapVue dropdown component.

Docs: https://bootstrap-vue.org/docs/components/dropdown

Used by:
- ItemLanguageSelector
- LanguageSelector
- [SearchFacetDropdown](/#/Components/Search?id=searchfacetdropdown)
- [SearchQueryRuleDropdown](/#/Components/Search?id=searchquerybuilderruledropdown)

```jsx
<b-dropdown text="Default variant dropdown">
<b-dropdown-item href="#">An item</b-dropdown-item>
<b-dropdown-item href="#">Another item</b-dropdown-item>
</b-dropdown>

<b-dropdown variant="light" text="Light variant dropdown">
<b-dropdown-item href="#">An item</b-dropdown-item>
<b-dropdown-item href="#">Another item</b-dropdown-item>
</b-dropdown>

<b-dropdown variant="link" text="Link variant dropdown">
<b-dropdown-item href="#">An item</b-dropdown-item>
<b-dropdown-item href="#">Another item</b-dropdown-item>
</b-dropdown>

<b-dropdown text="Dropdown with group" class="mt-3">
<b-dropdown-item-button>
Non-grouped Item
</b-dropdown-item-button>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-group id="dropdown-group-1" header="Group 1">
<b-dropdown-item-button>First Grouped item</b-dropdown-item-button>
<b-dropdown-item-button>Second Grouped Item</b-dropdown-item-button>
</b-dropdown-group>
<b-dropdown-group id="dropdown-group-2" header="Group 2">
<b-dropdown-item-button>First Grouped item</b-dropdown-item-button>
<b-dropdown-item-button>Second Grouped Item</b-dropdown-item-button>
</b-dropdown-group>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item-button>
Another Non-grouped Item
</b-dropdown-item-button>
</b-dropdown>
```
Loading

0 comments on commit a71bc67

Please sign in to comment.