@ucd-lib/theme-elements 3.3.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { LitElement, html } from 'lit';
2
- //import { Page } from 'puppeteer';
2
+ import {ifDefined} from 'lit/directives/if-defined.js';
3
3
  import {render, styles} from "./ucd-theme-pagination.tpl.js";
4
4
 
5
5
  import { BreakPointsController } from '../../utils/controllers';
@@ -160,8 +160,8 @@ export default class UcdThemePagination extends LitElement {
160
160
  if( !this.basePath && !this.useHash ) {
161
161
  return html `<li class="pager__item ${args.class || ''}">
162
162
  ${((this.currentPage == 1 && args.label == "Prev") || (this.currentPage == this.maxPages && args.label == "Next") ) ?
163
- html`<a style="pointer-events: none; cursor: default; color: ${this.darkmode ? '#cccccc' : '#999999'}; background: ${this.darkmode ? 'transparent' : 'white'}" tabindex="1" @click="${this._onPageClicked}" page="${page}">${args.label || page}</a>`:
164
- html`<a style="cursor:pointer;" tabindex="1" @click="${this._onPageClicked}" page="${page}">${args.label || page}</a>`
163
+ html`<button disabled style="cursor: default; color: ${this.darkmode ? '#cccccc' : '#999999'}; background: ${this.darkmode ? 'transparent' : 'white'}" page="${page}">${args.label || page}</button>`:
164
+ html`<a style="cursor:pointer;" tabindex="1" @click="${this._onPageClicked}" page="${page}" aria-label="${ifDefined(args.label === '...' ? 'More pages' : undefined)}">${args.label || page}</a>`
165
165
  }
166
166
  </li>`;
167
167
  }
@@ -169,8 +169,8 @@ export default class UcdThemePagination extends LitElement {
169
169
  let href = (this.useHash ? '#' : '') + (this.basePath || '/') + page + (this.queryParams ? '?' + this.queryParams : '');
170
170
  return html`<li class="pager__item ${args.class || ''}">
171
171
  ${((this.currentPage == 1 && args.label == "Prev") || (this.currentPage == this.maxPages && args.label == "Next") ) ?
172
- html` <a style="pointer-events: none; cursor: default; color: ${this.darkmode ? '#cccccc' : '#999999'}; background: ${this.darkmode ? 'transparent' : 'white'};" href="${href}">${args.label || page}</a>`:
173
- html` <a href="${href}">${args.label || page}</a>`
172
+ html` <button disabled style="cursor: default; color: ${this.darkmode ? '#cccccc' : '#999999'}; background: ${this.darkmode ? 'transparent' : 'white'};" href="${href}">${args.label || page}</button>`:
173
+ html` <a href="${href}" aria-label="${ifDefined(args.label === '...' ? 'More pages' : undefined)}">${args.label || page}</a>`
174
174
  }
175
175
  </li>`;
176
176
  }
@@ -62,6 +62,30 @@ export function styles() {
62
62
  .pager__item--next.pager__item--current.darkmode:hover a {
63
63
  color: #cccccc !important;
64
64
  }
65
+ .pager__item button {
66
+ all: unset;
67
+ cursor: pointer;
68
+ display: inline-flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ min-width: 2rem;
72
+ padding: 0.25rem 0.5rem;
73
+ color: rgb(76, 76, 76);
74
+ text-decoration: none;
75
+ transition: 0.2s ease-in-out;
76
+ }
77
+ .pager__item--previous button::before {
78
+ margin-right: 0.5rem;
79
+ content: '\\f30a';
80
+ font-family: "Font Awesome 5 Free";
81
+ font-weight: 900;
82
+ }
83
+ .pager__item--next button::after {
84
+ margin-left: 0.5rem;
85
+ content: '\\f30b';
86
+ font-family: "Font Awesome 5 Free";
87
+ font-weight: 900;
88
+ }
65
89
  `;
66
90
 
67
91
  return [normalizeCss, resetCss, paginationCss, elementStyles];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucd-lib/theme-elements",
3
- "version": "3.3.2",
3
+ "version": "3.4.0",
4
4
  "description": "Custom elements for the UCD brand theme",
5
5
  "main": "index.js",
6
6
  "scripts": {