-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(unstable-pagination): add refactored experimental pagination com…
…ponent (#5485) * feat(unstable_pagination): initial commit of js, scss, and story demo * fix(unstable-pagination): update naming structure * fix(unstable-pagination): add styles for refactored component * fix(unstable-pagination): update imports * fix(unstable-pagination): flatten styles * fix(unstable-pagination): update class names * fix(unstable-pagination): update comments and formatting * chore: run prettier * chore: update exports snapshot * feat(unstable-pagination): remove page-input subcomponent * fix(pagination): remove page-input styles * fix: remove page input from api snapshot * fix(unstable-pagination): update left and right section height * test(api): update public api snapshot to include new components * fix(unstable-pagination): adjust btn focus outlines * fix(unstable-pagination): update select hover state, update borders Co-authored-by: TJ Egan <[email protected]>
- Loading branch information
Showing
10 changed files
with
793 additions
and
0 deletions.
There are no files selected for viewing
177 changes: 177 additions & 0 deletions
177
packages/components/src/components/pagination/_unstable_pagination.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
// | ||
// Copyright IBM Corp. 2016, 2020 | ||
// | ||
// This source code is licensed under the Apache-2.0 license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
// | ||
|
||
$css--helpers: true; | ||
|
||
@import '../../globals/scss/vars'; | ||
@import '../../globals/scss/helper-mixins'; | ||
@import '../../globals/scss/typography'; | ||
@import '../../globals/scss/layout'; | ||
@import '../../globals/scss/css--helpers'; | ||
@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once'; | ||
@import '../select/select'; | ||
|
||
/// Unstable pagination styles | ||
/// @access private | ||
/// @group pagination | ||
@mixin unstable_pagination { | ||
.#{$prefix}--unstable-pagination { | ||
@include reset; | ||
@include carbon--type-style('body-short-01'); | ||
width: 100%; | ||
background-color: $ui-01; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
border-top: 1px solid $ui-03; | ||
border-bottom: 1px solid transparent; | ||
height: rem(48px); | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__text { | ||
@include carbon--breakpoint('md') { | ||
display: inline-block; | ||
} | ||
|
||
margin: 0 $carbon--spacing-05; | ||
color: $text-02; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__left, | ||
.#{$prefix}--unstable-pagination__right { | ||
display: flex; | ||
height: 100%; | ||
align-items: center; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__left { | ||
padding: 0 $carbon--spacing-05 0 0; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__left > .#{$prefix}--form-item, | ||
.#{$prefix}--unstable-pagination__right > .#{$prefix}--form-item { | ||
height: 100%; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__left | ||
.#{$prefix}--unstable-pagination__text { | ||
margin-right: rem(1px); | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__right | ||
.#{$prefix}--unstable-pagination__text { | ||
margin-right: $carbon--spacing-05; | ||
margin-left: rem(1px); | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__button { | ||
@include reset; | ||
border: none; | ||
border-left: 1px solid $ui-03; | ||
background: none; | ||
cursor: pointer; | ||
height: 100%; | ||
margin: 0; | ||
padding: 0 rem(14px); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
color: $ui-05; // for currentColor | ||
fill: $ui-05; | ||
transition: outline $duration--fast-02 motion(standard, productive); | ||
transition: background-color $duration--fast-02 motion(standard, productive); | ||
} | ||
|
||
// Unset height/width set by icon-only button: | ||
.#{$prefix}--unstable-pagination__button .#{$prefix}--btn__icon { | ||
height: unset; | ||
width: unset; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__button.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger:focus { | ||
@include focus-outline('outline'); | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__button:hover { | ||
background: $hover-ui; | ||
color: $ui-05; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__button--no-index { | ||
fill: $disabled-02; | ||
cursor: not-allowed; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__button.#{$prefix}--btn:disabled { | ||
background: transparent; | ||
border-color: $ui-03; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__button:disabled:hover, | ||
.#{$prefix}--unstable-pagination__button--no-index:hover { | ||
cursor: not-allowed; | ||
fill: $disabled-02; | ||
background: transparent; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__page-selector, | ||
.#{$prefix}--unstable-pagination__page-sizer { | ||
height: 100%; | ||
align-items: center; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__page-selector | ||
.#{$prefix}--select-input--inline__wrapper, | ||
.#{$prefix}--unstable-pagination__page-sizer | ||
.#{$prefix}--select-input--inline__wrapper { | ||
display: flex; | ||
height: 100%; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__page-selector .#{$prefix}--select-input, | ||
.#{$prefix}--unstable-pagination__page-sizer .#{$prefix}--select-input { | ||
@include carbon--type-style('body-short-01'); | ||
width: auto; | ||
min-width: auto; | ||
height: 100%; | ||
padding: 0 $carbon--spacing-08 0 $carbon--spacing-05; | ||
margin-right: -0.65rem; | ||
|
||
@include carbon--breakpoint('md') { | ||
padding-right: carbon--mini-units(4.5); | ||
margin-right: 0; | ||
} | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__page-selector | ||
.#{$prefix}--select-input:hover, | ||
.#{$prefix}--unstable-pagination__page-sizer .#{$prefix}--select-input:hover { | ||
background: $hover-ui; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__page-selector .#{$prefix}--select__arrow, | ||
.#{$prefix}--unstable-pagination__page-sizer .#{$prefix}--select__arrow { | ||
top: 50%; | ||
transform: translateY(-50%); | ||
|
||
@include carbon--breakpoint('md') { | ||
right: $carbon--spacing-05; | ||
} | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__page-selector { | ||
border-left: 1px solid $ui-03; | ||
} | ||
|
||
.#{$prefix}--unstable-pagination__page-sizer { | ||
border-right: 1px solid $ui-03; | ||
} | ||
} | ||
|
||
@include exports('unstable_pagination') { | ||
@include unstable_pagination; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.