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

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.
@@ -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.4",
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.4",
31
+ "@m3e/slide-group": "1.0.0-rc.4",
32
32
  "lit": "^3.3.0"
33
33
  },
34
34
  "devDependencies": {