@u-elements/u-tabs 0.0.11 → 0.0.12

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/dist/u-tabs.cjs CHANGED
@@ -76,7 +76,7 @@ var declarativeShadowRoot = (style, slot = "<slot></slot>") => `<template shadow
76
76
  var UHTMLTabsStyle = DISPLAY_BLOCK;
77
77
  var UHTMLTabListStyle = DISPLAY_BLOCK;
78
78
  var UHTMLTabPanelStyle = DISPLAY_BLOCK;
79
- var UHTMLTabStyle = ":host(:not([hidden])) { cursor: pointer; display: inline-block }";
79
+ var UHTMLTabStyle = ':host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled="true"]) { cursor: default }';
80
80
  var UHTMLTabsShadowRoot = declarativeShadowRoot(UHTMLTabsStyle);
81
81
  var UHTMLTabListShadowRoot = declarativeShadowRoot(UHTMLTabListStyle);
82
82
  var UHTMLTabShadowRoot = declarativeShadowRoot(UHTMLTabStyle);
@@ -86,7 +86,7 @@ var ARIA_SELECTED = "aria-selected";
86
86
  var UHTMLTabsElement = class extends UHTMLElement {
87
87
  constructor() {
88
88
  super();
89
- if (!this.shadowRoot) attachStyle(this, UHTMLTabsStyle);
89
+ attachStyle(this, UHTMLTabsStyle);
90
90
  }
91
91
  get tabList() {
92
92
  return queryWithoutNested("u-tablist", this)[0] || null;
@@ -107,7 +107,7 @@ var UHTMLTabsElement = class extends UHTMLElement {
107
107
  var UHTMLTabListElement = class extends UHTMLElement {
108
108
  constructor() {
109
109
  super();
110
- if (!this.shadowRoot) attachStyle(this, UHTMLTabListStyle);
110
+ attachStyle(this, UHTMLTabListStyle);
111
111
  }
112
112
  connectedCallback() {
113
113
  attr(this, "role", "tablist");
@@ -170,7 +170,7 @@ var UHTMLTabElement = class extends UHTMLElement {
170
170
  }
171
171
  constructor() {
172
172
  super();
173
- if (!this.shadowRoot) attachStyle(this, UHTMLTabStyle);
173
+ attachStyle(this, UHTMLTabStyle);
174
174
  }
175
175
  connectedCallback() {
176
176
  attr(this, "role", "tab");
@@ -222,7 +222,7 @@ var UHTMLTabPanelElement = class extends UHTMLElement {
222
222
  }
223
223
  constructor() {
224
224
  super();
225
- if (!this.shadowRoot) attachStyle(this, UHTMLTabPanelStyle);
225
+ attachStyle(this, UHTMLTabPanelStyle);
226
226
  }
227
227
  connectedCallback() {
228
228
  attr(this, "role", "tabpanel");
@@ -249,7 +249,7 @@ var getPanel = (tab, panel) => {
249
249
  return (el == null ? void 0 : el.nodeName) === "U-TABPANEL" ? el : null;
250
250
  };
251
251
  var getSelectedIndex = (tabs) => [...tabs].findIndex((tab) => attr(tab, ARIA_SELECTED) === "true");
252
- var setSelected = (tab) => tab && attr(tab, "aria-selected", "true");
252
+ var setSelected = (tab) => tab && attr(tab, "aria-disabled") !== "true" && attr(tab, "aria-selected", "true");
253
253
  var isFocusable = (el) => el instanceof Element && !el.matches(':disabled,[tabindex^="-"]') && el.matches(
254
254
  `[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe`
255
255
  );
package/dist/u-tabs.d.cts CHANGED
@@ -14,7 +14,7 @@ declare global {
14
14
  declare const UHTMLTabsStyle = ":host(:not([hidden])) { display: block }";
15
15
  declare const UHTMLTabListStyle = ":host(:not([hidden])) { display: block }";
16
16
  declare const UHTMLTabPanelStyle = ":host(:not([hidden])) { display: block }";
17
- declare const UHTMLTabStyle = ":host(:not([hidden])) { cursor: pointer; display: inline-block }";
17
+ declare const UHTMLTabStyle = ":host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled=\"true\"]) { cursor: default }";
18
18
  declare const UHTMLTabsShadowRoot: string;
19
19
  declare const UHTMLTabListShadowRoot: string;
20
20
  declare const UHTMLTabShadowRoot: string;
package/dist/u-tabs.d.ts CHANGED
@@ -14,7 +14,7 @@ declare global {
14
14
  declare const UHTMLTabsStyle = ":host(:not([hidden])) { display: block }";
15
15
  declare const UHTMLTabListStyle = ":host(:not([hidden])) { display: block }";
16
16
  declare const UHTMLTabPanelStyle = ":host(:not([hidden])) { display: block }";
17
- declare const UHTMLTabStyle = ":host(:not([hidden])) { cursor: pointer; display: inline-block }";
17
+ declare const UHTMLTabStyle = ":host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled=\"true\"]) { cursor: default }";
18
18
  declare const UHTMLTabsShadowRoot: string;
19
19
  declare const UHTMLTabListShadowRoot: string;
20
20
  declare const UHTMLTabShadowRoot: string;
package/dist/u-tabs.js CHANGED
@@ -74,7 +74,7 @@ var declarativeShadowRoot = (style, slot = "<slot></slot>") => `<template shadow
74
74
  var UHTMLTabsStyle = DISPLAY_BLOCK;
75
75
  var UHTMLTabListStyle = DISPLAY_BLOCK;
76
76
  var UHTMLTabPanelStyle = DISPLAY_BLOCK;
77
- var UHTMLTabStyle = ":host(:not([hidden])) { cursor: pointer; display: inline-block }";
77
+ var UHTMLTabStyle = ':host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled="true"]) { cursor: default }';
78
78
  var UHTMLTabsShadowRoot = declarativeShadowRoot(UHTMLTabsStyle);
79
79
  var UHTMLTabListShadowRoot = declarativeShadowRoot(UHTMLTabListStyle);
80
80
  var UHTMLTabShadowRoot = declarativeShadowRoot(UHTMLTabStyle);
@@ -84,7 +84,7 @@ var ARIA_SELECTED = "aria-selected";
84
84
  var UHTMLTabsElement = class extends UHTMLElement {
85
85
  constructor() {
86
86
  super();
87
- if (!this.shadowRoot) attachStyle(this, UHTMLTabsStyle);
87
+ attachStyle(this, UHTMLTabsStyle);
88
88
  }
89
89
  get tabList() {
90
90
  return queryWithoutNested("u-tablist", this)[0] || null;
@@ -105,7 +105,7 @@ var UHTMLTabsElement = class extends UHTMLElement {
105
105
  var UHTMLTabListElement = class extends UHTMLElement {
106
106
  constructor() {
107
107
  super();
108
- if (!this.shadowRoot) attachStyle(this, UHTMLTabListStyle);
108
+ attachStyle(this, UHTMLTabListStyle);
109
109
  }
110
110
  connectedCallback() {
111
111
  attr(this, "role", "tablist");
@@ -168,7 +168,7 @@ var UHTMLTabElement = class extends UHTMLElement {
168
168
  }
169
169
  constructor() {
170
170
  super();
171
- if (!this.shadowRoot) attachStyle(this, UHTMLTabStyle);
171
+ attachStyle(this, UHTMLTabStyle);
172
172
  }
173
173
  connectedCallback() {
174
174
  attr(this, "role", "tab");
@@ -220,7 +220,7 @@ var UHTMLTabPanelElement = class extends UHTMLElement {
220
220
  }
221
221
  constructor() {
222
222
  super();
223
- if (!this.shadowRoot) attachStyle(this, UHTMLTabPanelStyle);
223
+ attachStyle(this, UHTMLTabPanelStyle);
224
224
  }
225
225
  connectedCallback() {
226
226
  attr(this, "role", "tabpanel");
@@ -247,7 +247,7 @@ var getPanel = (tab, panel) => {
247
247
  return (el == null ? void 0 : el.nodeName) === "U-TABPANEL" ? el : null;
248
248
  };
249
249
  var getSelectedIndex = (tabs) => [...tabs].findIndex((tab) => attr(tab, ARIA_SELECTED) === "true");
250
- var setSelected = (tab) => tab && attr(tab, "aria-selected", "true");
250
+ var setSelected = (tab) => tab && attr(tab, "aria-disabled") !== "true" && attr(tab, "aria-selected", "true");
251
251
  var isFocusable = (el) => el instanceof Element && !el.matches(':disabled,[tabindex^="-"]') && el.matches(
252
252
  `[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe`
253
253
  );
@@ -27,7 +27,7 @@
27
27
  "type": {
28
28
  "text": "string"
29
29
  },
30
- "default": "\":host(:not([hidden])) { cursor: pointer; display: inline-block }\""
30
+ "default": "':host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled=\"true\"]) { cursor: default }'"
31
31
  },
32
32
  {
33
33
  "kind": "variable",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@u-elements/u-tabs",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "license": "MIT",
5
5
  "description": "HTML tags, just truly accessible",
6
6
  "homepage": "https://u-elements.github.io/u-elements/",