@samhermes/alexander 1.1.1 → 1.1.2

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.
package/README.md CHANGED
@@ -11,7 +11,7 @@ Alexander was built in two distinct levels, a base level that includes browser c
11
11
  Install Alexander from GitHub using npm with:
12
12
 
13
13
  ```bash
14
- npm install samhermes/alexander#1.1.1
14
+ npm install @samhermes/alexander
15
15
  ```
16
16
 
17
17
  ## Styles
package/dist/alexander.js CHANGED
@@ -47,8 +47,8 @@ var t = class extends HTMLElement {
47
47
  n.preventDefault(), e.forEach((e) => {
48
48
  e.setAttribute("aria-selected", "false");
49
49
  }), t.setAttribute("aria-selected", "true");
50
- let r = t.getAttribute("aria-controls"), i = tabContainer.querySelector("#" + r.toString());
51
- tabContainer.querySelectorAll("[role=\"tabpanel\"]").forEach((e) => {
50
+ let r = t.getAttribute("aria-controls"), i = this.querySelector("#" + r.toString());
51
+ this.querySelectorAll("[role=\"tabpanel\"]").forEach((e) => {
52
52
  e.setAttribute("aria-hidden", "true");
53
53
  }), i.setAttribute("aria-hidden", "false");
54
54
  });
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Alexander={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=class extends HTMLElement{constructor(){super()}open(e,t){let n=t.content.scrollHeight;t.content.style.height=n+`px`,t.content.addEventListener(`transitionend`,function(){t.content.style.height=`auto`},{once:!0}),e.classList.add(`is-active`)}close(e,t){let n=window.matchMedia(`(prefers-reduced-motion: reduce)`),r=t.content.scrollHeight,i=t.content.style.transition;t.content.style.transition=``,requestAnimationFrame(()=>{t.content.style.height=r+`px`,t.content.style.transition=i,requestAnimationFrame(()=>{t.content.style.height=`0px`})}),n.matches?e.classList.remove(`is-active`):e.addEventListener(`transitionend`,function(){e.classList.remove(`is-active`)},{once:!0})}connectedCallback(){let e={heading:this.querySelector(`.accordion-heading > *`),content:this.querySelector(`.accordion-content`),headingChildren:this.querySelector(`.accordion-heading > *`).innerHTML};this.classList.add(`is-accordion`);let t=document.createElement(`button`),n=Math.random().toString(16).slice(2);t.setAttribute(`type`,`button`),t.setAttribute(`aria-controls`,`accordion-content-`+n),t.setAttribute(`id`,`accordion-button-`+n),t.setAttribute(`aria-expanded`,`false`),t.innerHTML=e.headingChildren,e.heading.innerHTML=``,e.heading.appendChild(t),e.content.setAttribute(`id`,`accordion-content-`+n),e.content.setAttribute(`aria-labelledby`,`accordion-button-`+n),e.content.setAttribute(`role`,`region`),t.addEventListener(`click`,()=>{let n=t.getAttribute(`aria-expanded`);n===`true`?t.setAttribute(`aria-expanded`,`false`):t.setAttribute(`aria-expanded`,`true`),n===`true`?this.close(this,e):this.open(this,e)})}};customElements.define(`alexander-accordion`,t);var n=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.querySelectorAll(`[role="tab"]`);e.forEach(t=>{t.addEventListener(`click`,n=>{n.preventDefault(),e.forEach(e=>{e.setAttribute(`aria-selected`,`false`)}),t.setAttribute(`aria-selected`,`true`);let r=t.getAttribute(`aria-controls`),i=tabContainer.querySelector(`#`+r.toString());tabContainer.querySelectorAll(`[role="tabpanel"]`).forEach(e=>{e.setAttribute(`aria-hidden`,`true`)}),i.setAttribute(`aria-hidden`,`false`)})})}};customElements.define(`alexander-tabs`,n);var r=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.querySelector(`video`),t=document.createElement(`div`),n=document.createElement(`button`),r=document.createElement(`button`);t.classList.add(`video-controls`),n.setAttribute(`type`,`button`),n.innerHTML=`<span class="screen-reader-text">Play</span>`,n.classList.add(`control-play`),n.classList.add(`hidden`),r.setAttribute(`type`,`button`),r.innerHTML=`<span class="screen-reader-text">Pause</span>`,r.classList.add(`control-pause`),t.appendChild(n),t.appendChild(r),e.after(t),n.addEventListener(`click`,()=>{e.play(),n.classList.add(`hidden`),r.classList.remove(`hidden`),r.focus()}),r.addEventListener(`click`,()=>{e.pause(),r.classList.add(`hidden`),n.classList.remove(`hidden`),n.focus()})}};customElements.define(`alexander-video`,r),e.Accordion=t,e.Tabs=n,e.Video=r});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Alexander={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=class extends HTMLElement{constructor(){super()}open(e,t){let n=t.content.scrollHeight;t.content.style.height=n+`px`,t.content.addEventListener(`transitionend`,function(){t.content.style.height=`auto`},{once:!0}),e.classList.add(`is-active`)}close(e,t){let n=window.matchMedia(`(prefers-reduced-motion: reduce)`),r=t.content.scrollHeight,i=t.content.style.transition;t.content.style.transition=``,requestAnimationFrame(()=>{t.content.style.height=r+`px`,t.content.style.transition=i,requestAnimationFrame(()=>{t.content.style.height=`0px`})}),n.matches?e.classList.remove(`is-active`):e.addEventListener(`transitionend`,function(){e.classList.remove(`is-active`)},{once:!0})}connectedCallback(){let e={heading:this.querySelector(`.accordion-heading > *`),content:this.querySelector(`.accordion-content`),headingChildren:this.querySelector(`.accordion-heading > *`).innerHTML};this.classList.add(`is-accordion`);let t=document.createElement(`button`),n=Math.random().toString(16).slice(2);t.setAttribute(`type`,`button`),t.setAttribute(`aria-controls`,`accordion-content-`+n),t.setAttribute(`id`,`accordion-button-`+n),t.setAttribute(`aria-expanded`,`false`),t.innerHTML=e.headingChildren,e.heading.innerHTML=``,e.heading.appendChild(t),e.content.setAttribute(`id`,`accordion-content-`+n),e.content.setAttribute(`aria-labelledby`,`accordion-button-`+n),e.content.setAttribute(`role`,`region`),t.addEventListener(`click`,()=>{let n=t.getAttribute(`aria-expanded`);n===`true`?t.setAttribute(`aria-expanded`,`false`):t.setAttribute(`aria-expanded`,`true`),n===`true`?this.close(this,e):this.open(this,e)})}};customElements.define(`alexander-accordion`,t);var n=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.querySelectorAll(`[role="tab"]`);e.forEach(t=>{t.addEventListener(`click`,n=>{n.preventDefault(),e.forEach(e=>{e.setAttribute(`aria-selected`,`false`)}),t.setAttribute(`aria-selected`,`true`);let r=t.getAttribute(`aria-controls`),i=this.querySelector(`#`+r.toString());this.querySelectorAll(`[role="tabpanel"]`).forEach(e=>{e.setAttribute(`aria-hidden`,`true`)}),i.setAttribute(`aria-hidden`,`false`)})})}};customElements.define(`alexander-tabs`,n);var r=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.querySelector(`video`),t=document.createElement(`div`),n=document.createElement(`button`),r=document.createElement(`button`);t.classList.add(`video-controls`),n.setAttribute(`type`,`button`),n.innerHTML=`<span class="screen-reader-text">Play</span>`,n.classList.add(`control-play`),n.classList.add(`hidden`),r.setAttribute(`type`,`button`),r.innerHTML=`<span class="screen-reader-text">Pause</span>`,r.classList.add(`control-pause`),t.appendChild(n),t.appendChild(r),e.after(t),n.addEventListener(`click`,()=>{e.play(),n.classList.add(`hidden`),r.classList.remove(`hidden`),r.focus()}),r.addEventListener(`click`,()=>{e.pause(),r.classList.add(`hidden`),n.classList.remove(`hidden`),n.focus()})}};customElements.define(`alexander-video`,r),e.Accordion=t,e.Tabs=n,e.Video=r});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samhermes/alexander",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Front-End Starter Kit",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,9 +21,9 @@ caption {
21
21
  // 3. Fix alignment for Safari
22
22
 
23
23
  th {
24
- font-weight: 600; // 1
25
- text-align: inherit; // 2
26
- text-align: -webkit-match-parent; // 3
24
+ font-weight: 600; // 1
25
+ text-align: inherit; // 2
26
+ text-align: -webkit-match-parent; // 3
27
27
  }
28
28
 
29
29
  thead,
@@ -32,7 +32,7 @@ tfoot,
32
32
  tr,
33
33
  td,
34
34
  th {
35
- border-color: inherit;
36
- border-style: solid;
37
- border-width: 0;
35
+ border-color: inherit;
36
+ border-style: solid;
37
+ border-width: 0;
38
38
  }