Skip to content

Commit

Permalink
feat: pagination component (#261)
Browse files Browse the repository at this point in the history
* feat(pagination): complete pagination functionality

* fix(pagination): fix attribute names

* fix(pagination): change paginate function logic

* docs: add pagination stories

* refactor(pagination): button events

* test: add pagination tests

* test(pagination): revert icon changes

* test: mocking strategy of bl-icon is improved

* test(pagination): complete tests for select helper

* docs: select helper docs for pagination

* fix(pagination): setting page on select changes

* fix(pagination): implement review finding

* feat(select): hide remove icon button on single selection

* fix(pagination): update button variants

Co-authored-by: Murat Çorlu <[email protected]>
  • Loading branch information
olkeoguz and muratcorlu authored Oct 6, 2022
1 parent b3e2a1e commit 43b0692
Show file tree
Hide file tree
Showing 14 changed files with 825 additions and 123 deletions.
3 changes: 2 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = {
'progress-indicator',
'checkbox',
'alert',
'select'
'select',
'pagination'
],
],
},
Expand Down
150 changes: 64 additions & 86 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"@web/dev-server-esbuild": "0.2.16",
"@web/dev-server-import-maps": "^0.0.7",
"@web/dev-server-rollup": "^0.3.17",
"@web/test-runner": "^0.13.15",
"@web/test-runner-playwright": "^0.8.6",
Expand Down
1 change: 1 addition & 0 deletions src/baklava.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export { default as BlCheckbox } from './components/checkbox/bl-checkbox';
export { default as BlAlert } from './components/alert/bl-alert';
export { default as BlSelect } from './components/select/bl-select';
export { default as BlSelectOption } from './components/select/option/bl-select-option';
export { default as BlPagination } from './components/pagination/bl-pagination';
export { getIconPath, setIconPath } from './utilities/asset-paths';
4 changes: 4 additions & 0 deletions src/components/button/bl-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
text-decoration: none;
}

:host([variant='tertiary'][disabled]) .button {
--main-color:transparent;
}

:host([variant='secondary']:hover:not([disabled])) .button {
--content-color: var(--bl-color-primary-background);
--bg-color: var(--main-hover-color);
Expand Down
12 changes: 10 additions & 2 deletions src/components/button/bl-button.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,18 @@ If button has a limited width and a long text that can not fit in a single line,

## Disabled Buttons

Disable version of all buttons is the same.
We have 2 types of disabled buttons: Disable version of Primary and Secondary buttons is the same.

<Canvas columns={1}>
<Story name="Disabled Buttons" args={{ disabled: true, content: 'Passive Button' }}>
<Story name="Disabled Primary and Secondary Buttons" args={{ disabled: true, content: 'Passive Button' }}>
{SizesTemplate.bind({})}
</Story>
</Canvas>

Whereas Tertiary buttons keep their transparent backgrounds.

<Canvas columns={1}>
<Story name="Disabled Tertiary Buttons" args={{ disabled: true, content: 'Passive Button',variant:"tertiary" }}>
{SizesTemplate.bind({})}
</Story>
</Canvas>
Expand Down
65 changes: 65 additions & 0 deletions src/components/pagination/bl-pagination.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
:host {
width: max-content;
}

.pagination {
display: flex;
}

.pagination * {
margin: 0;
padding: 0;
box-sizing: border-box;
}

.page-container {
display: flex;
align-items: center;
}

.page-list {
display: flex;
align-items: center;
list-style: none;
user-select: none;
}

.dots {
margin:0 var(--bl-size-2xs);
}

.dots::before {
content: ' \B7 \B7 \B7';
color: var(--bl-color-secondary);
}

.pagination-helpers {
display: flex;
align-items: center;
margin-right: var(--bl-size-s);
gap: var(--bl-size-m);
}

.jumper,
.select {
display: flex;
align-items: center;
gap: var(--bl-size-2xs);
}

label {
font: var(--bl-font-title-3-medium);
font-size: var(--bl-font-size-m);
font-weight: var(--bl-font-weight-medium);
line-height: var(--bl-font-size-m);
letter-spacing: 0;
user-select: none;
}

bl-input {
width: 62px;
}

bl-select {
width:128px;
}
Loading

0 comments on commit 43b0692

Please sign in to comment.