Skip to content

Commit

Permalink
fix(pagination): add classes for better testing
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonailea committed Jun 18, 2024
1 parent 6929b4c commit c1e7945
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
18 changes: 18 additions & 0 deletions packages/calcite-components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4562,6 +4562,10 @@ export namespace Components {
* Accessible name for the dropdown menu.
*/
"dropdownLabel": string;
/**
* Defines the available placements that can be used when a flip occurs.
*/
"flipPlacements": FlipPlacement[];
/**
* Specifies the kind of the component, which will apply to border and background, if applicable.
*/
Expand All @@ -4574,6 +4578,11 @@ export namespace Components {
* Determines the type of positioning to use for the overlaid content. Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout. `"fixed"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
*/
"overlayPositioning": OverlayPositioning;
/**
* Determines where the component will be positioned relative to the container element.
* @default "bottom-end"
*/
"placement": MenuPlacement;
/**
* Specifies an icon to display at the end of the primary button.
*/
Expand Down Expand Up @@ -12509,6 +12518,10 @@ declare namespace LocalJSX {
* Accessible name for the dropdown menu.
*/
"dropdownLabel"?: string;
/**
* Defines the available placements that can be used when a flip occurs.
*/
"flipPlacements"?: FlipPlacement[];
/**
* Specifies the kind of the component, which will apply to border and background, if applicable.
*/
Expand All @@ -12529,6 +12542,11 @@ declare namespace LocalJSX {
* Determines the type of positioning to use for the overlaid content. Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout. `"fixed"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
*/
"overlayPositioning"?: OverlayPositioning;
/**
* Determines where the component will be positioned relative to the container element.
* @default "bottom-end"
*/
"placement"?: MenuPlacement;
/**
* Specifies an icon to display at the end of the primary button.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@
--calcite-pagination-arrow-background-color,
var(--calcite-pagination-item-background-color, transparent)
);
color: var(--calcite-pagination-item-text-color, var(--calcite-color-text-3));
color: var(
--calcite-pagination-arrow-icon-color,
var(--calcite-pagination-item-text-color, var(--calcite-color-text-3))
);
&:hover {
background-color: var(--calcite-pagination-arrow-background-color-hover);
color: var(--calcite-pagination-arrow-icon-color-hover, var(--calcite-color-brand));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,19 @@ export class Pagination
render(): VNode {
return (
<ul class={CSS.list}>
<li class={CSS.listItem}>{this.renderFirstChevron()}</li>
<li class={CSS.listItem}>{this.renderPreviousChevron()}</li>
<li class={{ [CSS.listItem]: true, [CSS.chevronFirst]: true }}>
{this.renderFirstChevron()}
</li>
<li class={{ [CSS.listItem]: true, [CSS.chevronPrevious]: true }}>
{this.renderPreviousChevron()}
</li>
{this.renderItems()}
<li class={CSS.listItem}>{this.renderNextChevron()}</li>
<li class={CSS.listItem}>{this.renderLastChevron()}</li>
<li class={{ [CSS.listItem]: true, [CSS.chevronNext]: true }}>
{this.renderNextChevron()}
</li>
<li class={{ [CSS.listItem]: true, [CSS.chevronLast]: true }}>
{this.renderLastChevron()}
</li>
</ul>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ export const CSS = {
page: "page",
selected: "selected",
chevron: "chevron",
chevronFirst: "chevron--first",
chevronPrevious: "chevron--previous",
chevronNext: "chevron--next",
chevronLast: "chevron--last",
disabled: "disabled",
ellipsis: "ellipsis",
};
Expand Down

0 comments on commit c1e7945

Please sign in to comment.