@warp-ds/elements 2.8.0-next.4 → 2.8.0-next.5

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.
@@ -7212,6 +7212,16 @@
7212
7212
  "description": "Individual tab component used within w-tabs container.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/tabs--docs)",
7213
7213
  "name": "WarpTab",
7214
7214
  "members": [
7215
+ {
7216
+ "kind": "field",
7217
+ "name": "id",
7218
+ "type": {
7219
+ "text": "string"
7220
+ },
7221
+ "default": "''",
7222
+ "attribute": "id",
7223
+ "reflects": true
7224
+ },
7215
7225
  {
7216
7226
  "kind": "field",
7217
7227
  "name": "for",
@@ -7222,13 +7232,31 @@
7222
7232
  "attribute": "for",
7223
7233
  "reflects": true
7224
7234
  },
7235
+ {
7236
+ "kind": "field",
7237
+ "name": "ariaSelected",
7238
+ "type": {
7239
+ "text": "'true' | 'false'"
7240
+ },
7241
+ "attribute": "aria-selected",
7242
+ "reflects": true
7243
+ },
7244
+ {
7245
+ "kind": "field",
7246
+ "name": "tabIndex",
7247
+ "type": {
7248
+ "text": "number"
7249
+ },
7250
+ "attribute": "tabindex",
7251
+ "reflects": true
7252
+ },
7225
7253
  {
7226
7254
  "kind": "field",
7227
7255
  "name": "active",
7228
7256
  "type": {
7229
7257
  "text": "boolean"
7230
7258
  },
7231
- "default": "false",
7259
+ "deprecated": "Use `aria-selected=\"true\"` instead",
7232
7260
  "attribute": "active",
7233
7261
  "reflects": true
7234
7262
  },
@@ -7256,6 +7284,14 @@
7256
7284
  }
7257
7285
  ],
7258
7286
  "attributes": [
7287
+ {
7288
+ "name": "id",
7289
+ "type": {
7290
+ "text": "string"
7291
+ },
7292
+ "default": "''",
7293
+ "fieldName": "id"
7294
+ },
7259
7295
  {
7260
7296
  "name": "for",
7261
7297
  "type": {
@@ -7264,12 +7300,26 @@
7264
7300
  "default": "''",
7265
7301
  "fieldName": "for"
7266
7302
  },
7303
+ {
7304
+ "name": "aria-selected",
7305
+ "type": {
7306
+ "text": "'true' | 'false'"
7307
+ },
7308
+ "fieldName": "ariaSelected"
7309
+ },
7310
+ {
7311
+ "name": "tabindex",
7312
+ "type": {
7313
+ "text": "number"
7314
+ },
7315
+ "fieldName": "tabIndex"
7316
+ },
7267
7317
  {
7268
7318
  "name": "active",
7269
7319
  "type": {
7270
7320
  "text": "boolean"
7271
7321
  },
7272
- "default": "false",
7322
+ "deprecated": "Use `aria-selected=\"true\"` instead",
7273
7323
  "fieldName": "active"
7274
7324
  },
7275
7325
  {
@@ -7328,11 +7378,6 @@
7328
7378
  "default": "true",
7329
7379
  "attribute": "hidden",
7330
7380
  "reflects": true
7331
- },
7332
- {
7333
- "kind": "method",
7334
- "name": "_syncA11yAttributes",
7335
- "privacy": "private"
7336
7381
  }
7337
7382
  ],
7338
7383
  "attributes": [
@@ -7389,7 +7434,6 @@
7389
7434
  "type": {
7390
7435
  "text": "string"
7391
7436
  },
7392
- "default": "''",
7393
7437
  "attribute": "active",
7394
7438
  "reflects": true
7395
7439
  },
@@ -7409,6 +7453,11 @@
7409
7453
  },
7410
7454
  "privacy": "private"
7411
7455
  },
7456
+ {
7457
+ "kind": "field",
7458
+ "name": "_uniqueId",
7459
+ "privacy": "private"
7460
+ },
7412
7461
  {
7413
7462
  "kind": "field",
7414
7463
  "name": "_activeTabFor",
@@ -7503,7 +7552,6 @@
7503
7552
  "type": {
7504
7553
  "text": "string"
7505
7554
  },
7506
- "default": "''",
7507
7555
  "fieldName": "active"
7508
7556
  }
7509
7557
  ],
package/dist/index.d.ts CHANGED
@@ -1628,18 +1628,38 @@ export type WarpSwitchSolidJsProps = {
1628
1628
  };
1629
1629
 
1630
1630
  export type WarpTabProps = {
1631
+ /** */
1632
+ id?: WarpTab["id"];
1631
1633
  /** */
1632
1634
  for?: WarpTab["for"];
1633
1635
  /** */
1636
+ "aria-selected"?: WarpTab["ariaSelected"];
1637
+ /** */
1638
+ ariaSelected?: WarpTab["ariaSelected"];
1639
+ /** */
1640
+ tabindex?: WarpTab["tabIndex"];
1641
+ /** */
1642
+ tabIndex?: WarpTab["tabIndex"];
1643
+ /** @deprecated Use `aria-selected="true"` instead */
1634
1644
  active?: WarpTab["active"];
1635
1645
  /** */
1636
1646
  over?: WarpTab["over"];
1637
1647
  };
1638
1648
 
1639
1649
  export type WarpTabSolidJsProps = {
1650
+ /** */
1651
+ "prop:id"?: WarpTab["id"];
1640
1652
  /** */
1641
1653
  "prop:for"?: WarpTab["for"];
1642
1654
  /** */
1655
+ "attr:aria-selected"?: WarpTab["ariaSelected"];
1656
+ /** */
1657
+ "prop:ariaSelected"?: WarpTab["ariaSelected"];
1658
+ /** */
1659
+ "attr:tabindex"?: WarpTab["tabIndex"];
1660
+ /** */
1661
+ "prop:tabIndex"?: WarpTab["tabIndex"];
1662
+ /** @deprecated Use `aria-selected="true"` instead */
1643
1663
  "prop:active"?: WarpTab["active"];
1644
1664
  /** */
1645
1665
  "prop:over"?: WarpTab["over"];
@@ -2645,7 +2665,10 @@ export type CustomElements = {
2645
2665
  *
2646
2666
  * Component attributes and properties that can be applied to the element or by using JavaScript.
2647
2667
  *
2668
+ * - `id`: undefined
2648
2669
  * - `for`: undefined
2670
+ * - `aria-selected`/`ariaSelected`: undefined
2671
+ * - `tabindex`/`tabIndex`: undefined
2649
2672
  * - `active`: undefined
2650
2673
  * - `over`: undefined
2651
2674
  */
@@ -3696,7 +3719,10 @@ export type CustomElementsSolidJs = {
3696
3719
  *
3697
3720
  * Component attributes and properties that can be applied to the element or by using JavaScript.
3698
3721
  *
3722
+ * - `id`: undefined
3699
3723
  * - `for`: undefined
3724
+ * - `aria-selected`/`ariaSelected`: undefined
3725
+ * - `tabindex`/`tabIndex`: undefined
3700
3726
  * - `active`: undefined
3701
3727
  * - `over`: undefined
3702
3728
  */
@@ -1,4 +1,4 @@
1
- import { LitElement } from 'lit';
1
+ import { LitElement, PropertyValues } from 'lit';
2
2
  /**
3
3
  * Individual tab component used within w-tabs container.
4
4
  *
@@ -6,10 +6,18 @@ import { LitElement } from 'lit';
6
6
  */
7
7
  export declare class WarpTab extends LitElement {
8
8
  static styles: import("lit").CSSResult[];
9
+ id: string;
9
10
  for: string;
11
+ ariaSelected: 'true' | 'false';
12
+ tabIndex: number;
13
+ /**
14
+ * @deprecated Use `aria-selected="true"` instead
15
+ */
10
16
  active: boolean;
11
17
  over: boolean;
12
18
  private get _classes();
13
19
  private get _hasIcon();
20
+ connectedCallback(): void;
21
+ updated(changedProperties: PropertyValues<this>): void;
14
22
  render(): import("lit").TemplateResult<1>;
15
23
  }
@@ -1,4 +1,4 @@
1
- var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var d=(n,o,t,r)=>{for(var e=r>1?void 0:r?u(o,t):o,s=n.length-1,c;s>=0;s--)(c=n[s])&&(e=(r?c(o,t,e):c(e))||e);return r&&e&&m(o,t,e),e};var b=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return n.reduce(function(t,r){return t.concat(typeof r=="string"?r:Array.isArray(r)?b.apply(void 0,r):typeof r=="object"&&r?Object.keys(r).map(function(e){return r[e]?e:""}):"")},[]).join(" ")};import{css as f,html as l,LitElement as x}from"lit";import{property as p}from"lit/decorators.js";import{css as g}from"lit";var v=g`
1
+ var h=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var i=(d,a,r,e)=>{for(var o=e>1?void 0:e?m(a,r):a,c=d.length-1,b;c>=0;c--)(b=d[c])&&(o=(e?b(a,r,o):b(o))||o);return e&&o&&h(a,r,o),o};var p=function(){for(var d=[],a=arguments.length;a--;)d[a]=arguments[a];return d.reduce(function(r,e){return r.concat(typeof e=="string"?e:Array.isArray(e)?p.apply(void 0,e):typeof e=="object"&&e?Object.keys(e).map(function(o){return e[o]?o:""}):"")},[]).join(" ")};import{css as f,html as s,LitElement as x}from"lit";import{property as l}from"lit/decorators.js";import{css as g}from"lit";var v=g`
2
2
  *,
3
3
  :before,
4
4
  :after {
@@ -2437,28 +2437,25 @@ var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var d=(n,o,t,r
2437
2437
  display: none
2438
2438
  }
2439
2439
  }
2440
- `;import{css as w}from"lit";var h=w`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.border-b{border-bottom-width:1px}.border-b-4{border-bottom-width:4px}.inline-block{display:inline-block}.inline-grid{display:inline-grid}.hidden{display:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.-bottom-0{bottom:0}.absolute{position:absolute}.relative{position:relative}.static{position:static}.s-border{border-color:var(--w-s-color-border)}.s-border-selected{border-color:var(--w-s-color-border-selected)}.-mb-1{margin-bottom:-.1rem}.mb-32{margin-bottom:3.2rem}.resize{resize:both}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.bg-transparent{background-color:#0000}.appearance-none{-webkit-appearance:none;appearance:none}.border-0{border-width:0}.border-b-4{border-bottom-width:4px}.border-transparent{border-color:#0000}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.gap-8{gap:.8rem}.focus\\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.items-center{align-items:center}.justify-center{justify-content:center}.static{position:static}.s-text-link{color:var(--w-s-color-text-link)}.s-text-subtle{color:var(--w-s-color-text-subtle)}.hover\\:s-text-link:hover{color:var(--w-s-color-text-link)}.s-border-selected{border-color:var(--w-s-color-border-selected)}.hover\\:s-border-primary:hover{border-color:var(--w-s-color-border-primary)}.m-0{margin:0}.mx-auto{margin-left:auto;margin-right:auto}.p-0{padding:0}.p-16{padding:1.6rem}.pb-8{padding-bottom:.8rem}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.w-full{width: 100%;}`;var a={base:"grid w-full items-center font-bold gap-8 antialias p-16 pb-8 border-b-4 bg-transparent border-transparent hover:s-text-link hover:s-border-primary",inactive:"s-text-subtle",active:"s-text-link s-border-selected",icon:"mx-auto",content:"flex items-center justify-center gap-8",contentUnderlined:"content-underlined"},k="focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block",i=class extends x{constructor(){super(...arguments);this.for="";this.active=!1;this.over=!1}get _classes(){return b([k,a.base,this.active?a.active:a.inactive])}get _hasIcon(){return this.querySelector('[slot="icon"]')!==null}render(){let t=this._hasIcon;return l`
2440
+ `;import{css as w}from"lit";var u=w`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.border-b{border-bottom-width:1px}.border-b-4{border-bottom-width:4px}.inline-block{display:inline-block}.inline-grid{display:inline-grid}.hidden{display:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.-bottom-0{bottom:0}.absolute{position:absolute}.relative{position:relative}.static{position:static}.s-border{border-color:var(--w-s-color-border)}.s-border-selected{border-color:var(--w-s-color-border-selected)}.-mb-1{margin-bottom:-.1rem}.mb-32{margin-bottom:3.2rem}.resize{resize:both}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.bg-transparent{background-color:#0000}.appearance-none{-webkit-appearance:none;appearance:none}.border-0{border-width:0}.border-b-4{border-bottom-width:4px}.border-transparent{border-color:#0000}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.gap-8{gap:.8rem}.focus\\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.items-center{align-items:center}.justify-center{justify-content:center}.static{position:static}.s-text-link{color:var(--w-s-color-text-link)}.s-text-subtle{color:var(--w-s-color-text-subtle)}.hover\\:s-text-link:hover{color:var(--w-s-color-text-link)}.s-border-selected{border-color:var(--w-s-color-border-selected)}.hover\\:s-border-primary:hover{border-color:var(--w-s-color-border-primary)}.m-0{margin:0}.mx-auto{margin-left:auto;margin-right:auto}.p-0{padding:0}.p-16{padding:1.6rem}.pb-8{padding-bottom:.8rem}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.w-full{width: 100%;}`;var n={base:"grid w-full items-center font-bold gap-8 antialias p-16 pb-8 border-b-4 bg-transparent border-transparent hover:s-text-link hover:s-border-primary",inactive:"s-text-subtle",active:"s-text-link s-border-selected",icon:"mx-auto",content:"flex items-center justify-center gap-8",contentUnderlined:"content-underlined"},k="focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block",t=class extends x{constructor(){super(...arguments);this.id="";this.for="";this.over=!1}get _classes(){return p([k,n.base,this.active||this.ariaSelected==="true"?n.active:n.inactive])}get _hasIcon(){return this.querySelector('[slot="icon"]')!==null}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab"),this.setAttribute("aria-controls",this.for)}updated(r){super.updated(r),r.has("active")&&this.setAttribute("aria-selected",this.active?"true":"false"),r.has("for")&&this.setAttribute("aria-controls",this.for)}render(){let r=this._hasIcon;return s`
2441
2441
  <button
2442
2442
  type="button"
2443
- role="tab"
2444
- aria-selected="${this.active?"true":"false"}"
2445
- aria-controls="${this.for}"
2446
2443
  id="warp-tab-${this.for}"
2447
2444
  class="${this._classes}"
2448
2445
  tabindex="${-1}"
2449
- @click="${r=>{r.tab=this}}"
2446
+ @click="${e=>{e.tab=this}}"
2450
2447
  style="height: 100%">
2451
- ${t?this.over?l`
2452
- <span class="${a.icon}">
2448
+ ${r?this.over?s`
2449
+ <span class="${n.icon}">
2453
2450
  <slot name="icon"></slot>
2454
2451
  </span>
2455
- <span class="${a.contentUnderlined}"><slot></slot></span>
2456
- `:l`
2457
- <div class="${a.content}">
2452
+ <span class="${n.contentUnderlined}"><slot></slot></span>
2453
+ `:s`
2454
+ <div class="${n.content}">
2458
2455
  <slot name="icon"></slot>
2459
2456
  <slot></slot>
2460
2457
  </div>
2461
- `:l`<span class="${a.contentUnderlined}"><slot></slot></span>`}
2458
+ `:s`<span class="${n.contentUnderlined}"><slot></slot></span>`}
2462
2459
  </button>
2463
- `}};i.styles=[v,h,f`::slotted([slot="icon"]){display:flex}`],d([p({attribute:"for",reflect:!0})],i.prototype,"for",2),d([p({type:Boolean,reflect:!0})],i.prototype,"active",2),d([p({type:Boolean,reflect:!0})],i.prototype,"over",2);customElements.get("w-tab")||customElements.define("w-tab",i);export{i as WarpTab};
2460
+ `}};t.styles=[v,u,f`::slotted([slot="icon"]){display:flex}`],i([l({attribute:"id",reflect:!0})],t.prototype,"id",2),i([l({attribute:"for",reflect:!0})],t.prototype,"for",2),i([l({attribute:"aria-selected",reflect:!0})],t.prototype,"ariaSelected",2),i([l({attribute:"tabindex",type:Number,reflect:!0})],t.prototype,"tabIndex",2),i([l({type:Boolean,reflect:!0})],t.prototype,"active",2),i([l({type:Boolean,reflect:!0})],t.prototype,"over",2);customElements.get("w-tab")||customElements.define("w-tab",t);export{t as WarpTab};
2464
2461
  //# sourceMappingURL=tab.js.map