@warp-ds/elements 2.4.0-next.3 → 2.4.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.
@@ -3669,6 +3669,154 @@
3669
3669
  }
3670
3670
  ]
3671
3671
  },
3672
+ {
3673
+ "kind": "javascript-module",
3674
+ "path": "packages/switch/index.ts",
3675
+ "declarations": [
3676
+ {
3677
+ "kind": "class",
3678
+ "description": "",
3679
+ "name": "WarpSwitch",
3680
+ "members": [
3681
+ {
3682
+ "kind": "field",
3683
+ "name": "name",
3684
+ "type": {
3685
+ "text": "string"
3686
+ },
3687
+ "default": "''",
3688
+ "attribute": "name",
3689
+ "reflects": true
3690
+ },
3691
+ {
3692
+ "kind": "field",
3693
+ "name": "value",
3694
+ "type": {
3695
+ "text": "string"
3696
+ },
3697
+ "default": "''",
3698
+ "attribute": "value",
3699
+ "reflects": true
3700
+ },
3701
+ {
3702
+ "kind": "field",
3703
+ "name": "checked",
3704
+ "type": {
3705
+ "text": "boolean"
3706
+ },
3707
+ "default": "false",
3708
+ "attribute": "checked",
3709
+ "reflects": true
3710
+ },
3711
+ {
3712
+ "kind": "field",
3713
+ "name": "disabled",
3714
+ "type": {
3715
+ "text": "boolean"
3716
+ },
3717
+ "default": "false",
3718
+ "attribute": "disabled",
3719
+ "reflects": true
3720
+ },
3721
+ {
3722
+ "kind": "field",
3723
+ "name": "#initialState",
3724
+ "privacy": "private",
3725
+ "type": {
3726
+ "text": "boolean | null"
3727
+ },
3728
+ "default": "null"
3729
+ },
3730
+ {
3731
+ "kind": "method",
3732
+ "name": "resetFormControl",
3733
+ "return": {
3734
+ "type": {
3735
+ "text": "void"
3736
+ }
3737
+ },
3738
+ "type": {
3739
+ "text": "resetFormControl() => void"
3740
+ }
3741
+ }
3742
+ ],
3743
+ "events": [
3744
+ {
3745
+ "name": "change",
3746
+ "type": {
3747
+ "text": "CustomEvent"
3748
+ }
3749
+ }
3750
+ ],
3751
+ "attributes": [
3752
+ {
3753
+ "name": "name",
3754
+ "type": {
3755
+ "text": "string"
3756
+ },
3757
+ "default": "''",
3758
+ "fieldName": "name"
3759
+ },
3760
+ {
3761
+ "name": "value",
3762
+ "type": {
3763
+ "text": "string"
3764
+ },
3765
+ "default": "''",
3766
+ "fieldName": "value"
3767
+ },
3768
+ {
3769
+ "name": "checked",
3770
+ "type": {
3771
+ "text": "boolean"
3772
+ },
3773
+ "default": "false",
3774
+ "fieldName": "checked"
3775
+ },
3776
+ {
3777
+ "name": "disabled",
3778
+ "type": {
3779
+ "text": "boolean"
3780
+ },
3781
+ "default": "false",
3782
+ "fieldName": "disabled"
3783
+ }
3784
+ ],
3785
+ "mixins": [
3786
+ {
3787
+ "name": "FormControlMixin",
3788
+ "package": "@open-wc/form-control"
3789
+ }
3790
+ ],
3791
+ "superclass": {
3792
+ "name": "LitElement",
3793
+ "package": "lit"
3794
+ },
3795
+ "tagName": "w-switch",
3796
+ "customElement": true,
3797
+ "modulePath": "packages/switch/index.ts",
3798
+ "definitionPath": "packages/switch/index.ts"
3799
+ }
3800
+ ],
3801
+ "exports": [
3802
+ {
3803
+ "kind": "js",
3804
+ "name": "WarpSwitch",
3805
+ "declaration": {
3806
+ "name": "WarpSwitch",
3807
+ "module": "packages/switch/index.ts"
3808
+ }
3809
+ },
3810
+ {
3811
+ "kind": "custom-element-definition",
3812
+ "name": "w-switch",
3813
+ "declaration": {
3814
+ "name": "WarpSwitch",
3815
+ "module": "packages/switch/index.ts"
3816
+ }
3817
+ }
3818
+ ]
3819
+ },
3672
3820
  {
3673
3821
  "kind": "javascript-module",
3674
3822
  "path": "packages/combobox/index.ts",
@@ -6713,154 +6861,6 @@
6713
6861
  }
6714
6862
  ]
6715
6863
  },
6716
- {
6717
- "kind": "javascript-module",
6718
- "path": "packages/switch/index.ts",
6719
- "declarations": [
6720
- {
6721
- "kind": "class",
6722
- "description": "",
6723
- "name": "WarpSwitch",
6724
- "members": [
6725
- {
6726
- "kind": "field",
6727
- "name": "name",
6728
- "type": {
6729
- "text": "string"
6730
- },
6731
- "default": "''",
6732
- "attribute": "name",
6733
- "reflects": true
6734
- },
6735
- {
6736
- "kind": "field",
6737
- "name": "value",
6738
- "type": {
6739
- "text": "string"
6740
- },
6741
- "default": "''",
6742
- "attribute": "value",
6743
- "reflects": true
6744
- },
6745
- {
6746
- "kind": "field",
6747
- "name": "checked",
6748
- "type": {
6749
- "text": "boolean"
6750
- },
6751
- "default": "false",
6752
- "attribute": "checked",
6753
- "reflects": true
6754
- },
6755
- {
6756
- "kind": "field",
6757
- "name": "disabled",
6758
- "type": {
6759
- "text": "boolean"
6760
- },
6761
- "default": "false",
6762
- "attribute": "disabled",
6763
- "reflects": true
6764
- },
6765
- {
6766
- "kind": "field",
6767
- "name": "#initialState",
6768
- "privacy": "private",
6769
- "type": {
6770
- "text": "boolean | null"
6771
- },
6772
- "default": "null"
6773
- },
6774
- {
6775
- "kind": "method",
6776
- "name": "resetFormControl",
6777
- "return": {
6778
- "type": {
6779
- "text": "void"
6780
- }
6781
- },
6782
- "type": {
6783
- "text": "resetFormControl() => void"
6784
- }
6785
- }
6786
- ],
6787
- "events": [
6788
- {
6789
- "name": "change",
6790
- "type": {
6791
- "text": "CustomEvent"
6792
- }
6793
- }
6794
- ],
6795
- "attributes": [
6796
- {
6797
- "name": "name",
6798
- "type": {
6799
- "text": "string"
6800
- },
6801
- "default": "''",
6802
- "fieldName": "name"
6803
- },
6804
- {
6805
- "name": "value",
6806
- "type": {
6807
- "text": "string"
6808
- },
6809
- "default": "''",
6810
- "fieldName": "value"
6811
- },
6812
- {
6813
- "name": "checked",
6814
- "type": {
6815
- "text": "boolean"
6816
- },
6817
- "default": "false",
6818
- "fieldName": "checked"
6819
- },
6820
- {
6821
- "name": "disabled",
6822
- "type": {
6823
- "text": "boolean"
6824
- },
6825
- "default": "false",
6826
- "fieldName": "disabled"
6827
- }
6828
- ],
6829
- "mixins": [
6830
- {
6831
- "name": "FormControlMixin",
6832
- "package": "@open-wc/form-control"
6833
- }
6834
- ],
6835
- "superclass": {
6836
- "name": "LitElement",
6837
- "package": "lit"
6838
- },
6839
- "tagName": "w-switch",
6840
- "customElement": true,
6841
- "modulePath": "packages/switch/index.ts",
6842
- "definitionPath": "packages/switch/index.ts"
6843
- }
6844
- ],
6845
- "exports": [
6846
- {
6847
- "kind": "js",
6848
- "name": "WarpSwitch",
6849
- "declaration": {
6850
- "name": "WarpSwitch",
6851
- "module": "packages/switch/index.ts"
6852
- }
6853
- },
6854
- {
6855
- "kind": "custom-element-definition",
6856
- "name": "w-switch",
6857
- "declaration": {
6858
- "name": "WarpSwitch",
6859
- "module": "packages/switch/index.ts"
6860
- }
6861
- }
6862
- ]
6863
- },
6864
6864
  {
6865
6865
  "kind": "javascript-module",
6866
6866
  "path": "packages/tabs/tab.ts",
@@ -6872,11 +6872,12 @@
6872
6872
  "members": [
6873
6873
  {
6874
6874
  "kind": "field",
6875
- "name": "name",
6875
+ "name": "for",
6876
6876
  "type": {
6877
6877
  "text": "string"
6878
6878
  },
6879
- "attribute": "name",
6879
+ "default": "''",
6880
+ "attribute": "for",
6880
6881
  "reflects": true
6881
6882
  },
6882
6883
  {
@@ -6919,11 +6920,6 @@
6919
6920
  "attribute": "tab-class",
6920
6921
  "reflects": true
6921
6922
  },
6922
- {
6923
- "kind": "field",
6924
- "name": "_handleClick",
6925
- "privacy": "private"
6926
- },
6927
6923
  {
6928
6924
  "kind": "field",
6929
6925
  "name": "_classes",
@@ -6939,11 +6935,12 @@
6939
6935
  ],
6940
6936
  "attributes": [
6941
6937
  {
6942
- "name": "name",
6938
+ "name": "for",
6943
6939
  "type": {
6944
6940
  "text": "string"
6945
6941
  },
6946
- "fieldName": "name"
6942
+ "default": "''",
6943
+ "fieldName": "for"
6947
6944
  },
6948
6945
  {
6949
6946
  "name": "label",
@@ -7054,7 +7051,7 @@
7054
7051
  },
7055
7052
  {
7056
7053
  "kind": "field",
7057
- "name": "_activeTab",
7054
+ "name": "_activeTabFor",
7058
7055
  "type": {
7059
7056
  "text": "string"
7060
7057
  },
@@ -7074,6 +7071,11 @@
7074
7071
  "name": "_updateSelectionIndicatorDebounced",
7075
7072
  "privacy": "private"
7076
7073
  },
7074
+ {
7075
+ "kind": "field",
7076
+ "name": "_assignSlots",
7077
+ "privacy": "private"
7078
+ },
7077
7079
  {
7078
7080
  "kind": "field",
7079
7081
  "name": "tabs",
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ import type { ModalHeader } from "./packages/modal/modal-header.ts";
17
17
  import type { ModalMain } from "./packages/modal/modal-main.ts";
18
18
  import type { WarpToastContainer } from "./packages/toast/toast-container.ts";
19
19
  import type { WarpDatepicker } from "./packages/datepicker/datepicker.ts";
20
+ import type { WarpSwitch } from "./packages/switch/index.ts";
20
21
  import type { WarpCombobox } from "./packages/combobox/index.ts";
21
22
  import type { WarpDeadToggle } from "./packages/deadtoggle/index.ts";
22
23
  import type { WarpPageIndicator } from "./packages/pageindicator/index.ts";
@@ -28,7 +29,6 @@ import type { WCheckboxGroup } from "./packages/checkbox/checkbox-group.ts";
28
29
  import type { WarpSliderThumb } from "./packages/slider/slider-thumb.ts";
29
30
  import type { WarpSlider } from "./packages/slider/slider.ts";
30
31
  import type { WarpStepIndicator, WarpStep } from "./packages/stepindicator/index.ts";
31
- import type { WarpSwitch } from "./packages/switch/index.ts";
32
32
  import type { WarpTab } from "./packages/tabs/tab.ts";
33
33
  import type { WarpTabs } from "./packages/tabs/tabs.ts";
34
34
  import type { WarpTextarea } from "./packages/textarea/textarea.ts";
@@ -589,6 +589,21 @@ the query will point to an element that doesn't exist anymore. */
589
589
  }
590
590
 
591
591
 
592
+ export type WarpSwitchProps = {
593
+ /** */
594
+ "name"?: WarpSwitch['name'];
595
+ /** */
596
+ "value"?: WarpSwitch['value'];
597
+ /** */
598
+ "checked"?: WarpSwitch['checked'];
599
+ /** */
600
+ "disabled"?: WarpSwitch['disabled'];
601
+
602
+ /** */
603
+ "onchange"?: (e: CustomEvent<CustomEvent>) => void;
604
+ }
605
+
606
+
592
607
  export type WarpComboboxProps = {
593
608
  /** The available options to select from */
594
609
  "options"?: WarpCombobox['options'];
@@ -892,24 +907,9 @@ export type WarpStepProps = {
892
907
  }
893
908
 
894
909
 
895
- export type WarpSwitchProps = {
896
- /** */
897
- "name"?: WarpSwitch['name'];
898
- /** */
899
- "value"?: WarpSwitch['value'];
900
- /** */
901
- "checked"?: WarpSwitch['checked'];
902
- /** */
903
- "disabled"?: WarpSwitch['disabled'];
904
-
905
- /** */
906
- "onchange"?: (e: CustomEvent<CustomEvent>) => void;
907
- }
908
-
909
-
910
910
  export type WarpTabProps = {
911
911
  /** */
912
- "name"?: WarpTab['name'];
912
+ "for"?: WarpTab['for'];
913
913
  /** */
914
914
  "label"?: WarpTab['label'];
915
915
  /** */
@@ -1487,6 +1487,33 @@ export type WarpTextareaProps = {
1487
1487
  "w-datepicker": Partial<WarpDatepickerProps & BaseProps<WarpDatepicker> & BaseEvents>;
1488
1488
 
1489
1489
 
1490
+ /**
1491
+ *
1492
+ *
1493
+ * ## Attributes & Properties
1494
+ *
1495
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
1496
+ *
1497
+ * - `name`: undefined
1498
+ * - `value`: undefined
1499
+ * - `checked`: undefined
1500
+ * - `disabled`: undefined
1501
+ *
1502
+ * ## Events
1503
+ *
1504
+ * Events that will be emitted by the component.
1505
+ *
1506
+ * - `change`: undefined
1507
+ *
1508
+ * ## Methods
1509
+ *
1510
+ * Methods that can be called to access component functionality.
1511
+ *
1512
+ * - `resetFormControl() => void`: undefined
1513
+ */
1514
+ "w-switch": Partial<WarpSwitchProps & BaseProps<WarpSwitch> & BaseEvents>;
1515
+
1516
+
1490
1517
  /**
1491
1518
  * A combobox element for text input with selectable options.
1492
1519
  *
@@ -1828,33 +1855,6 @@ export type WarpTextareaProps = {
1828
1855
  "w-step": Partial<WarpStepProps & BaseProps<WarpStep> & BaseEvents>;
1829
1856
 
1830
1857
 
1831
- /**
1832
- *
1833
- *
1834
- * ## Attributes & Properties
1835
- *
1836
- * Component attributes and properties that can be applied to the element or by using JavaScript.
1837
- *
1838
- * - `name`: undefined
1839
- * - `value`: undefined
1840
- * - `checked`: undefined
1841
- * - `disabled`: undefined
1842
- *
1843
- * ## Events
1844
- *
1845
- * Events that will be emitted by the component.
1846
- *
1847
- * - `change`: undefined
1848
- *
1849
- * ## Methods
1850
- *
1851
- * Methods that can be called to access component functionality.
1852
- *
1853
- * - `resetFormControl() => void`: undefined
1854
- */
1855
- "w-switch": Partial<WarpSwitchProps & BaseProps<WarpSwitch> & BaseEvents>;
1856
-
1857
-
1858
1858
  /**
1859
1859
  * Individual tab component used within w-tabs container.
1860
1860
  *
@@ -1864,7 +1864,7 @@ export type WarpTextareaProps = {
1864
1864
  *
1865
1865
  * Component attributes and properties that can be applied to the element or by using JavaScript.
1866
1866
  *
1867
- * - `name`: undefined
1867
+ * - `for`: undefined
1868
1868
  * - `label`: undefined
1869
1869
  * - `active`: undefined
1870
1870
  * - `over`: undefined
@@ -1,4 +1,3 @@
1
1
  export { WarpTab } from './tab.js';
2
2
  export { WarpTabPanel } from './tab-panel.js';
3
- export type { TabChangeEvent } from './tabs.js';
4
3
  export { WarpTabs } from './tabs.js';
@@ -1,3 +1,4 @@
1
1
  export { WarpTab } from './tab.js';
2
2
  export { WarpTabPanel } from './tab-panel.js';
3
+ // Re-export type interfaces
3
4
  export { WarpTabs } from './tabs.js';
@@ -1,4 +1,4 @@
1
- import { LitElement, PropertyValues } from 'lit';
1
+ import { LitElement } from 'lit';
2
2
  /**
3
3
  * Tab panel component that holds content for individual tabs.
4
4
  * Each tab panel should have a name that matches a corresponding tab.
@@ -7,10 +7,10 @@ import { LitElement, PropertyValues } from 'lit';
7
7
  */
8
8
  export declare class WarpTabPanel extends LitElement {
9
9
  static styles: import("lit").CSSResult[];
10
- name: string;
11
10
  hidden: boolean;
12
11
  connectedCallback(): void;
13
- updated(changedProperties: PropertyValues<this>): void;
12
+ updated(): void;
13
+ private _syncA11yAttributes;
14
14
  render(): import("lit").TemplateResult<1>;
15
15
  }
16
16
  declare global {
@@ -24,25 +24,21 @@ export class WarpTabPanel extends LitElement {
24
24
  super.connectedCallback();
25
25
  this.setAttribute('tabindex', '-1');
26
26
  this.setAttribute('role', 'tabpanel');
27
- // Set aria-labelledby to reference the corresponding tab
28
- if (this.name) {
29
- this.setAttribute('aria-labelledby', `warp-tab-${this.name}`);
30
- this.setAttribute('id', `warp-tabpanel-${this.name}`);
31
- }
27
+ this._syncA11yAttributes();
32
28
  }
33
- updated(changedProperties) {
34
- if (changedProperties.has('name') && this.name) {
35
- this.setAttribute('aria-labelledby', `warp-tab-${this.name}`);
36
- this.setAttribute('id', `warp-tabpanel-${this.name}`);
37
- }
29
+ updated() {
30
+ this._syncA11yAttributes();
31
+ }
32
+ _syncA11yAttributes() {
33
+ // Panel identity comes from its own id attribute.
34
+ if (!this.id)
35
+ return;
36
+ this.setAttribute('aria-labelledby', `warp-tab-${this.id}`);
38
37
  }
39
38
  render() {
40
39
  return html `<slot></slot>`;
41
40
  }
42
41
  }
43
- __decorate([
44
- property({ reflect: true })
45
- ], WarpTabPanel.prototype, "name", void 0);
46
42
  __decorate([
47
43
  property({ type: Boolean, reflect: true })
48
44
  ], WarpTabPanel.prototype, "hidden", void 0);
@@ -6,12 +6,11 @@ import { LitElement } from 'lit';
6
6
  */
7
7
  export declare class WarpTab extends LitElement {
8
8
  static styles: import("lit").CSSResult[];
9
- name: string;
9
+ for: string;
10
10
  label: string;
11
11
  active: boolean;
12
12
  over: boolean;
13
13
  tabClass: string;
14
- private _handleClick;
15
14
  private get _classes();
16
15
  private get _hasChildren();
17
16
  render(): import("lit").TemplateResult<1>;
@@ -1,4 +1,4 @@
1
- var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=(n,o,t,e)=>{for(var r=e>1?void 0:e?u(o,t):o,c=n.length-1,b;c>=0;c--)(b=n[c])&&(r=(e?b(o,t,r):b(r))||r);return e&&r&&m(o,t,r),r};var p=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return n.reduce(function(t,e){return t.concat(typeof e=="string"?e:Array.isArray(e)?p.apply(void 0,e):typeof e=="object"&&e?Object.keys(e).map(function(r){return e[r]?r:""}):"")},[]).join(" ")};import{html as s,LitElement as f}from"lit";import{property as d}from"lit/decorators.js";import{css as g}from"lit";var v=g`
1
+ var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=(n,o,a,r)=>{for(var e=r>1?void 0:r?u(o,a):o,c=n.length-1,b;c>=0;c--)(b=n[c])&&(e=(r?b(o,a,e):b(e))||e);return r&&e&&m(o,a,e),e};var p=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return n.reduce(function(a,r){return a.concat(typeof r=="string"?r:Array.isArray(r)?p.apply(void 0,r):typeof r=="object"&&r?Object.keys(r).map(function(e){return r[e]?e:""}):"")},[]).join(" ")};import{html as s,LitElement as f}from"lit";import{property as d}from"lit/decorators.js";import{css as g}from"lit";var v=g`
2
2
  *,
3
3
  :before,
4
4
  :after {
@@ -2437,18 +2437,18 @@ var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=(n,o,t,e
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 i={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"},x="focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block",a=class extends f{constructor(){super(...arguments);this.label="";this.active=!1;this.over=!1;this.tabClass="";this._handleClick=t=>{this.dispatchEvent(new CustomEvent("tab-click",{detail:{name:this.name},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("click",{detail:{name:this.name,originalEvent:t},bubbles:!0,composed:!0}))}}get _classes(){return p(this.tabClass,[x,i.base,this.active?i.active:i.inactive])}get _hasChildren(){return this.querySelector('[slot="icon"]')!==null||this.innerHTML.trim()!==this.label}render(){let t=this._hasChildren;return s`
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 i={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"},x="focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block",t=class extends f{constructor(){super(...arguments);this.for="";this.label="";this.active=!1;this.over=!1;this.tabClass=""}get _classes(){return p(this.tabClass,[x,i.base,this.active?i.active:i.inactive])}get _hasChildren(){return this.querySelector('[slot="icon"]')!==null||this.innerHTML.trim()!==this.label}render(){let a=this._hasChildren;return s`
2441
2441
  <button
2442
2442
  type="button"
2443
2443
  role="tab"
2444
2444
  aria-selected="${this.active?"true":"false"}"
2445
- aria-controls="${this.active?`warp-tabpanel-${this.name}`:""}"
2446
- id="warp-tab-${this.name}"
2445
+ aria-controls="${this.for}"
2446
+ id="warp-tab-${this.for}"
2447
2447
  class="${this._classes}"
2448
- @click="${this._handleClick}"
2449
2448
  tabindex="${-1}"
2449
+ @click="${r=>{r.tab=this}}"
2450
2450
  style="height: 100%">
2451
- ${t?this.over?s`
2451
+ ${a?this.over?s`
2452
2452
  <span class="${i.icon}">
2453
2453
  <slot name="icon"></slot>
2454
2454
  </span>
@@ -2460,5 +2460,5 @@ var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=(n,o,t,e
2460
2460
  </div>
2461
2461
  `:s`<span class="${i.contentUnderlined}">${this.label}</span>`}
2462
2462
  </button>
2463
- `}};a.styles=[v,h],l([d({reflect:!0})],a.prototype,"name",2),l([d({reflect:!0})],a.prototype,"label",2),l([d({type:Boolean,reflect:!0})],a.prototype,"active",2),l([d({type:Boolean,reflect:!0})],a.prototype,"over",2),l([d({attribute:"tab-class",reflect:!0})],a.prototype,"tabClass",2);customElements.get("w-tab")||customElements.define("w-tab",a);export{a as WarpTab};
2463
+ `}};t.styles=[v,h],l([d({attribute:"for",reflect:!0})],t.prototype,"for",2),l([d({reflect:!0})],t.prototype,"label",2),l([d({type:Boolean,reflect:!0})],t.prototype,"active",2),l([d({type:Boolean,reflect:!0})],t.prototype,"over",2),l([d({attribute:"tab-class",reflect:!0})],t.prototype,"tabClass",2);customElements.get("w-tab")||customElements.define("w-tab",t);export{t as WarpTab};
2464
2464
  //# sourceMappingURL=tab.js.map