@lmfaole/basics 0.2.1 → 0.4.0

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 (41) hide show
  1. package/README.md +306 -22
  2. package/basic-styling/components/basic-accordion.css +65 -0
  3. package/basic-styling/components/basic-alert.css +27 -0
  4. package/basic-styling/components/basic-dialog.css +41 -0
  5. package/basic-styling/components/basic-popover.css +54 -0
  6. package/basic-styling/components/basic-summary-table.css +76 -0
  7. package/basic-styling/components/basic-table.css +48 -0
  8. package/basic-styling/components/basic-tabs.css +45 -0
  9. package/basic-styling/components/basic-toast.css +102 -0
  10. package/basic-styling/components/basic-toc.css +30 -0
  11. package/basic-styling/components.css +9 -0
  12. package/basic-styling/global.css +61 -0
  13. package/basic-styling/index.css +2 -0
  14. package/basic-styling/tokens/base.css +19 -0
  15. package/basic-styling/tokens/palette.css +117 -0
  16. package/basic-styling/tokens/palette.tokens.json +1019 -0
  17. package/components/basic-accordion/index.d.ts +5 -5
  18. package/components/basic-accordion/index.js +169 -165
  19. package/components/basic-alert/index.d.ts +53 -0
  20. package/components/basic-alert/index.js +189 -0
  21. package/components/basic-alert/register.d.ts +1 -0
  22. package/components/basic-alert/register.js +3 -0
  23. package/components/basic-dialog/index.js +21 -1
  24. package/components/basic-summary-table/index.d.ts +69 -0
  25. package/components/basic-summary-table/index.js +536 -0
  26. package/components/basic-summary-table/register.d.ts +1 -0
  27. package/components/basic-summary-table/register.js +3 -0
  28. package/components/basic-table/index.d.ts +75 -0
  29. package/components/basic-table/index.js +612 -0
  30. package/components/basic-table/register.d.ts +1 -0
  31. package/components/basic-table/register.js +3 -0
  32. package/components/basic-tabs/index.d.ts +2 -3
  33. package/components/basic-tabs/index.js +4 -30
  34. package/components/basic-toast/index.d.ts +65 -0
  35. package/components/basic-toast/index.js +429 -0
  36. package/components/basic-toast/register.d.ts +1 -0
  37. package/components/basic-toast/register.js +3 -0
  38. package/index.d.ts +4 -0
  39. package/index.js +4 -0
  40. package/package.json +28 -41
  41. package/readme.mdx +1 -1
@@ -0,0 +1,612 @@
1
+ const HTMLElementBase = globalThis.HTMLElement ?? class {};
2
+ const HTMLTableElementBase = globalThis.HTMLTableElement ?? class {};
3
+ const HTMLTableSectionElementBase = globalThis.HTMLTableSectionElement ?? class {};
4
+ const HTMLTableCellElementBase = globalThis.HTMLTableCellElement ?? class {};
5
+
6
+ export const TABLE_TAG_NAME = "basic-table";
7
+
8
+ const DEFAULT_LABEL = "Tabell";
9
+ const GENERATED_CAPTION_ATTRIBUTE = "data-basic-table-generated-caption";
10
+ const GENERATED_COLUMN_HEADER_ATTRIBUTE = "data-basic-table-generated-column-header";
11
+ const GENERATED_ROW_HEADER_ATTRIBUTE = "data-basic-table-generated-row-header";
12
+ const GENERATED_DESCRIPTION_ATTRIBUTE = "data-basic-table-generated-description";
13
+ const MANAGED_HEADERS_ATTRIBUTE = "data-basic-table-managed-headers";
14
+ const MANAGED_LABEL_ATTRIBUTE = "data-basic-table-managed-label";
15
+ const TABLE_OBSERVER_OPTIONS = {
16
+ childList: true,
17
+ subtree: true,
18
+ characterData: true,
19
+ attributes: true,
20
+ attributeFilter: [
21
+ "aria-describedby",
22
+ "aria-label",
23
+ "aria-labelledby",
24
+ "colspan",
25
+ "headers",
26
+ "id",
27
+ "rowspan",
28
+ "scope",
29
+ ],
30
+ };
31
+
32
+ let nextTableInstanceId = 1;
33
+
34
+ export function normalizeTableLabel(value) {
35
+ return value?.trim() || DEFAULT_LABEL;
36
+ }
37
+
38
+ export function normalizeTableCaption(value) {
39
+ return value?.trim() || "";
40
+ }
41
+
42
+ export function normalizeTableDescription(value) {
43
+ return value?.trim() || "";
44
+ }
45
+
46
+ export function normalizeTableRowHeaders(value) {
47
+ if (typeof value === "string") {
48
+ const normalized = value.trim().toLowerCase();
49
+ return normalized !== "false" && normalized !== "0";
50
+ }
51
+
52
+ return Boolean(value);
53
+ }
54
+
55
+ export function normalizeTableColumnHeaders(value) {
56
+ return normalizeTableRowHeaders(value);
57
+ }
58
+
59
+ export function normalizeTableRowHeaderColumn(value) {
60
+ const parsed = Number.parseInt(value ?? "", 10);
61
+ return Number.isInteger(parsed) && parsed > 0 ? parsed : 1;
62
+ }
63
+
64
+ export function normalizeTableCellSpan(value) {
65
+ const parsed = Number.parseInt(value ?? "", 10);
66
+ return Number.isInteger(parsed) && parsed > 0 ? parsed : 1;
67
+ }
68
+
69
+ function collectOwnedTables(root) {
70
+ return Array.from(root.querySelectorAll("table")).filter(
71
+ (table) => table instanceof HTMLTableElementBase && table.closest(root.tagName.toLowerCase()) === root,
72
+ );
73
+ }
74
+
75
+ function inferHeaderScope(
76
+ cell,
77
+ placement,
78
+ { columnHeadersEnabled = false, rowHeadersEnabled = false, rowHeaderColumnIndex = 0 } = {},
79
+ ) {
80
+ const explicitScope = cell.getAttribute("scope")?.trim().toLowerCase();
81
+
82
+ if (explicitScope) {
83
+ return explicitScope;
84
+ }
85
+
86
+ if (cell.hasAttribute(GENERATED_COLUMN_HEADER_ATTRIBUTE)) {
87
+ return "col";
88
+ }
89
+
90
+ if (placement.sectionTag === "thead") {
91
+ return "col";
92
+ }
93
+
94
+ if (columnHeadersEnabled && placement.rowIndex === 0) {
95
+ return "col";
96
+ }
97
+
98
+ if (
99
+ rowHeadersEnabled
100
+ && placement.sectionTag === "tbody"
101
+ && placement.columnIndex <= rowHeaderColumnIndex
102
+ && placement.columnIndex + placement.colSpan > rowHeaderColumnIndex
103
+ ) {
104
+ return "row";
105
+ }
106
+
107
+ return "";
108
+ }
109
+
110
+ function ensureHeaderId(cell, baseId, nextHeaderIndex) {
111
+ if (!cell.id) {
112
+ cell.id = `${baseId}-header-${nextHeaderIndex}`;
113
+ }
114
+
115
+ return cell.id;
116
+ }
117
+
118
+ function sortPlacementsInDocumentOrder(left, right) {
119
+ if (left.rowIndex !== right.rowIndex) {
120
+ return left.rowIndex - right.rowIndex;
121
+ }
122
+
123
+ return left.columnIndex - right.columnIndex;
124
+ }
125
+
126
+ function buildTablePlacements(table) {
127
+ const rows = Array.from(table.rows);
128
+ const grid = [];
129
+ const placements = [];
130
+
131
+ for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
132
+ const row = rows[rowIndex];
133
+ let columnIndex = 0;
134
+
135
+ grid[rowIndex] ??= [];
136
+
137
+ for (const cell of Array.from(row.cells)) {
138
+ if (!(cell instanceof HTMLTableCellElementBase)) {
139
+ continue;
140
+ }
141
+
142
+ while (grid[rowIndex][columnIndex]) {
143
+ columnIndex += 1;
144
+ }
145
+
146
+ const rowSpan = normalizeTableCellSpan(cell.getAttribute("rowspan"));
147
+ const colSpan = normalizeTableCellSpan(cell.getAttribute("colspan"));
148
+ const section = row.parentElement;
149
+ const sectionTag = section instanceof HTMLTableSectionElementBase
150
+ ? section.tagName.toLowerCase()
151
+ : "table";
152
+
153
+ const placement = {
154
+ cell,
155
+ rowIndex,
156
+ columnIndex,
157
+ rowSpan,
158
+ colSpan,
159
+ sectionTag,
160
+ };
161
+
162
+ placements.push(placement);
163
+
164
+ for (let rowOffset = 0; rowOffset < rowSpan; rowOffset += 1) {
165
+ grid[rowIndex + rowOffset] ??= [];
166
+
167
+ for (let columnOffset = 0; columnOffset < colSpan; columnOffset += 1) {
168
+ grid[rowIndex + rowOffset][columnIndex + columnOffset] = placement;
169
+ }
170
+ }
171
+
172
+ columnIndex += colSpan;
173
+ }
174
+ }
175
+
176
+ return placements;
177
+ }
178
+
179
+ function findCellAtColumnIndex(row, targetColumnIndex) {
180
+ let columnIndex = 0;
181
+
182
+ for (const cell of Array.from(row.cells)) {
183
+ if (!(cell instanceof HTMLTableCellElementBase)) {
184
+ continue;
185
+ }
186
+
187
+ const colSpan = normalizeTableCellSpan(cell.getAttribute("colspan"));
188
+
189
+ if (targetColumnIndex >= columnIndex && targetColumnIndex < columnIndex + colSpan) {
190
+ return cell;
191
+ }
192
+
193
+ columnIndex += colSpan;
194
+ }
195
+
196
+ return null;
197
+ }
198
+
199
+ function replaceCellTag(cell, tagName, generatedAttributeName) {
200
+ const replacement = document.createElement(tagName);
201
+
202
+ for (const attribute of Array.from(cell.attributes)) {
203
+ if (attribute.name === "headers" || attribute.name === MANAGED_HEADERS_ATTRIBUTE) {
204
+ continue;
205
+ }
206
+
207
+ replacement.setAttribute(attribute.name, attribute.value);
208
+ }
209
+
210
+ replacement.setAttribute(generatedAttributeName, "");
211
+ replacement.replaceChildren(...Array.from(cell.childNodes));
212
+ cell.parentElement?.replaceChild(replacement, cell);
213
+
214
+ return replacement;
215
+ }
216
+
217
+ function demoteManagedHeaderCell(cell, generatedAttributeName) {
218
+ const replacement = document.createElement("td");
219
+
220
+ for (const attribute of Array.from(cell.attributes)) {
221
+ if (attribute.name === generatedAttributeName || attribute.name === "scope") {
222
+ continue;
223
+ }
224
+
225
+ replacement.setAttribute(attribute.name, attribute.value);
226
+ }
227
+
228
+ replacement.replaceChildren(...Array.from(cell.childNodes));
229
+ cell.parentElement?.replaceChild(replacement, cell);
230
+ }
231
+
232
+ function promoteFirstRowCellsToHeaders(table) {
233
+ const firstRow = table.rows[0];
234
+
235
+ if (!firstRow) {
236
+ return;
237
+ }
238
+
239
+ for (const cell of Array.from(firstRow.cells)) {
240
+ if (!(cell instanceof HTMLTableCellElementBase) || cell.tagName === "TH") {
241
+ continue;
242
+ }
243
+
244
+ replaceCellTag(cell, "th", GENERATED_COLUMN_HEADER_ATTRIBUTE);
245
+ }
246
+ }
247
+
248
+ function demoteManagedHeaders(table, generatedAttributeName) {
249
+ for (const cell of Array.from(table.querySelectorAll(`th[${generatedAttributeName}]`))) {
250
+ if (!(cell instanceof HTMLTableCellElementBase)) {
251
+ continue;
252
+ }
253
+
254
+ demoteManagedHeaderCell(cell, generatedAttributeName);
255
+ }
256
+ }
257
+
258
+ function syncBodyRowHeaders(table, rowHeaderColumnIndex, rowHeadersEnabled) {
259
+ for (const section of Array.from(table.tBodies)) {
260
+ for (const row of Array.from(section.rows)) {
261
+ const targetCell = rowHeadersEnabled
262
+ ? findCellAtColumnIndex(row, rowHeaderColumnIndex)
263
+ : null;
264
+
265
+ for (const cell of Array.from(row.cells)) {
266
+ if (
267
+ !(cell instanceof HTMLTableCellElementBase)
268
+ || !cell.hasAttribute(GENERATED_ROW_HEADER_ATTRIBUTE)
269
+ || cell === targetCell
270
+ ) {
271
+ continue;
272
+ }
273
+
274
+ demoteManagedHeaderCell(cell, GENERATED_ROW_HEADER_ATTRIBUTE);
275
+ }
276
+
277
+ if (!(targetCell instanceof HTMLTableCellElementBase) || targetCell.tagName === "TH") {
278
+ continue;
279
+ }
280
+
281
+ replaceCellTag(targetCell, "th", GENERATED_ROW_HEADER_ATTRIBUTE);
282
+ }
283
+ }
284
+ }
285
+
286
+ function createGeneratedCaption(table) {
287
+ const caption = document.createElement("caption");
288
+ caption.setAttribute(GENERATED_CAPTION_ATTRIBUTE, "");
289
+ table.insertBefore(caption, table.firstChild);
290
+ return caption;
291
+ }
292
+
293
+ function syncTextContent(node, text) {
294
+ if (node.textContent !== text) {
295
+ node.textContent = text;
296
+ }
297
+ }
298
+
299
+ function syncTableCaption(table, captionText) {
300
+ const existingCaption = table.caption;
301
+ const generatedCaption = existingCaption?.hasAttribute(GENERATED_CAPTION_ATTRIBUTE)
302
+ ? existingCaption
303
+ : null;
304
+
305
+ if (!captionText) {
306
+ generatedCaption?.remove();
307
+ return;
308
+ }
309
+
310
+ if (existingCaption && !generatedCaption) {
311
+ return;
312
+ }
313
+
314
+ const caption = generatedCaption ?? createGeneratedCaption(table);
315
+ syncTextContent(caption, captionText);
316
+ }
317
+
318
+ function syncFallbackAccessibleName(table, label) {
319
+ const hasCaption = Boolean(table.caption);
320
+ const hasManagedLabel = table.hasAttribute(MANAGED_LABEL_ATTRIBUTE);
321
+ const hasOwnAriaLabel = table.hasAttribute("aria-label") && !hasManagedLabel;
322
+ const hasOwnLabelledBy = table.hasAttribute("aria-labelledby");
323
+
324
+ if (hasCaption || hasOwnAriaLabel || hasOwnLabelledBy) {
325
+ if (hasManagedLabel) {
326
+ table.removeAttribute("aria-label");
327
+ table.removeAttribute(MANAGED_LABEL_ATTRIBUTE);
328
+ }
329
+
330
+ return;
331
+ }
332
+
333
+ if (table.getAttribute("aria-label") !== label) {
334
+ table.setAttribute("aria-label", label);
335
+ }
336
+
337
+ if (!hasManagedLabel) {
338
+ table.setAttribute(MANAGED_LABEL_ATTRIBUTE, "");
339
+ }
340
+ }
341
+
342
+ function getGeneratedDescription(root) {
343
+ const description = root.querySelector(`[${GENERATED_DESCRIPTION_ATTRIBUTE}]`);
344
+ return description instanceof HTMLElementBase && description.closest(root.tagName.toLowerCase()) === root
345
+ ? description
346
+ : null;
347
+ }
348
+
349
+ function getAriaReferenceTokens(value) {
350
+ return value?.trim() ? value.trim().split(/\s+/) : [];
351
+ }
352
+
353
+ function syncTableDescription(root, table, descriptionText, baseId) {
354
+ const existingDescription = getGeneratedDescription(root);
355
+
356
+ if (!descriptionText) {
357
+ if (existingDescription?.id) {
358
+ const tokens = getAriaReferenceTokens(table.getAttribute("aria-describedby")).filter(
359
+ (token) => token !== existingDescription.id,
360
+ );
361
+
362
+ if (tokens.length > 0) {
363
+ const nextValue = tokens.join(" ");
364
+
365
+ if (table.getAttribute("aria-describedby") !== nextValue) {
366
+ table.setAttribute("aria-describedby", nextValue);
367
+ }
368
+ } else {
369
+ table.removeAttribute("aria-describedby");
370
+ }
371
+ }
372
+
373
+ existingDescription?.remove();
374
+ return;
375
+ }
376
+
377
+ const description = existingDescription ?? document.createElement("p");
378
+
379
+ if (!existingDescription) {
380
+ description.setAttribute(GENERATED_DESCRIPTION_ATTRIBUTE, "");
381
+ description.hidden = true;
382
+ root.append(description);
383
+ }
384
+
385
+ if (!description.id) {
386
+ description.id = `${baseId}-description`;
387
+ }
388
+
389
+ syncTextContent(description, descriptionText);
390
+
391
+ const tokens = getAriaReferenceTokens(table.getAttribute("aria-describedby")).filter(
392
+ (token) => token !== description.id,
393
+ );
394
+ tokens.push(description.id);
395
+ const nextValue = tokens.join(" ");
396
+
397
+ if (table.getAttribute("aria-describedby") !== nextValue) {
398
+ table.setAttribute("aria-describedby", nextValue);
399
+ }
400
+ }
401
+
402
+ export class TableElement extends HTMLElementBase {
403
+ static observedAttributes = [
404
+ "data-caption",
405
+ "data-column-headers",
406
+ "data-description",
407
+ "data-label",
408
+ "data-row-header-column",
409
+ "data-row-headers",
410
+ ];
411
+
412
+ #instanceId = `${TABLE_TAG_NAME}-${nextTableInstanceId++}`;
413
+ #observer = null;
414
+ #observing = false;
415
+ #scheduledFrame = 0;
416
+
417
+ connectedCallback() {
418
+ this.#syncObserver();
419
+ this.refresh();
420
+ }
421
+
422
+ disconnectedCallback() {
423
+ this.#stopObserving();
424
+ this.#observer = null;
425
+
426
+ if (this.#scheduledFrame !== 0 && typeof window !== "undefined") {
427
+ window.cancelAnimationFrame(this.#scheduledFrame);
428
+ this.#scheduledFrame = 0;
429
+ }
430
+ }
431
+
432
+ attributeChangedCallback() {
433
+ this.#scheduleRefresh();
434
+ }
435
+
436
+ refresh() {
437
+ this.#stopObserving();
438
+
439
+ try {
440
+ const table = collectOwnedTables(this)[0] ?? null;
441
+
442
+ if (!(table instanceof HTMLTableElementBase)) {
443
+ return;
444
+ }
445
+
446
+ const label = normalizeTableLabel(this.getAttribute("data-label"));
447
+ const caption = normalizeTableCaption(this.getAttribute("data-caption"));
448
+ const description = normalizeTableDescription(this.getAttribute("data-description"));
449
+ const columnHeadersEnabled = normalizeTableColumnHeaders(
450
+ this.getAttribute("data-column-headers") ?? this.hasAttribute("data-column-headers"),
451
+ );
452
+ const rowHeaderColumnIndex = normalizeTableRowHeaderColumn(
453
+ this.getAttribute("data-row-header-column"),
454
+ ) - 1;
455
+ const rowHeadersEnabled = normalizeTableRowHeaders(
456
+ this.getAttribute("data-row-headers") ?? this.hasAttribute("data-row-header-column"),
457
+ );
458
+ const baseId = this.id || this.#instanceId;
459
+
460
+ syncTableCaption(table, caption);
461
+ syncFallbackAccessibleName(table, label);
462
+ syncTableDescription(this, table, description, baseId);
463
+
464
+ if (columnHeadersEnabled) {
465
+ promoteFirstRowCellsToHeaders(table);
466
+ } else {
467
+ demoteManagedHeaders(table, GENERATED_COLUMN_HEADER_ATTRIBUTE);
468
+ }
469
+
470
+ syncBodyRowHeaders(table, rowHeaderColumnIndex, rowHeadersEnabled);
471
+
472
+ const placements = buildTablePlacements(table);
473
+ const headerPlacements = [];
474
+ let nextHeaderIndex = 1;
475
+
476
+ for (const placement of placements) {
477
+ if (placement.cell.tagName !== "TH") {
478
+ continue;
479
+ }
480
+
481
+ const scope = inferHeaderScope(placement.cell, placement, {
482
+ columnHeadersEnabled,
483
+ rowHeadersEnabled,
484
+ rowHeaderColumnIndex,
485
+ });
486
+
487
+ if (scope) {
488
+ if (placement.cell.getAttribute("scope") !== scope) {
489
+ placement.cell.setAttribute("scope", scope);
490
+ }
491
+ }
492
+
493
+ headerPlacements.push({
494
+ ...placement,
495
+ scope,
496
+ id: ensureHeaderId(placement.cell, this.id || this.#instanceId, nextHeaderIndex),
497
+ });
498
+ nextHeaderIndex += 1;
499
+ }
500
+
501
+ headerPlacements.sort(sortPlacementsInDocumentOrder);
502
+
503
+ for (const placement of placements) {
504
+ if (placement.cell.tagName !== "TD") {
505
+ continue;
506
+ }
507
+
508
+ const associatedHeaders = headerPlacements.filter((header) => {
509
+ switch (header.scope) {
510
+ case "col":
511
+ case "colgroup":
512
+ return (
513
+ header.rowIndex < placement.rowIndex
514
+ && header.columnIndex < placement.columnIndex + placement.colSpan
515
+ && header.columnIndex + header.colSpan > placement.columnIndex
516
+ );
517
+ case "row":
518
+ case "rowgroup":
519
+ return (
520
+ header.columnIndex < placement.columnIndex
521
+ && header.rowIndex < placement.rowIndex + placement.rowSpan
522
+ && header.rowIndex + header.rowSpan > placement.rowIndex
523
+ );
524
+ default:
525
+ return false;
526
+ }
527
+ });
528
+
529
+ if (associatedHeaders.length === 0) {
530
+ if (placement.cell.hasAttribute(MANAGED_HEADERS_ATTRIBUTE)) {
531
+ placement.cell.removeAttribute("headers");
532
+ placement.cell.removeAttribute(MANAGED_HEADERS_ATTRIBUTE);
533
+ }
534
+
535
+ continue;
536
+ }
537
+
538
+ if (
539
+ placement.cell.hasAttribute("headers")
540
+ && !placement.cell.hasAttribute(MANAGED_HEADERS_ATTRIBUTE)
541
+ ) {
542
+ continue;
543
+ }
544
+
545
+ const nextHeaders = associatedHeaders.map((header) => header.id).join(" ");
546
+
547
+ if (placement.cell.getAttribute("headers") !== nextHeaders) {
548
+ placement.cell.setAttribute("headers", nextHeaders);
549
+ }
550
+
551
+ if (!placement.cell.hasAttribute(MANAGED_HEADERS_ATTRIBUTE)) {
552
+ placement.cell.setAttribute(MANAGED_HEADERS_ATTRIBUTE, "");
553
+ }
554
+ }
555
+ } finally {
556
+ this.#startObserving();
557
+ }
558
+ }
559
+
560
+ #scheduleRefresh() {
561
+ if (this.#scheduledFrame !== 0 || typeof window === "undefined") {
562
+ return;
563
+ }
564
+
565
+ this.#scheduledFrame = window.requestAnimationFrame(() => {
566
+ this.#scheduledFrame = 0;
567
+ this.refresh();
568
+ });
569
+ }
570
+
571
+ #syncObserver() {
572
+ if (this.#observer || typeof MutationObserver === "undefined") {
573
+ return;
574
+ }
575
+
576
+ this.#observer = new MutationObserver(() => {
577
+ this.#scheduleRefresh();
578
+ });
579
+
580
+ this.#startObserving();
581
+ }
582
+
583
+ #startObserving() {
584
+ if (!this.#observer || this.#observing) {
585
+ return;
586
+ }
587
+
588
+ this.#observer.observe(this, TABLE_OBSERVER_OPTIONS);
589
+ this.#observing = true;
590
+ }
591
+
592
+ #stopObserving() {
593
+ if (!this.#observer || !this.#observing) {
594
+ return;
595
+ }
596
+
597
+ this.#observer.disconnect();
598
+ this.#observing = false;
599
+ }
600
+ }
601
+
602
+ export function defineTable(registry = globalThis.customElements) {
603
+ if (!registry?.get || !registry?.define) {
604
+ return TableElement;
605
+ }
606
+
607
+ if (!registry.get(TABLE_TAG_NAME)) {
608
+ registry.define(TABLE_TAG_NAME, TableElement);
609
+ }
610
+
611
+ return TableElement;
612
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { defineTable } from "./index.js";
2
+
3
+ defineTable();
@@ -4,7 +4,7 @@ export interface TabsTabState {
4
4
  }
5
5
 
6
6
  export type TabsActivation = "automatic" | "manual";
7
- export type TabsOrientation = "horizontal" | "vertical";
7
+ export type TabsOrientation = "horizontal";
8
8
 
9
9
  /**
10
10
  * Public tag name registered by `defineTabs`.
@@ -12,7 +12,7 @@ export type TabsOrientation = "horizontal" | "vertical";
12
12
  export const TABS_TAG_NAME: "basic-tabs";
13
13
 
14
14
  /**
15
- * Normalizes unsupported orientation values back to `"horizontal"`.
15
+ * Normalizes orientation values back to `"horizontal"`.
16
16
  */
17
17
  export function normalizeTabsOrientation(
18
18
  value?: string | null,
@@ -48,7 +48,6 @@ export function findNextEnabledTabIndex(
48
48
  *
49
49
  * Attributes:
50
50
  * - `data-label`: fallback accessible name when the tablist has no own label
51
- * - `data-orientation`: sets the keyboard orientation and `aria-orientation`
52
51
  * - `data-activation`: `automatic` or `manual`
53
52
  * - `data-selected-index`: zero-based initially selected tab index
54
53
  */