@m3e/tabs 1.0.0-rc.2 → 1.0.0-rc.3

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.
@@ -1794,25 +1794,6 @@
1794
1794
  "kind": "mixin",
1795
1795
  "description": "Mixin that adds support for custom event attributes.",
1796
1796
  "name": "EventAttribute",
1797
- "members": [
1798
- {
1799
- "kind": "method",
1800
- "name": "dispatchEvent",
1801
- "return": {
1802
- "type": {
1803
- "text": "boolean"
1804
- }
1805
- },
1806
- "parameters": [
1807
- {
1808
- "name": "event",
1809
- "type": {
1810
- "text": "Event"
1811
- }
1812
- }
1813
- ]
1814
- }
1815
- ],
1816
1797
  "parameters": [
1817
1798
  {
1818
1799
  "name": "base",
@@ -2110,6 +2091,17 @@
2110
2091
  "description": "Mixin to augment an element with behavior used to submit a form.",
2111
2092
  "name": "FormSubmitter",
2112
2093
  "members": [
2094
+ {
2095
+ "kind": "field",
2096
+ "name": "formAssociated",
2097
+ "type": {
2098
+ "text": "boolean"
2099
+ },
2100
+ "static": true,
2101
+ "readonly": true,
2102
+ "default": "true",
2103
+ "description": "Indicates that this custom element participates in form submission, validation, and form state restoration."
2104
+ },
2113
2105
  {
2114
2106
  "kind": "field",
2115
2107
  "name": "name",
@@ -0,0 +1,90 @@
1
+ import { CSSResultGroup, LitElement, PropertyValues } from "lit";
2
+ declare const M3eTabElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").SelectedMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").HtmlForMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DisabledMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").AttachInternalsMixin> & typeof LitElement;
3
+ /**
4
+ * An interactive element that, when activated, presents an associated tab panel.
5
+ *
6
+ * @description
7
+ * The `m3e-tab` component is an interactive control used within a tabbed interface to activate and
8
+ * reveal an associated tab panel. It supports accessible labeling, optional iconography, and selection
9
+ * state styling consistent with Material 3 guidance. Tabs may be disabled, selected, or linked to a
10
+ * specific panel via the `for` attribute, enabling declarative control and semantic clarity.
11
+ *
12
+ * @example
13
+ * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present
14
+ * secondary tabs.
15
+ * ```html
16
+ * <m3e-tabs>
17
+ * <m3e-tab selected for="videos"><m3e-icon slot="icon" name="videocam"></m3e-icon>Video</m3e-tab>
18
+ * <m3e-tab for="photos"><m3e-icon slot="icon" name="photo"></m3e-icon>Photos</m3e-tab>
19
+ * <m3e-tab for="audio"><m3e-icon slot="icon" name="music_note"></m3e-icon>Audio</m3e-tab>
20
+ * <m3e-tab-panel id="videos">Videos</m3e-tab-panel>
21
+ * <m3e-tab-panel id="photos">Photos</m3e-tab-panel>
22
+ * <m3e-tab-panel id="audio">Audio</m3e-tab-panel>
23
+ * </m3e-tabs>
24
+ * ```
25
+ *
26
+ * @tag m3e-tab
27
+ *
28
+ * @slot - Renders the label of the tab.
29
+ * @slot icon - Renders an icon before the tab's label.
30
+ *
31
+ * @attr disabled - Whether the element is disabled.
32
+ * @attr for - The query selector used to specify the element related to this element.
33
+ * @attr selected - Whether the element is selected.
34
+ *
35
+ * @fires input - Emitted when the selected state changes.
36
+ * @fires change - Emitted when the selected state changes.
37
+ * @fires click - Emitted when the element is clicked.
38
+ *
39
+ * @cssprop --m3e-tab-font-size - Font size for tab label.
40
+ * @cssprop --m3e-tab-font-weight - Font weight for tab label.
41
+ * @cssprop --m3e-tab-line-height - Line height for tab label.
42
+ * @cssprop --m3e-tab-tracking - Letter spacing for tab label.
43
+ * @cssprop --m3e-tab-padding-start - Padding on the inline start of the tab.
44
+ * @cssprop --m3e-tab-padding-end - Padding on the inline end of the tab.
45
+ * @cssprop --m3e-tab-focus-ring-shape - Border radius for the focus ring.
46
+ * @cssprop --m3e-tab-selected-color - Text color for selected tab.
47
+ * @cssprop --m3e-tab-selected-container-hover-color - Hover state-layer color for selected tab.
48
+ * @cssprop --m3e-tab-selected-container-focus-color - Focus state-layer color for selected tab.
49
+ * @cssprop --m3e-tab-selected-ripple-color - Ripple color for selected tab.
50
+ * @cssprop --m3e-tab-unselected-color - Text color for unselected tab.
51
+ * @cssprop --m3e-tab-unselected-container-hover-color - Hover state-layer color for unselected tab.
52
+ * @cssprop --m3e-tab-unselected-container-focus-color - Focus state-layer color for unselected tab.
53
+ * @cssprop --m3e-tab-unselected-ripple-color - Ripple color for unselected tab.
54
+ * @cssprop --m3e-tab-disabled-color - Text color for disabled tab.
55
+ * @cssprop --m3e-tab-disabled-opacity - Text opacity for disabled tab.
56
+ * @cssprop --m3e-tab-spacing - Column gap between icon and label.
57
+ * @cssprop --m3e-tab-icon-size - Font size for slotted icon.
58
+ */
59
+ export declare class M3eTabElement extends M3eTabElement_base {
60
+ #private;
61
+ /** The styles of the element. */
62
+ static styles: CSSResultGroup;
63
+ /** @private */ private static __nextId;
64
+ /** @private */ private readonly _focusRing?;
65
+ /** @private */ private readonly _stateLayer?;
66
+ /** @private */ private readonly _ripple?;
67
+ /** @internal A reference to the element that wraps the label of the tab. */
68
+ readonly label: HTMLElement;
69
+ /** @inheritdoc */
70
+ attach(control: HTMLElement): void;
71
+ /** @inheritdoc */
72
+ detach(): void;
73
+ /** @inheritdoc */
74
+ connectedCallback(): void;
75
+ /** @inheritdoc */
76
+ disconnectedCallback(): void;
77
+ /** @inheritdoc */
78
+ protected firstUpdated(_changedProperties: PropertyValues<this>): void;
79
+ /** @inheritdoc */
80
+ protected update(changedProperties: PropertyValues<this>): void;
81
+ /** @inheritdoc */
82
+ protected render(): unknown;
83
+ }
84
+ declare global {
85
+ interface HTMLElementTagNameMap {
86
+ "m3e-tab": M3eTabElement;
87
+ }
88
+ }
89
+ export {};
90
+ //# sourceMappingURL=TabElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabElement.d.ts","sourceRoot":"","sources":["../../src/TabElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;;AAmB5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,qBACa,aAAc,SAAQ,kBAElC;;IACC,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAkFpC;IAEF,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAK;IAE5C,eAAe,CAAuB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAsB;IACxF,eAAe,CAAwB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAuB;IAC3F,eAAe,CAAmB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAmB;IAG9E,4EAA4E;IAC3D,QAAQ,CAAC,KAAK,EAAG,WAAW,CAAC;IAE9C,kBAAkB;IACT,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAO3C,kBAAkB;IACT,MAAM,IAAI,IAAI;IAQvB,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAKrC,kBAAkB;cACC,YAAY,CAAC,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAK/E,kBAAkB;cACC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAQxE,kBAAkB;cACC,MAAM,IAAI,OAAO;CA6BrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,aAAa,CAAC;KAC1B;CACF"}
@@ -0,0 +1,3 @@
1
+ /** Specifies the possible positions of a tab header. */
2
+ export type TabHeaderPosition = "before" | "after";
3
+ //# sourceMappingURL=TabHeaderPosition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabHeaderPosition.d.ts","sourceRoot":"","sources":["../../src/TabHeaderPosition.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { CSSResultGroup, LitElement } from "lit";
2
+ declare const M3eTabPanelElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof LitElement;
3
+ /**
4
+ * A panel presented for a tab.
5
+ *
6
+ * @description
7
+ * The `m3e-tab-panel` component represents the content region associated with a selected tab.
8
+ * It is conditionally rendered based on tab selection and provides a structured surface for
9
+ * displaying contextual information, media, or interactive elements. Panels are linked to their
10
+ * corresponding tabs via the `for` attribute on `m3e-tab`, enabling declarative control and
11
+ * accessible navigation consistent with Material 3 guidance.
12
+ *
13
+ * @example
14
+ * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present
15
+ * secondary tabs.
16
+ * ```html
17
+ * <m3e-tabs>
18
+ * <m3e-tab selected for="videos"><m3e-icon slot="icon" name="videocam"></m3e-icon>Video</m3e-tab>
19
+ * <m3e-tab for="photos"><m3e-icon slot="icon" name="photo"></m3e-icon>Photos</m3e-tab>
20
+ * <m3e-tab for="audio"><m3e-icon slot="icon" name="music_note"></m3e-icon>Audio</m3e-tab>
21
+ * <m3e-tab-panel id="videos">Videos</m3e-tab-panel>
22
+ * <m3e-tab-panel id="photos">Photos</m3e-tab-panel>
23
+ * <m3e-tab-panel id="audio">Audio</m3e-tab-panel>
24
+ * </m3e-tabs>
25
+ * ```
26
+ *
27
+ * @tag m3e-tab-panel
28
+ *
29
+ * @slot - Renders the content of the panel.
30
+ */
31
+ export declare class M3eTabPanelElement extends M3eTabPanelElement_base {
32
+ /** The styles of the element. */
33
+ static styles: CSSResultGroup;
34
+ /** @inheritdoc */
35
+ connectedCallback(): void;
36
+ /** @inheritdoc */
37
+ protected render(): unknown;
38
+ }
39
+ declare global {
40
+ interface HTMLElementTagNameMap {
41
+ "m3e-tab-panel": M3eTabPanelElement;
42
+ }
43
+ }
44
+ export {};
45
+ //# sourceMappingURL=TabPanelElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabPanelElement.d.ts","sourceRoot":"","sources":["../../src/TabPanelElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;;AAK5D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBACa,kBAAmB,SAAQ,uBAA4B;IAClE,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAOpC;IAEF,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;cACC,MAAM,IAAI,OAAO;CAGrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,kBAAkB,CAAC;KACrC;CACF"}
@@ -0,0 +1,3 @@
1
+ /** Specifies the possible appearance variants of a tab. */
2
+ export type TabVariant = "primary" | "secondary";
3
+ //# sourceMappingURL=TabVariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabVariant.d.ts","sourceRoot":"","sources":["../../src/TabVariant.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC"}
@@ -0,0 +1,116 @@
1
+ import { CSSResultGroup, LitElement, PropertyValues } from "lit";
2
+ import { SelectionManager, selectionManager } from "@m3e/core/a11y";
3
+ import { TabVariant } from "./TabVariant";
4
+ import { M3eTabElement } from "./TabElement";
5
+ import { TabHeaderPosition } from "./TabHeaderPosition";
6
+ declare const M3eTabsElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").AttachInternalsMixin> & typeof LitElement;
7
+ /**
8
+ * Organizes content into separate views where only one view can be visible at a time.
9
+ *
10
+ * @description
11
+ * The `m3e-tabs` component provides a structured navigation surface for organizing content into distinct views,
12
+ * where only one view is visible at a time. It supports scrollable tab headers with optional pagination,
13
+ * accessible labeling for navigation controls, and configurable header positioning to suit various layout
14
+ * contexts. Two visual variants are available: `primary`, which emphasizes active indicators and shape styling
15
+ * for prominent navigation, and `secondary`, which offers a more subtle presentation with reduced indicator
16
+ * thickness. Stretch behavior allows tabs to expand and align rhythmically within their container, consistent
17
+ * with Material 3 guidance.
18
+ *
19
+ * @example
20
+ * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present
21
+ * secondary tabs.
22
+ * ```html
23
+ * <m3e-tabs>
24
+ * <m3e-tab selected for="videos"><m3e-icon slot="icon" name="videocam"></m3e-icon>Video</m3e-tab>
25
+ * <m3e-tab for="photos"><m3e-icon slot="icon" name="photo"></m3e-icon>Photos</m3e-tab>
26
+ * <m3e-tab for="audio"><m3e-icon slot="icon" name="music_note"></m3e-icon>Audio</m3e-tab>
27
+ * <m3e-tab-panel id="videos">Videos</m3e-tab-panel>
28
+ * <m3e-tab-panel id="photos">Photos</m3e-tab-panel>
29
+ * <m3e-tab-panel id="audio">Audio</m3e-tab-panel>
30
+ * </m3e-tabs>
31
+ * ```
32
+ *
33
+ * @tag m3e-tabs
34
+ *
35
+ * @slot - Renders the tabs.
36
+ * @slot panel - Renders the panels of the tabs.
37
+ * @slot next-icon - Renders the icon to present for the next button used to paginate.
38
+ * @slot prev-icon - Renders the icon to present for the previous button used to paginate.
39
+ *
40
+ * @attr disable-pagination - Whether scroll buttons are disabled.
41
+ * @attr header-position - The position of the tab headers.
42
+ * @attr next-page-label - The accessible label given to the button used to move to the previous page.
43
+ * @attr previous-page-label - The accessible label given to the button used to move to the next page.
44
+ * @attr stretch - Whether tabs are stretched to fill the header.
45
+ * @attr variant - The appearance variant of the tabs.
46
+ *
47
+ * @fires change - Emitted when the selected tab changes.
48
+ *
49
+ * @cssprop --m3e-tabs-paginator-button-icon-size - Overrides the icon size for paginator buttons.
50
+ * @cssprop --m3e-tabs-active-indicator-color - Color of the active tab indicator.
51
+ * @cssprop --m3e-tabs-primary-before-active-indicator-shape - Border radius for active indicator when header is before and variant is primary.
52
+ * @cssprop --m3e-tabs-primary-after-active-indicator-shape - Border radius for active indicator when header is after and variant is primary.
53
+ * @cssprop --m3e-tabs-primary-active-indicator-inset - Inset for primary variant's active indicator.
54
+ * @cssprop --m3e-tabs-primary-active-indicator-thickness - Thickness for primary variant's active indicator.
55
+ * @cssprop --m3e-tabs-secondary-active-indicator-thickness - Thickness for secondary variant's active indicator.
56
+ */
57
+ export declare class M3eTabsElement extends M3eTabsElement_base {
58
+ #private;
59
+ /** The styles of the element. */
60
+ static styles: CSSResultGroup;
61
+ /** @private */ private readonly _tablist;
62
+ /** @private */ _selectedIndex: number | null;
63
+ /** @internal */
64
+ readonly [selectionManager]: SelectionManager<M3eTabElement>;
65
+ constructor();
66
+ /**
67
+ * Whether scroll buttons are disabled.
68
+ * @default false
69
+ */
70
+ disablePagination: boolean;
71
+ /**
72
+ * The position of the tab headers.
73
+ * @default "before"
74
+ */
75
+ headerPosition: TabHeaderPosition;
76
+ /**
77
+ * The appearance variant of the tabs.
78
+ * @default "secondary"
79
+ */
80
+ variant: TabVariant;
81
+ /**
82
+ * Whether tabs are stretched to fill the header.
83
+ * @default false
84
+ */
85
+ stretch: boolean;
86
+ /**
87
+ * The accessible label given to the button used to move to the previous page.
88
+ * @default "Previous page"
89
+ */
90
+ previousPageLabel: string;
91
+ /**
92
+ * The accessible label given to the button used to move to the next page.
93
+ * @default "Next page"
94
+ */
95
+ nextPageLabel: string;
96
+ /** The tabs. */
97
+ get tabs(): readonly M3eTabElement[];
98
+ /** The selected tab. */
99
+ get selectedTab(): M3eTabElement | null;
100
+ /** The zero-based index of the selected tab. */
101
+ get selectedIndex(): number;
102
+ set selectedIndex(value: number);
103
+ /** @inheritdoc */
104
+ connectedCallback(): void;
105
+ /** @inheritdoc */
106
+ protected updated(_changedProperties: PropertyValues<this>): void;
107
+ /** @inheritdoc */
108
+ protected render(): unknown;
109
+ }
110
+ declare global {
111
+ interface HTMLElementTagNameMap {
112
+ "m3e-tabs": M3eTabsElement;
113
+ }
114
+ }
115
+ export {};
116
+ //# sourceMappingURL=TabsElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabsElement.d.ts","sourceRoot":"","sources":["../../src/TabsElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAW,cAAc,EAAa,MAAM,KAAK,CAAC;AAIhG,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;;AAIxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBACa,cAAe,SAAQ,mBAA2B;;IAC7D,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CA0GpC;IAEF,eAAe,CAAoB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAe;IAC3E,eAAe,CAAU,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE9D,gBAAgB;IAChB,QAAQ,CAAC,CAAC,gBAAgB,CAAC,kCAGb;;IAad;;;OAGG;IAC2D,iBAAiB,UAAS;IAExF;;;OAGG;IACwD,cAAc,EAAE,iBAAiB,CAAY;IAExG;;;OAGG;IAC0B,OAAO,EAAE,UAAU,CAAe;IAE/D;;;OAGG;IACyC,OAAO,UAAS;IAE5D;;;OAGG;IAC6C,iBAAiB,SAAmB;IAEpF;;;OAGG;IACyC,aAAa,SAAe;IAExE,gBAAgB;IAChB,IAAI,IAAI,IAAI,SAAS,aAAa,EAAE,CAEnC;IAED,wBAAwB;IACxB,IAAI,WAAW,IAAI,aAAa,GAAG,IAAI,CAEtC;IAED,gDAAgD;IAChD,IAAI,aAAa,IAAI,MAAM,CAE1B;IACD,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,EAS9B;IAED,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;cACC,OAAO,CAAC,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAQ1E,kBAAkB;cACC,MAAM,IAAI,OAAO;CA2GrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,cAAc,CAAC;KAC5B;CACF"}
@@ -0,0 +1,6 @@
1
+ export * from "./TabElement";
2
+ export * from "./TabHeaderPosition";
3
+ export * from "./TabPanelElement";
4
+ export * from "./TabVariant";
5
+ export * from "./TabsElement";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m3e/tabs",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.3",
4
4
  "description": "Tabs for M3E",
5
5
  "author": "matraic <matraic@yahoo.com>",
6
6
  "license": "MIT",
@@ -27,8 +27,8 @@
27
27
  "clean": "rimraf dist"
28
28
  },
29
29
  "peerDependencies": {
30
- "@m3e/core": "1.0.0-rc.2",
31
- "@m3e/slide-group": "1.0.0-rc.2",
30
+ "@m3e/core": "1.0.0-rc.3",
31
+ "@m3e/slide-group": "1.0.0-rc.3",
32
32
  "lit": "^3.3.0"
33
33
  },
34
34
  "devDependencies": {