@xmesh/system-design 0.0.1

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.
Files changed (175) hide show
  1. package/README.md +472 -0
  2. package/assets/brand-lockup-dark.svg +9 -0
  3. package/assets/brand-lockup-light.svg +9 -0
  4. package/assets/brand-mark.svg +9 -0
  5. package/colors_and_type.css +11 -0
  6. package/dist/lit/components/alert/index.css +201 -0
  7. package/dist/lit/components/alert/index.d.ts +25 -0
  8. package/dist/lit/components/alert/index.js +191 -0
  9. package/dist/lit/components/app-bar/index.css +80 -0
  10. package/dist/lit/components/app-bar/index.d.ts +19 -0
  11. package/dist/lit/components/app-bar/index.js +120 -0
  12. package/dist/lit/components/artifact/index.css +166 -0
  13. package/dist/lit/components/artifact/index.d.ts +37 -0
  14. package/dist/lit/components/artifact/index.js +294 -0
  15. package/dist/lit/components/autocomplete/index.css +171 -0
  16. package/dist/lit/components/autocomplete/index.d.ts +47 -0
  17. package/dist/lit/components/autocomplete/index.js +404 -0
  18. package/dist/lit/components/avatar/index.css +62 -0
  19. package/dist/lit/components/avatar/index.d.ts +19 -0
  20. package/dist/lit/components/avatar/index.js +112 -0
  21. package/dist/lit/components/avatar-group/index.css +60 -0
  22. package/dist/lit/components/avatar-group/index.d.ts +19 -0
  23. package/dist/lit/components/avatar-group/index.js +97 -0
  24. package/dist/lit/components/badge/index.css +72 -0
  25. package/dist/lit/components/badge/index.d.ts +18 -0
  26. package/dist/lit/components/badge/index.js +115 -0
  27. package/dist/lit/components/brand-mark/index.css +109 -0
  28. package/dist/lit/components/brand-mark/index.d.ts +24 -0
  29. package/dist/lit/components/brand-mark/index.js +116 -0
  30. package/dist/lit/components/breadcrumbs/index.css +91 -0
  31. package/dist/lit/components/breadcrumbs/index.d.ts +19 -0
  32. package/dist/lit/components/breadcrumbs/index.js +104 -0
  33. package/dist/lit/components/bubble/index.css +182 -0
  34. package/dist/lit/components/bubble/index.d.ts +72 -0
  35. package/dist/lit/components/bubble/index.js +617 -0
  36. package/dist/lit/components/button/index.css +342 -0
  37. package/dist/lit/components/button/index.d.ts +32 -0
  38. package/dist/lit/components/button/index.js +202 -0
  39. package/dist/lit/components/card/index.css +99 -0
  40. package/dist/lit/components/card/index.d.ts +20 -0
  41. package/dist/lit/components/card/index.js +133 -0
  42. package/dist/lit/components/chat/index.css +292 -0
  43. package/dist/lit/components/chat/index.d.ts +74 -0
  44. package/dist/lit/components/chat/index.js +589 -0
  45. package/dist/lit/components/checkbox/index.css +126 -0
  46. package/dist/lit/components/checkbox/index.d.ts +21 -0
  47. package/dist/lit/components/checkbox/index.js +138 -0
  48. package/dist/lit/components/chip/index.css +145 -0
  49. package/dist/lit/components/chip/index.d.ts +30 -0
  50. package/dist/lit/components/chip/index.js +230 -0
  51. package/dist/lit/components/chip-group/index.css +19 -0
  52. package/dist/lit/components/chip-group/index.d.ts +24 -0
  53. package/dist/lit/components/chip-group/index.js +171 -0
  54. package/dist/lit/components/code/index.css +42 -0
  55. package/dist/lit/components/code/index.d.ts +12 -0
  56. package/dist/lit/components/code/index.js +68 -0
  57. package/dist/lit/components/composer/index.css +548 -0
  58. package/dist/lit/components/composer/index.d.ts +67 -0
  59. package/dist/lit/components/composer/index.js +713 -0
  60. package/dist/lit/components/data-table/index.css +166 -0
  61. package/dist/lit/components/data-table/index.d.ts +55 -0
  62. package/dist/lit/components/data-table/index.js +390 -0
  63. package/dist/lit/components/dialog/index.css +124 -0
  64. package/dist/lit/components/dialog/index.d.ts +24 -0
  65. package/dist/lit/components/dialog/index.js +199 -0
  66. package/dist/lit/components/divider/index.css +27 -0
  67. package/dist/lit/components/divider/index.d.ts +13 -0
  68. package/dist/lit/components/divider/index.js +67 -0
  69. package/dist/lit/components/empty-state/index.css +69 -0
  70. package/dist/lit/components/empty-state/index.d.ts +21 -0
  71. package/dist/lit/components/empty-state/index.js +123 -0
  72. package/dist/lit/components/expansion-panel/index.css +120 -0
  73. package/dist/lit/components/expansion-panel/index.d.ts +22 -0
  74. package/dist/lit/components/expansion-panel/index.js +174 -0
  75. package/dist/lit/components/field/index.css +223 -0
  76. package/dist/lit/components/field/index.d.ts +106 -0
  77. package/dist/lit/components/field/index.js +388 -0
  78. package/dist/lit/components/file-input/index.css +257 -0
  79. package/dist/lit/components/file-input/index.d.ts +30 -0
  80. package/dist/lit/components/file-input/index.js +298 -0
  81. package/dist/lit/components/form/index.css +29 -0
  82. package/dist/lit/components/form/index.d.ts +38 -0
  83. package/dist/lit/components/form/index.js +192 -0
  84. package/dist/lit/components/grid/index.css +53 -0
  85. package/dist/lit/components/grid/index.d.ts +14 -0
  86. package/dist/lit/components/grid/index.js +82 -0
  87. package/dist/lit/components/kbd/index.css +35 -0
  88. package/dist/lit/components/kbd/index.d.ts +11 -0
  89. package/dist/lit/components/kbd/index.js +43 -0
  90. package/dist/lit/components/list/index.css +15 -0
  91. package/dist/lit/components/list/index.d.ts +28 -0
  92. package/dist/lit/components/list/index.js +188 -0
  93. package/dist/lit/components/list-item/index.css +119 -0
  94. package/dist/lit/components/list-item/index.d.ts +20 -0
  95. package/dist/lit/components/list-item/index.js +127 -0
  96. package/dist/lit/components/menu/index.css +94 -0
  97. package/dist/lit/components/menu/index.d.ts +47 -0
  98. package/dist/lit/components/menu/index.js +386 -0
  99. package/dist/lit/components/navigation-drawer/index.css +114 -0
  100. package/dist/lit/components/navigation-drawer/index.d.ts +29 -0
  101. package/dist/lit/components/navigation-drawer/index.js +218 -0
  102. package/dist/lit/components/overlay/index.css +171 -0
  103. package/dist/lit/components/overlay/index.d.ts +65 -0
  104. package/dist/lit/components/overlay/index.js +566 -0
  105. package/dist/lit/components/pagination/index.css +102 -0
  106. package/dist/lit/components/pagination/index.d.ts +22 -0
  107. package/dist/lit/components/pagination/index.js +184 -0
  108. package/dist/lit/components/primitives/index.css +504 -0
  109. package/dist/lit/components/primitives/index.d.ts +25 -0
  110. package/dist/lit/components/primitives/index.js +283 -0
  111. package/dist/lit/components/progress/index.css +143 -0
  112. package/dist/lit/components/progress/index.d.ts +23 -0
  113. package/dist/lit/components/progress/index.js +180 -0
  114. package/dist/lit/components/radio-group/index.css +178 -0
  115. package/dist/lit/components/radio-group/index.d.ts +35 -0
  116. package/dist/lit/components/radio-group/index.js +292 -0
  117. package/dist/lit/components/select/index.css +151 -0
  118. package/dist/lit/components/select/index.d.ts +50 -0
  119. package/dist/lit/components/select/index.js +390 -0
  120. package/dist/lit/components/sidebar-item/index.css +133 -0
  121. package/dist/lit/components/sidebar-item/index.d.ts +20 -0
  122. package/dist/lit/components/sidebar-item/index.js +105 -0
  123. package/dist/lit/components/skeleton/index.css +81 -0
  124. package/dist/lit/components/skeleton/index.d.ts +19 -0
  125. package/dist/lit/components/skeleton/index.js +119 -0
  126. package/dist/lit/components/slider/index.css +171 -0
  127. package/dist/lit/components/slider/index.d.ts +36 -0
  128. package/dist/lit/components/slider/index.js +302 -0
  129. package/dist/lit/components/snackbar/index.css +279 -0
  130. package/dist/lit/components/snackbar/index.d.ts +33 -0
  131. package/dist/lit/components/snackbar/index.js +195 -0
  132. package/dist/lit/components/stack/index.css +41 -0
  133. package/dist/lit/components/stack/index.d.ts +20 -0
  134. package/dist/lit/components/stack/index.js +103 -0
  135. package/dist/lit/components/switch/index.css +126 -0
  136. package/dist/lit/components/switch/index.d.ts +17 -0
  137. package/dist/lit/components/switch/index.js +116 -0
  138. package/dist/lit/components/table/index.css +85 -0
  139. package/dist/lit/components/table/index.d.ts +25 -0
  140. package/dist/lit/components/table/index.js +139 -0
  141. package/dist/lit/components/tabs/index.css +116 -0
  142. package/dist/lit/components/tabs/index.d.ts +49 -0
  143. package/dist/lit/components/tabs/index.js +320 -0
  144. package/dist/lit/components/text-field/index.css +90 -0
  145. package/dist/lit/components/text-field/index.d.ts +17 -0
  146. package/dist/lit/components/text-field/index.js +101 -0
  147. package/dist/lit/components/textarea/index.css +55 -0
  148. package/dist/lit/components/textarea/index.d.ts +26 -0
  149. package/dist/lit/components/textarea/index.js +124 -0
  150. package/dist/lit/components/tooltip/index.css +37 -0
  151. package/dist/lit/components/tooltip/index.d.ts +31 -0
  152. package/dist/lit/components/tooltip/index.js +196 -0
  153. package/dist/lit/components/validation/index.css +386 -0
  154. package/dist/lit/components/validation/index.d.ts +45 -0
  155. package/dist/lit/components/validation/index.js +318 -0
  156. package/dist/lit/index.d.ts +50 -0
  157. package/dist/lit/index.js +59 -0
  158. package/package.json +81 -0
  159. package/styles/README.md +346 -0
  160. package/styles/_elevation.css +24 -0
  161. package/styles/_fonts.css +6 -0
  162. package/styles/_layout.css +37 -0
  163. package/styles/_primitives.css +154 -0
  164. package/styles/_scroll.css +75 -0
  165. package/styles/_semantic.css +146 -0
  166. package/styles/_space.css +61 -0
  167. package/styles/_type.css +139 -0
  168. package/styles/_xmesh-extensions.css +232 -0
  169. package/styles/index.css +44 -0
  170. package/styles/md3/_color.css +102 -0
  171. package/styles/md3/_elevation.css +26 -0
  172. package/styles/md3/_motion.css +35 -0
  173. package/styles/md3/_shape.css +22 -0
  174. package/styles/md3/_state.css +22 -0
  175. package/styles/md3/_type.css +111 -0
@@ -0,0 +1,85 @@
1
+ /* ============================================
2
+ Table — static, semantic, hairline-ruled grid.
3
+
4
+ <xm-table> renders a real <table> in its shadow root. Borders are
5
+ 1px --md-sys-color-outline-variant hairlines (no 2px, no heavy
6
+ elevation). The table sits on one surface family — surface* with
7
+ ink --md-sys-color-on-surface (AD-13). Header rows are
8
+ differentiated by the hairline rule + an optional surface-container
9
+ raise, never a status hue (AD-11).
10
+
11
+ Numeric cells right-align (text-align: end) with tabular figures so
12
+ columns of numbers line up; the number + unit carry a space (412 KB)
13
+ in the content (NFR-22 / UX-DR4).
14
+
15
+ Static only — sorting / paging live in xm-data-table (Epic 6).
16
+ ============================================ */
17
+
18
+ .table {
19
+ width: 100%;
20
+ border-collapse: collapse;
21
+ background: transparent;
22
+ color: var(--md-sys-color-on-surface);
23
+ font-family: var(--md-sys-typescale-body-medium-font);
24
+ font-size: var(--md-sys-typescale-body-medium-size);
25
+ line-height: var(--md-sys-typescale-body-medium-line-height);
26
+ /* A hairline frame around the whole grid. */
27
+ border: 1px solid var(--md-sys-color-outline-variant);
28
+ }
29
+
30
+ .table__caption {
31
+ caption-side: top;
32
+ text-align: start;
33
+ padding: 0 0 var(--s-2);
34
+ color: var(--md-sys-color-on-surface-variant);
35
+ font-family: var(--md-sys-typescale-label-large-font);
36
+ font-size: var(--md-sys-typescale-label-large-size);
37
+ font-weight: 500;
38
+ }
39
+
40
+ .table__head {
41
+ background: var(--md-sys-color-surface-container-low);
42
+ }
43
+
44
+ .table__header-cell {
45
+ text-align: start;
46
+ padding: var(--s-3) var(--s-4);
47
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
48
+ color: var(--md-sys-color-on-surface);
49
+ font-family: var(--md-sys-typescale-label-large-font);
50
+ font-size: var(--md-sys-typescale-label-medium-size);
51
+ font-weight: 600;
52
+ letter-spacing: 0;
53
+ white-space: nowrap;
54
+ }
55
+
56
+ .table__row + .table__row .table__cell {
57
+ border-top: 1px solid var(--md-sys-color-outline-variant);
58
+ }
59
+
60
+ .table__cell {
61
+ padding: var(--s-3) var(--s-4);
62
+ text-align: start;
63
+ vertical-align: middle;
64
+ color: var(--md-sys-color-on-surface);
65
+ }
66
+
67
+ /* Secondary ink for muted cells (e.g. timestamps). */
68
+ .table__cell--muted {
69
+ color: var(--md-sys-color-on-surface-variant);
70
+ }
71
+
72
+ /* Numeric — right-aligned, tabular figures so digits line up. */
73
+ .table__header-cell--numeric,
74
+ .table__cell--numeric {
75
+ text-align: end;
76
+ font-variant-numeric: tabular-nums;
77
+ font-feature-settings: "tnum" 1;
78
+ }
79
+
80
+ /* Zebra is intentionally omitted — the hairline rule does the region
81
+ work (UX-DR10). A subtle row-hover keeps long tables scannable
82
+ without a status hue. */
83
+ .table__row:hover .table__cell {
84
+ background: color-mix(in oklab, var(--md-sys-color-on-surface) var(--md-sys-state-hover-state-layer-opacity), transparent);
85
+ }
@@ -0,0 +1,25 @@
1
+ import { LitElement } from "lit";
2
+ import type { TemplateResult } from "lit";
3
+ export interface TableColumn {
4
+ key: string;
5
+ label: string;
6
+ numeric?: boolean;
7
+ align?: "start" | "end";
8
+ muted?: boolean;
9
+ }
10
+ export type TableRow = Record<string, string | number>;
11
+ declare class XmTable extends LitElement {
12
+ columns: TableColumn[];
13
+ rows: TableRow[];
14
+ caption: string;
15
+ willUpdate(changed: Map<string, unknown>): void;
16
+ private _isNumericCol;
17
+ render(): TemplateResult;
18
+ private _renderData;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ "xm-table": XmTable;
23
+ }
24
+ }
25
+ export {};
@@ -0,0 +1,139 @@
1
+ /*
2
+ table/index.ts — <xm-table>.
3
+
4
+ Static, semantic, hairline-ruled table. Renders a real <table> in
5
+ its shadow root. Two authoring modes:
6
+
7
+ 1. Data-driven (preferred; this is the shape xm-data-table composes
8
+ in Epic 6):
9
+ const t = document.querySelector("xm-table");
10
+ t.columns = [
11
+ { key: "name", label: "File name" },
12
+ { key: "type", label: "Type" },
13
+ { key: "size", label: "Size", numeric: true },
14
+ ];
15
+ t.rows = [
16
+ { name: "routing.yaml", type: "YAML", size: "8.4 KB" },
17
+ { name: "schema.json", type: "JSON", size: "412 KB" },
18
+ ];
19
+ Or set columns/rows as JSON via the `columns` / `rows` attributes.
20
+
21
+ 2. Slotted (escape hatch for fully bespoke markup): author your own
22
+ <table> structure inside the element; it is projected verbatim.
23
+
24
+ Column model: { key, label, numeric?, align?, muted? }.
25
+ numeric → right-align + tabular figures (NFR-22). Put the unit in
26
+ the value with a space (e.g. "412 KB").
27
+ align → "start" | "end" | explicit override of numeric default.
28
+ muted → render the cell with secondary ink.
29
+
30
+ Static only — no sorting / paging (that's xm-data-table, Epic 6).
31
+ Shadow DOM; Lit is a bare `import` (peer dep).
32
+ */
33
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
34
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
35
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
36
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
37
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
38
+ };
39
+ import { LitElement, html, nothing } from "lit";
40
+ import { customElement, property } from "lit/decorators.js";
41
+ const TABLE_CSS = new URL("../table/index.css", import.meta.url).href;
42
+ let XmTable = class XmTable extends LitElement {
43
+ constructor() {
44
+ super(...arguments);
45
+ this.columns = [];
46
+ this.rows = [];
47
+ this.caption = "";
48
+ }
49
+ willUpdate(changed) {
50
+ // Allow declarative JSON in attributes for static HTML authoring. A malformed
51
+ // string must not throw out of the reactive update and break render — keep
52
+ // the prior value on a parse error.
53
+ if (changed.has("columns") && typeof this.columns === "string") {
54
+ try {
55
+ this.columns = JSON.parse(this.columns);
56
+ }
57
+ catch {
58
+ this.columns = changed.get("columns") ?? [];
59
+ }
60
+ }
61
+ if (changed.has("rows") && typeof this.rows === "string") {
62
+ try {
63
+ this.rows = JSON.parse(this.rows);
64
+ }
65
+ catch {
66
+ this.rows = changed.get("rows") ?? [];
67
+ }
68
+ }
69
+ }
70
+ _isNumericCol(col) {
71
+ if (col.align === "end")
72
+ return true;
73
+ if (col.align === "start")
74
+ return false;
75
+ return Boolean(col.numeric);
76
+ }
77
+ render() {
78
+ const dataMode = this.columns.length > 0;
79
+ return html `
80
+ <link rel="stylesheet" href="${TABLE_CSS}" />
81
+ <style>
82
+ :host {
83
+ display: block;
84
+ }
85
+ :host([hidden]) {
86
+ display: none;
87
+ }
88
+ </style>
89
+ ${dataMode ? this._renderData() : html `<slot></slot>`}
90
+ `;
91
+ }
92
+ _renderData() {
93
+ return html `
94
+ <table class="table" aria-label=${this.caption || nothing}>
95
+ ${this.caption
96
+ ? html `<caption class="table__caption">${this.caption}</caption>`
97
+ : nothing}
98
+ <thead class="table__head">
99
+ <tr class="table__row">
100
+ ${this.columns.map((col) => {
101
+ const numeric = this._isNumericCol(col);
102
+ const cls = `table__header-cell ${numeric ? "table__header-cell--numeric" : ""}`.trim();
103
+ return html `<th class="${cls}" scope="col">${col.label}</th>`;
104
+ })}
105
+ </tr>
106
+ </thead>
107
+ <tbody>
108
+ ${this.rows.map((row) => html `
109
+ <tr class="table__row">
110
+ ${this.columns.map((col) => {
111
+ const numeric = this._isNumericCol(col);
112
+ const cls = [
113
+ "table__cell",
114
+ numeric && "table__cell--numeric",
115
+ col.muted && "table__cell--muted",
116
+ ]
117
+ .filter(Boolean)
118
+ .join(" ");
119
+ return html `<td class="${cls}">${row[col.key] ?? ""}</td>`;
120
+ })}
121
+ </tr>
122
+ `)}
123
+ </tbody>
124
+ </table>
125
+ `;
126
+ }
127
+ };
128
+ __decorate([
129
+ property({ attribute: false })
130
+ ], XmTable.prototype, "columns", void 0);
131
+ __decorate([
132
+ property({ attribute: false })
133
+ ], XmTable.prototype, "rows", void 0);
134
+ __decorate([
135
+ property({ type: String })
136
+ ], XmTable.prototype, "caption", void 0);
137
+ XmTable = __decorate([
138
+ customElement("xm-table")
139
+ ], XmTable);
@@ -0,0 +1,116 @@
1
+ /* ============================================
2
+ <xm-tabs> / <xm-tab> / <xm-tab-panel> — tab strip.
3
+
4
+ Surface / ink (AD-13): a transparent strip tracing its host surface. On the
5
+ desk family the inactive tab ink is var(--md-sys-color-on-surface-variant)
6
+ and the active tab is var(--md-sys-color-on-surface). The active indicator
7
+ is the single coral accent var(--md-sys-color-primary). Hairline 1px
8
+ baseline rule. Indicator slide is short3 standard easing — no bounce.
9
+
10
+ xm-tab / xm-tab-panel are LIGHT-DOM hosts projected through this element's
11
+ slots, so they are styled with ::slotted(...). The active/disabled state
12
+ classes are added to the xm-tab HOST by xm-tabs.
13
+
14
+ BEM root block `tabs`; elements `__list` `__tab` `__label` `__indicator`
15
+ `__panels` `__panel`; modifiers `__tab--active` `__tab--disabled`,
16
+ size `--xs|sm|md|lg`.
17
+ ============================================ */
18
+
19
+ .tabs {
20
+ display: block;
21
+ }
22
+
23
+ /* ---------- Tablist (the strip) ---------- */
24
+ .tabs__list {
25
+ position: relative;
26
+ display: flex;
27
+ align-items: stretch;
28
+ gap: var(--s-1);
29
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
30
+ }
31
+
32
+ /* ---------- Tabs (slotted xm-tab hosts) ---------- */
33
+ ::slotted(xm-tab) {
34
+ display: inline-flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+ gap: var(--s-2);
38
+ padding: var(--s-2) var(--s-3);
39
+ margin-bottom: -1px;
40
+ border: 0;
41
+ background: transparent;
42
+ color: var(--md-sys-color-on-surface-variant);
43
+ font-family: var(--md-sys-typescale-label-large-font);
44
+ font-weight: 600;
45
+ white-space: nowrap;
46
+ cursor: pointer;
47
+ user-select: none;
48
+ border-radius: var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-small) 0 0;
49
+ transition:
50
+ color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
51
+ background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
52
+ }
53
+ ::slotted(xm-tab:hover) {
54
+ color: var(--md-sys-color-on-surface);
55
+ background: color-mix(
56
+ in oklab,
57
+ var(--md-sys-color-on-surface) var(--md-sys-state-hover-state-layer-opacity),
58
+ transparent
59
+ );
60
+ }
61
+ ::slotted(xm-tab:focus) {
62
+ outline: none;
63
+ }
64
+ ::slotted(xm-tab:focus-visible) {
65
+ outline: none;
66
+ box-shadow: var(--xm-state-focus-ring);
67
+ }
68
+ ::slotted(.tabs__tab--active) {
69
+ color: var(--md-sys-color-on-surface);
70
+ }
71
+ ::slotted(.tabs__tab--disabled) {
72
+ cursor: not-allowed;
73
+ color: var(--xm-color-on-surface-disabled);
74
+ }
75
+ ::slotted(.tabs__tab--disabled:hover) {
76
+ background: transparent;
77
+ color: var(--xm-color-on-surface-disabled);
78
+ }
79
+
80
+ /* ---------- Sizes — one shared tab height per size ---------- */
81
+ .tabs--xs ::slotted(xm-tab) { padding: var(--s-1) var(--s-2); font-size: var(--md-sys-typescale-label-small-size); }
82
+ .tabs--sm ::slotted(xm-tab) { padding: var(--s-1) var(--s-3); font-size: var(--md-sys-typescale-body-small-size); }
83
+ .tabs--md ::slotted(xm-tab) { padding: var(--s-2) var(--s-3); font-size: var(--md-sys-typescale-body-medium-size); }
84
+ .tabs--lg ::slotted(xm-tab) { padding: var(--s-3) var(--s-4); font-size: var(--md-sys-typescale-title-small-size); }
85
+
86
+ /* ---------- Coral active indicator (sliding underline) ---------- */
87
+ .tabs__indicator {
88
+ position: absolute;
89
+ bottom: 0;
90
+ left: 0;
91
+ height: 2px;
92
+ width: 0;
93
+ background: var(--md-sys-color-primary);
94
+ border-radius: var(--md-sys-shape-corner-full);
95
+ opacity: 0;
96
+ transform: translateX(0);
97
+ transition:
98
+ transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
99
+ width var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
100
+ pointer-events: none;
101
+ }
102
+
103
+ /* ---------- Panels ---------- */
104
+ .tabs__panels {
105
+ padding-top: var(--s-4);
106
+ }
107
+ ::slotted(xm-tab-panel) {
108
+ display: block;
109
+ color: var(--md-sys-color-on-surface);
110
+ font-family: var(--md-sys-typescale-body-medium-font);
111
+ font-size: var(--md-sys-typescale-body-medium-size);
112
+ line-height: var(--md-sys-typescale-body-medium-line-height);
113
+ }
114
+ ::slotted(xm-tab-panel[hidden]) {
115
+ display: none;
116
+ }
@@ -0,0 +1,49 @@
1
+ import { LitElement } from "lit";
2
+ import type { PropertyValues, TemplateResult } from "lit";
3
+ type TabsSize = "xs" | "sm" | "md" | "lg";
4
+ export interface TabsChangeDetail {
5
+ value: string;
6
+ }
7
+ declare class XmTab extends LitElement {
8
+ value: string;
9
+ disabled: boolean;
10
+ createRenderRoot(): HTMLElement | DocumentFragment;
11
+ connectedCallback(): void;
12
+ render(): TemplateResult;
13
+ }
14
+ declare class XmTabPanel extends LitElement {
15
+ value: string;
16
+ createRenderRoot(): HTMLElement | DocumentFragment;
17
+ connectedCallback(): void;
18
+ render(): TemplateResult;
19
+ }
20
+ declare class XmTabs extends LitElement {
21
+ value: string;
22
+ size: TabsSize;
23
+ private _list;
24
+ private _indicator;
25
+ private readonly _id;
26
+ private _activeValue;
27
+ render(): TemplateResult;
28
+ firstUpdated(): void;
29
+ protected updated(changed: PropertyValues<this>): void;
30
+ connectedCallback(): void;
31
+ disconnectedCallback(): void;
32
+ private _onResize;
33
+ private get _tabs();
34
+ private get _panels();
35
+ private _enabledTabs;
36
+ private _sync;
37
+ private _positionIndicator;
38
+ private _activate;
39
+ private _onClick;
40
+ private _onKeydown;
41
+ }
42
+ declare global {
43
+ interface HTMLElementTagNameMap {
44
+ "xm-tabs": XmTabs;
45
+ "xm-tab": XmTab;
46
+ "xm-tab-panel": XmTabPanel;
47
+ }
48
+ }
49
+ export {};