@nysds/mcp-server 1.19.3 → 1.19.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.
@@ -11991,11 +11991,11 @@
11991
11991
  "declarations": [
11992
11992
  {
11993
11993
  "kind": "class",
11994
- "description": "`<nys-tabgroup>` is the container for `<nys-tab>` and `<nys-tabpanel>`\nelements.\n\nAccepts tabs and panels as flat light-DOM children in any order (interleaved\nor grouped). On slot change, children are sorted into dedicated shadow-DOM\ncontainers, ARIA relationships are wired, and the first selected (or first)\ntab is activated.\n\nScroll shadows are rendered on either side of the tab list and toggled via\n`ResizeObserver` and a `scroll` listener so they accurately reflect whether\noverflow content exists in each direction.\n\nKeyboard navigation follows the\nhttps://www.w3.org/WAI/ARIA/apg/patterns/tabs/ ARIA Tabs Pattern:\n- Arrow keys move focus without changing selection.\n- Enter / Space confirm selection on the focused tab.",
11994
+ "description": "`<nys-tabgroup>` is the container for `<nys-tab>` and `<nys-tabpanel>`\nelements.\n\nAccepts tabs and panels as flat light-DOM children in any order (interleaved\nor grouped). On slot change, each child is assigned `slot=\"tab\"` or\n`slot=\"panel\"` so it is projected into the correct shadow-DOM container\nwhile remaining in the light DOM, ARIA relationships are wired, and the\nfirst selected (or first) tab is activated.\n\nScroll shadows are rendered on either side of the tab list and toggled via\n`ResizeObserver` and a `scroll` listener so they accurately reflect whether\noverflow content exists in each direction.\n\nKeyboard navigation follows the\nhttps://www.w3.org/WAI/ARIA/apg/patterns/tabs/ ARIA Tabs Pattern:\n- Arrow keys move focus without changing selection.\n- Enter / Space confirm selection on the focused tab.",
11995
11995
  "name": "NysTabgroup",
11996
11996
  "slots": [
11997
11997
  {
11998
- "description": "Accepts `<nys-tab>` and `<nys-tabpanel>` children. Elements are moved into internal shadow-DOM containers on `slotchange`; the slot itself is not rendered visibly.",
11998
+ "description": "Accepts `<nys-tab>` and `<nys-tabpanel>` children. On `slotchange` they are assigned `slot=\"tab\"` / `slot=\"panel\"` and projected into the tablist and panel containers; they stay in the light DOM. Any other children remain in the default slot, rendered below the panels.",
11999
11999
  "name": ""
12000
12000
  }
12001
12001
  ],
@@ -12077,7 +12077,7 @@
12077
12077
  "text": ""
12078
12078
  }
12079
12079
  },
12080
- "description": "Returns all `<nys-tab>` elements currently residing in the shadow-DOM\ntabs container, in DOM order."
12080
+ "description": "Returns all `<nys-tab>` light-DOM children in DOM order.\n\nTabs are projected into the shadow-DOM tablist via the `tab` slot but\nremain light-DOM children of the group, so they stay reachable by consumer\nCSS and JavaScript."
12081
12081
  },
12082
12082
  {
12083
12083
  "kind": "method",
@@ -12088,7 +12088,34 @@
12088
12088
  "text": ""
12089
12089
  }
12090
12090
  },
12091
- "description": "Returns all `<nys-tabpanel>` elements currently residing in the\nshadow-DOM panels container, in DOM order."
12091
+ "description": "Returns the `<nys-tabpanel>` light-DOM children ordered to align with\n`_getTabs()` — i.e. `panels[i]` is the panel paired with `tabs[i]`.\n\nPairing honors explicit `aria-labelledby` references first, then falls\nback to source order for the remaining panels. See _pairPanels."
12092
+ },
12093
+ {
12094
+ "kind": "method",
12095
+ "name": "_pairPanels",
12096
+ "privacy": "private",
12097
+ "return": {
12098
+ "type": {
12099
+ "text": ""
12100
+ }
12101
+ },
12102
+ "parameters": [
12103
+ {
12104
+ "name": "tabs",
12105
+ "type": {
12106
+ "text": "HTMLElement[]"
12107
+ },
12108
+ "description": "Ordered `<nys-tab>` elements."
12109
+ },
12110
+ {
12111
+ "name": "panels",
12112
+ "type": {
12113
+ "text": "HTMLElement[]"
12114
+ },
12115
+ "description": "`<nys-tabpanel>` elements in source order."
12116
+ }
12117
+ ],
12118
+ "description": "Orders `panels` to align 1:1 with `tabs`.\n\nA panel is paired with a tab when its `aria-labelledby` matches that tab's\n`id`; explicit references win over position. Panels without a reference\nfill the remaining tab slots in source order. Any panels whose reference\ndoes not resolve to a tab are appended at the end.\n\nIdempotent: after `_applySelection` writes `aria-labelledby` onto every\npanel, re-running this yields the same order."
12092
12119
  },
12093
12120
  {
12094
12121
  "kind": "method",
@@ -12125,24 +12152,15 @@
12125
12152
  "description": "Single source of truth for ARIA wiring, `tabindex`, and panel visibility.\n\nFor each index `i`:\n- Sets `selected` / removes `selected` attribute on `tabs[i]`.\n- Sets `aria-controls` on `tabs[i]` to the `id` of `panels[i]`.\n- Sets `aria-labelledby` on `panels[i]` to the `id` of `tabs[i]`.\n- Removes `hidden` from `panels[selectedIndex]`; adds it to all others.\n\nMust be called any time the selected tab changes (initial render and\nsubsequent user interactions)."
12126
12153
  },
12127
12154
  {
12128
- "kind": "method",
12129
- "name": "_sortChildren",
12155
+ "kind": "field",
12156
+ "name": "_syncChildren",
12130
12157
  "privacy": "private",
12158
+ "description": "Handles `slotchange` and keeps the tabs/panels wired without ever removing\nthem from the light DOM.\n\nConsumers author `<nys-tab>` / `<nys-tabpanel>` as flat children with no\n`slot` attribute. This assigns `slot=\"tab\"` / `slot=\"panel\"` so each is\nprojected into the correct shadow-DOM container while remaining a\nlight-DOM child of the group (reachable by consumer CSS/JS). Any other\nchildren (e.g. a footnote `<p>`) are left untouched in the default slot.\n\nReads all current light-DOM children on every call (rather than a single\nslot's assigned nodes), so it is robust to dynamic additions/removals and\nidempotent: setting the `slot` attributes triggers further `slotchange`\nevents, but once the attributes are stable no more mutations occur and the\ncascade settles.\n\nAfter (re)assignment, `_applySelection` is called honoring the first tab\nthat already has a `selected` attribute, or index `0` if none is found.",
12131
12159
  "return": {
12132
12160
  "type": {
12133
12161
  "text": ""
12134
12162
  }
12135
- },
12136
- "parameters": [
12137
- {
12138
- "name": "e",
12139
- "type": {
12140
- "text": "Event"
12141
- },
12142
- "description": "The `Event` fired by the `<slot>` element on slot change."
12143
- }
12144
- ],
12145
- "description": "Handles `slotchange` on the default slot.\n\nIterates over all assigned elements and moves each `<nys-tab>` into\n`.nys-tabgroup__tabs` and each `<nys-tabpanel>` into\n`.nys-tabgroup__panels`. If a panel has an `aria-labelledby` attribute,\nit is explicitly paired with the tab it references; otherwise panels are\npaired with tabs by index order. After sorting, calls `_applySelection`\nusing the first element that already has a `selected` attribute, or\nindex `0` if none is found."
12163
+ }
12146
12164
  },
12147
12165
  {
12148
12166
  "kind": "method",
@@ -12231,6 +12249,16 @@
12231
12249
  "title": "Explicit Ordering",
12232
12250
  "code": "<nys-tabgroup id=\"explicit-ordering\">\n<nys-tab label=\"1st Tab\" id=\"tab1\"></nys-tab>\n<nys-tab label=\"2nd Tab\" id=\"tab2\"></nys-tab>\n<nys-tab label=\"3rd Tab\" id=\"tab3\"></nys-tab>\n<nys-tabpanel aria-labelledby=\"tab2\">Content for tab 2</nys-tabpanel>\n<nys-tabpanel aria-labelledby=\"tab3\">Content for tab 3</nys-tabpanel>\n<nys-tabpanel aria-labelledby=\"tab1\">Content for tab 1</nys-tabpanel>\n</nys-tabgroup>",
12233
12251
  "lang": "html"
12252
+ },
12253
+ {
12254
+ "title": "JS in tabpanel",
12255
+ "code": "<nys-tabgroup>\n<nys-tab label=\"Tab 1\"></nys-tab>\n<nys-tab label=\"Tab 2\"></nys-tab>\n<nys-tabpanel>\n<p>Content for tab 1</p>\n</nys-tabpanel>\n<nys-tabpanel>\n<p>Content for tab 2</p>\n</nys-tabpanel>\n</nys-tabgroup>\n<script>\nconst tabgroup = document.querySelector(\"nys-tabgroup\");\nconst panels = tabgroup.querySelectorAll(\"nys-tabpanel\");\npanels[0].innerHTML += \"<p>Added via JS</p>\";\n</script>",
12256
+ "lang": "html"
12257
+ },
12258
+ {
12259
+ "title": "Custom Styling",
12260
+ "code": "<style>\nnys-tabpanel {\n--_nys-tabpanel-background-color: var(--nys-color-theme-faint);\nborder: solid 2px var(--nys-color-theme-strong);\n--nys-button-background-color: var(--nys-color-success);\n}\n</style>\n<nys-tabgroup>\n<nys-tab label=\"Tab 1\"></nys-tab>\n<nys-tab label=\"Tab 2\"></nys-tab>\n<nys-tabpanel>\n<p>Content for tab 1</p>\n<nys-button>Click me</nys-button>\n</nys-tabpanel>\n<nys-tabpanel>\n<p>Content for tab 2</p>\n</nys-tabpanel>\n</nys-tabgroup>",
12261
+ "lang": "html"
12234
12262
  }
12235
12263
  ]
12236
12264
  }
@@ -12260,11 +12288,11 @@
12260
12288
  "declarations": [
12261
12289
  {
12262
12290
  "kind": "class",
12263
- "description": "`<nys-tabpanel>` is a content panel paired with a `<nys-tab>` inside a\n`<nys-tabgroup>`.\n\nPairing is determined by render order: the Nth `<nys-tabpanel>` child of a\n`<nys-tabgroup>` corresponds to the Nth `<nys-tab>` child.\n`aria-labelledby` and the `hidden` attribute are managed externally by\n`<nys-tabgroup>` via `_applySelection`; do not set them directly.",
12291
+ "description": "`<nys-tabpanel>` is a content panel paired with a `<nys-tab>` inside a\n`<nys-tabgroup>`.\n\nPairing is determined by render order: the Nth `<nys-tabpanel>` child of a\n`<nys-tabgroup>` corresponds to the Nth `<nys-tab>` child (or by explicit\n`aria-labelledby`). `aria-labelledby` and the `hidden` attribute are managed\nexternally by `<nys-tabgroup>` via `_applySelection`; do not set them\ndirectly.\n\nThe panel container is styled from the light DOM (`nys-tabpanel.light.scss`,\nadopted on the document) rather than a shadow-DOM wrapper. This keeps the\nslotted panel content in the light DOM — reachable by consumer CSS and\nJavaScript — and lets consumers override the panel's own styling (e.g.\n`nys-tabpanel { padding: 0 }`), which a shadow wrapper would prevent.",
12264
12292
  "name": "NysTabpanel",
12265
12293
  "slots": [
12266
12294
  {
12267
- "description": "Default slot for panel content. Rendered inside a wrapper `<div>` with the `.nys-tabpanel` class for styling.",
12295
+ "description": "Default slot for panel content. Rendered directly under the host, which is the scrollable, focusable (`tabindex=\"0\"`) `role=\"tabpanel\"` region.",
12268
12296
  "name": ""
12269
12297
  }
12270
12298
  ],
@@ -12346,7 +12374,7 @@
12346
12374
  "name": "NysTable",
12347
12375
  "slots": [
12348
12376
  {
12349
- "description": "Accepts a `<table>` element. Only the first table is rendered.",
12377
+ "description": "Accepts a `<table>` element. Only the first table is used. The table is enhanced in place and stays in the light DOM (projected through a slot, never cloned), so embedded components remain interactive and reachable by consumer CSS/JS. Its cell styling is applied from `nys-table.light.scss`, adopted once onto `document.adoptedStyleSheets`.",
12350
12378
  "name": ""
12351
12379
  }
12352
12380
  ],
@@ -12447,12 +12475,63 @@
12447
12475
  "privacy": "private",
12448
12476
  "default": "null"
12449
12477
  },
12478
+ {
12479
+ "kind": "field",
12480
+ "name": "_enhancing",
12481
+ "type": {
12482
+ "text": "boolean"
12483
+ },
12484
+ "privacy": "private",
12485
+ "default": "false"
12486
+ },
12450
12487
  {
12451
12488
  "kind": "method",
12452
- "name": "_handleSlotChange",
12489
+ "name": "_getSlottedTable",
12453
12490
  "privacy": "private",
12491
+ "return": {
12492
+ "type": {
12493
+ "text": "HTMLTableElement | undefined"
12494
+ }
12495
+ },
12454
12496
  "description": "****************** Functions *******************"
12455
12497
  },
12498
+ {
12499
+ "kind": "method",
12500
+ "name": "_observeTable",
12501
+ "privacy": "private",
12502
+ "parameters": [
12503
+ {
12504
+ "name": "table",
12505
+ "type": {
12506
+ "text": "HTMLTableElement"
12507
+ }
12508
+ }
12509
+ ]
12510
+ },
12511
+ {
12512
+ "kind": "method",
12513
+ "name": "_withObserverPaused",
12514
+ "privacy": "private",
12515
+ "parameters": [
12516
+ {
12517
+ "name": "table",
12518
+ "type": {
12519
+ "text": "HTMLTableElement"
12520
+ }
12521
+ },
12522
+ {
12523
+ "name": "fn",
12524
+ "type": {
12525
+ "text": "() => void"
12526
+ }
12527
+ }
12528
+ ]
12529
+ },
12530
+ {
12531
+ "kind": "method",
12532
+ "name": "_handleSlotChange",
12533
+ "privacy": "private"
12534
+ },
12456
12535
  {
12457
12536
  "kind": "method",
12458
12537
  "name": "_setupMutationObserver",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * New York State Design System v1.19.3
2
+ * New York State Design System v1.19.4
3
3
  * Description: A design system for New York State's digital products.
4
4
  * Repository: https://github.com/its-hcd/nysds
5
5
  * License: MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/mcp-server",
3
- "version": "1.19.3",
3
+ "version": "1.19.4",
4
4
  "description": "MCP server for the New York State Design System. Exposes components, tokens, and documentation to AI assistants.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,8 +30,8 @@
30
30
  "zod": "^3.25"
31
31
  },
32
32
  "devDependencies": {
33
- "@nysds/styles": "^1.19.3",
34
- "@nysds/tokens": "^1.19.3",
33
+ "@nysds/styles": "^1.19.4",
34
+ "@nysds/tokens": "^1.19.4",
35
35
  "@types/node": "^22.0.0",
36
36
  "typescript": "^5.9.3"
37
37
  },