@nysds/components 1.23.2 → 1.24.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.
- package/custom-elements.json +500 -25
- package/dist/.vscode/vscode.html-custom-data.json +50 -8
- package/dist/custom-elements.json +500 -25
- package/dist/{nys-icon.library-BRplkAua.js → nys-icon.library-C3fdrsXK.js} +2 -2
- package/dist/{nys-icon.library-BRplkAua.js.map → nys-icon.library-C3fdrsXK.js.map} +1 -1
- package/dist/{nys-icon.library-DPR9yd8U-CCjVAKg8.js → nys-icon.library-CHrtmOCL-BdLMRCBm.js} +3 -3
- package/dist/{nys-icon.library-DPR9yd8U-CCjVAKg8.js.map → nys-icon.library-CHrtmOCL-BdLMRCBm.js.map} +1 -1
- package/dist/nysds.es.js +4403 -4182
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +188 -193
- package/dist/nysds.js.map +1 -1
- package/dist/packages/mcp-server/src/lib/icons.d.ts +18 -0
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +7 -27
- package/dist/packages/nys-button/src/nys-button.d.ts +5 -4
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +8 -18
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +8 -0
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +2 -1
- package/dist/packages/nys-icon/src/nys-icon.d.ts +6 -4
- package/dist/packages/nys-iconlist/src/nys-iconlistitem.d.ts +2 -2
- package/dist/packages/nys-onthispage/src/index.d.ts +1 -0
- package/dist/packages/nys-onthispage/src/nys-onthispage.d.ts +418 -0
- package/dist/packages/nys-onthispage/src/nys-onthispage.figma.d.ts +1 -0
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +2 -2
package/custom-elements.json
CHANGED
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
"declarations": [
|
|
234
234
|
{
|
|
235
235
|
"kind": "class",
|
|
236
|
-
"description": "A collapsible content panel used within `nys-accordion`. Supports keyboard navigation and smooth animations.\n\nPlace inside `nys-accordion`. Set `expanded` to open by default. The heading acts as a toggle button\naccessible via click, Enter, or Space. Parent accordion controls `bordered` and `singleSelect` behavior.\n\
|
|
236
|
+
"description": "A collapsible content panel used within `nys-accordion`. Supports keyboard navigation and smooth animations.\n\nPlace inside `nys-accordion`. Set `expanded` to open by default. The heading acts as a toggle button\naccessible via click, Enter, or Space. Parent accordion controls `bordered` and `singleSelect` behavior.\n\nThe toggle button sits inside a real heading (`h2`-`h6`). Set `headingLevel`\nhere or on the parent `nys-accordion` to match the surrounding page.",
|
|
237
237
|
"name": "NysAccordionItem",
|
|
238
238
|
"slots": [
|
|
239
239
|
{
|
|
@@ -267,10 +267,10 @@
|
|
|
267
267
|
"kind": "field",
|
|
268
268
|
"name": "headingLevel",
|
|
269
269
|
"type": {
|
|
270
|
-
"text": "| \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n |
|
|
270
|
+
"text": "| \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | undefined"
|
|
271
271
|
},
|
|
272
|
-
"default": "
|
|
273
|
-
"description": "Heading element that wraps the toggle button (`h2` through `h6`).\n\
|
|
272
|
+
"default": "undefined",
|
|
273
|
+
"description": "Heading element that wraps the toggle button (`h2` through `h6`).\n\nUse one level below the heading that introduces the accordion. If unset,\nthe item follows the parent `nys-accordion`, then falls back to `h3`.",
|
|
274
274
|
"attribute": "headingLevel",
|
|
275
275
|
"reflects": true
|
|
276
276
|
},
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"text": "NysAccordionHeadingLevel"
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
|
-
"description": "The
|
|
308
|
+
"description": "The item's own level, else the parent accordion's, else `h3`."
|
|
309
309
|
},
|
|
310
310
|
{
|
|
311
311
|
"kind": "method",
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
],
|
|
358
|
-
"description": "
|
|
358
|
+
"description": "Wraps the toggle button in a real heading, per the WAI-ARIA accordion pattern."
|
|
359
359
|
}
|
|
360
360
|
],
|
|
361
361
|
"events": [
|
|
@@ -389,10 +389,10 @@
|
|
|
389
389
|
{
|
|
390
390
|
"name": "headingLevel",
|
|
391
391
|
"type": {
|
|
392
|
-
"text": "| \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n |
|
|
392
|
+
"text": "| \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | undefined"
|
|
393
393
|
},
|
|
394
|
-
"default": "
|
|
395
|
-
"description": "Heading element that wraps the toggle button (`h2` through `h6`).\n\
|
|
394
|
+
"default": "undefined",
|
|
395
|
+
"description": "Heading element that wraps the toggle button (`h2` through `h6`).\n\nUse one level below the heading that introduces the accordion. If unset,\nthe item follows the parent `nys-accordion`, then falls back to `h3`.",
|
|
396
396
|
"fieldName": "headingLevel"
|
|
397
397
|
},
|
|
398
398
|
{
|
|
@@ -2545,7 +2545,7 @@
|
|
|
2545
2545
|
"text": "string"
|
|
2546
2546
|
},
|
|
2547
2547
|
"default": "\"\"",
|
|
2548
|
-
"description": "
|
|
2548
|
+
"description": "NYSDS icon name (see `nys-icon`) shown before the label. Not shown for `circle` mode.",
|
|
2549
2549
|
"attribute": "prefixIcon"
|
|
2550
2550
|
},
|
|
2551
2551
|
{
|
|
@@ -2555,7 +2555,7 @@
|
|
|
2555
2555
|
"text": "string"
|
|
2556
2556
|
},
|
|
2557
2557
|
"default": "\"\"",
|
|
2558
|
-
"description": "
|
|
2558
|
+
"description": "NYSDS icon name (see `nys-icon`) shown after the label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode.",
|
|
2559
2559
|
"attribute": "suffixIcon"
|
|
2560
2560
|
},
|
|
2561
2561
|
{
|
|
@@ -2613,13 +2613,13 @@
|
|
|
2613
2613
|
},
|
|
2614
2614
|
{
|
|
2615
2615
|
"kind": "field",
|
|
2616
|
-
"name": "
|
|
2616
|
+
"name": "ariaDescription",
|
|
2617
2617
|
"type": {
|
|
2618
2618
|
"text": "string"
|
|
2619
2619
|
},
|
|
2620
2620
|
"default": "\"\"",
|
|
2621
|
-
"description": "
|
|
2622
|
-
"attribute": "
|
|
2621
|
+
"description": "Aria description for the button's name. Useful for adding additional SR context\nsuch as hint texts from the nys-tooltip (since that cannot be resolved by `ariaDescribedBy`).",
|
|
2622
|
+
"attribute": "ariaDescription"
|
|
2623
2623
|
},
|
|
2624
2624
|
{
|
|
2625
2625
|
"kind": "field",
|
|
@@ -2926,7 +2926,7 @@
|
|
|
2926
2926
|
"text": "string"
|
|
2927
2927
|
},
|
|
2928
2928
|
"default": "\"\"",
|
|
2929
|
-
"description": "
|
|
2929
|
+
"description": "NYSDS icon name (see `nys-icon`) shown before the label. Not shown for `circle` mode.",
|
|
2930
2930
|
"fieldName": "prefixIcon"
|
|
2931
2931
|
},
|
|
2932
2932
|
{
|
|
@@ -2935,7 +2935,7 @@
|
|
|
2935
2935
|
"text": "string"
|
|
2936
2936
|
},
|
|
2937
2937
|
"default": "\"\"",
|
|
2938
|
-
"description": "
|
|
2938
|
+
"description": "NYSDS icon name (see `nys-icon`) shown after the label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode.",
|
|
2939
2939
|
"fieldName": "suffixIcon"
|
|
2940
2940
|
},
|
|
2941
2941
|
{
|
|
@@ -2984,13 +2984,13 @@
|
|
|
2984
2984
|
"fieldName": "value"
|
|
2985
2985
|
},
|
|
2986
2986
|
{
|
|
2987
|
-
"name": "
|
|
2987
|
+
"name": "ariaDescription",
|
|
2988
2988
|
"type": {
|
|
2989
2989
|
"text": "string"
|
|
2990
2990
|
},
|
|
2991
2991
|
"default": "\"\"",
|
|
2992
|
-
"description": "
|
|
2993
|
-
"fieldName": "
|
|
2992
|
+
"description": "Aria description for the button's name. Useful for adding additional SR context\nsuch as hint texts from the nys-tooltip (since that cannot be resolved by `ariaDescribedBy`).",
|
|
2993
|
+
"fieldName": "ariaDescription"
|
|
2994
2994
|
},
|
|
2995
2995
|
{
|
|
2996
2996
|
"name": "type",
|
|
@@ -8010,11 +8010,20 @@
|
|
|
8010
8010
|
"privacy": "private",
|
|
8011
8011
|
"readonly": true
|
|
8012
8012
|
},
|
|
8013
|
+
{
|
|
8014
|
+
"kind": "field",
|
|
8015
|
+
"name": "_selectionSummary",
|
|
8016
|
+
"type": {
|
|
8017
|
+
"text": "string"
|
|
8018
|
+
},
|
|
8019
|
+
"privacy": "private",
|
|
8020
|
+
"readonly": true
|
|
8021
|
+
},
|
|
8013
8022
|
{
|
|
8014
8023
|
"kind": "method",
|
|
8015
8024
|
"name": "_syncControlErrorAssociation",
|
|
8016
8025
|
"privacy": "private",
|
|
8017
|
-
"description": "
|
|
8026
|
+
"description": "Sets the accessible description of the \"Choose file\" button.\n\nThe real button lives inside <nys-button>'s shadow root, so a normal\naria-describedby id can't reach elements out here. Instead we link the\nelements directly with associateControlRefs. The description is built, in\norder, from: the dropzone hint, the selected-files summary, and the error\nmessage. An aria-description string is also set for browsers that ignore\nelement references."
|
|
8018
8027
|
},
|
|
8019
8028
|
{
|
|
8020
8029
|
"kind": "method",
|
|
@@ -8608,6 +8617,16 @@
|
|
|
8608
8617
|
"description": "Stable id of the element that holds the error text. `aria-errormessage` and\n`aria-describedby` take an IDREF, so they must point at this — never at the\nmessage text itself. Derived from the host id (auto-generated by NysElement)\nrather than the filename, which is not id-safe and not stable.",
|
|
8609
8618
|
"readonly": true
|
|
8610
8619
|
},
|
|
8620
|
+
{
|
|
8621
|
+
"kind": "field",
|
|
8622
|
+
"name": "_removeAriaLabel",
|
|
8623
|
+
"type": {
|
|
8624
|
+
"text": "string"
|
|
8625
|
+
},
|
|
8626
|
+
"privacy": "private",
|
|
8627
|
+
"description": "Accessible name for the remove button. Includes the field label from `nys-fileinput` when set.",
|
|
8628
|
+
"readonly": true
|
|
8629
|
+
},
|
|
8611
8630
|
{
|
|
8612
8631
|
"kind": "method",
|
|
8613
8632
|
"name": "_handleRemove",
|
|
@@ -9310,6 +9329,11 @@
|
|
|
9310
9329
|
"privacy": "private",
|
|
9311
9330
|
"description": "Literal name for the banner: the author's override, or the \"Site\" default when\nthere is no visible title to reference. Undefined whenever `_bannerLabelledBy`\nhas something to point at, so the landmark never carries both.",
|
|
9312
9331
|
"readonly": true
|
|
9332
|
+
},
|
|
9333
|
+
{
|
|
9334
|
+
"kind": "method",
|
|
9335
|
+
"name": "_renderNames",
|
|
9336
|
+
"privacy": "private"
|
|
9313
9337
|
}
|
|
9314
9338
|
],
|
|
9315
9339
|
"attributes": [
|
|
@@ -9763,7 +9787,7 @@
|
|
|
9763
9787
|
"declarations": [
|
|
9764
9788
|
{
|
|
9765
9789
|
"kind": "class",
|
|
9766
|
-
"description": "Renders SVG icons from a registered icon library. The
|
|
9790
|
+
"description": "Renders SVG icons from a registered icon library. The default library is\nthe curated NYSDS icon set built into the package; only its names render\nwithout setup. Other libraries (Font Awesome, Material Icons, your own\nSVGs, etc.) can be registered via `registerIconLibrary()` and selected with\n`library`.\n\nPass `name` to select an icon. Use `library` to choose a registered library\n(defaults to `\"default\"` for NYSDS icons). Use `ariaLabel` to make the icon\naccessible (removes `aria-hidden`). Supports size presets, rotation,\nflipping, and custom colors.",
|
|
9767
9791
|
"name": "NysIcon",
|
|
9768
9792
|
"cssProperties": [
|
|
9769
9793
|
{
|
|
@@ -10045,7 +10069,7 @@
|
|
|
10045
10069
|
"Pair icons with a text label—few icons are universally understood alone.",
|
|
10046
10070
|
"Use icons consistently: same icon and label for the same meaning throughout your app.",
|
|
10047
10071
|
"Use `ariaLabel` when the icon conveys meaning, so screen readers can announce its purpose.",
|
|
10048
|
-
"Use icons from the NYS Design System library
|
|
10072
|
+
"Use icons from the NYS Design System library. If it doesn't have the icon you need, register another library with `registerIconLibrary()` and set `library`.",
|
|
10049
10073
|
"Match icon size and color to the design system.",
|
|
10050
10074
|
"Don't use an icon if its meaning isn't immediately clear—if you suspect users won't recognize it, remove it.",
|
|
10051
10075
|
"Don't use icons to compensate for unclear page hierarchy or confusing content organization.",
|
|
@@ -10298,7 +10322,7 @@
|
|
|
10298
10322
|
"text": "string"
|
|
10299
10323
|
},
|
|
10300
10324
|
"default": "\"\"",
|
|
10301
|
-
"description": "
|
|
10325
|
+
"description": "NYSDS icon name passed to `<nys-icon>`.",
|
|
10302
10326
|
"attribute": "icon"
|
|
10303
10327
|
},
|
|
10304
10328
|
{
|
|
@@ -10344,7 +10368,7 @@
|
|
|
10344
10368
|
"text": "string"
|
|
10345
10369
|
},
|
|
10346
10370
|
"default": "\"\"",
|
|
10347
|
-
"description": "
|
|
10371
|
+
"description": "NYSDS icon name passed to `<nys-icon>`.",
|
|
10348
10372
|
"fieldName": "icon"
|
|
10349
10373
|
},
|
|
10350
10374
|
{
|
|
@@ -10991,6 +11015,457 @@
|
|
|
10991
11015
|
}
|
|
10992
11016
|
]
|
|
10993
11017
|
},
|
|
11018
|
+
{
|
|
11019
|
+
"kind": "javascript-module",
|
|
11020
|
+
"path": "packages/nys-onthispage/src/index.ts",
|
|
11021
|
+
"declarations": [],
|
|
11022
|
+
"exports": [
|
|
11023
|
+
{
|
|
11024
|
+
"kind": "js",
|
|
11025
|
+
"name": "*",
|
|
11026
|
+
"declaration": {
|
|
11027
|
+
"name": "*",
|
|
11028
|
+
"module": "packages/nys-onthispage/src/nys-onthispage"
|
|
11029
|
+
}
|
|
11030
|
+
}
|
|
11031
|
+
]
|
|
11032
|
+
},
|
|
11033
|
+
{
|
|
11034
|
+
"kind": "javascript-module",
|
|
11035
|
+
"path": "packages/nys-onthispage/src/nys-onthispage.ts",
|
|
11036
|
+
"declarations": [
|
|
11037
|
+
{
|
|
11038
|
+
"kind": "class",
|
|
11039
|
+
"description": "In-page navigation that lists the headings on a page as links, so users can jump to a section.\nThe link for the section the user is currently reading is highlighted.\n\nThe component collects headings from the `scope` element (default `main`) at the `headingTracker`\nlevel (default `h2`). Headings without an `id` get one generated from their text. Headings inside\n`nys-accordion`, inside a `[hidden]` element, or marked with `data-nys-onthispage-ignore` are left out.\nNothing renders until at least two headings are found.\n\nClicking a link scrolls to the heading and moves focus to it.",
|
|
11040
|
+
"name": "NysOnthispage",
|
|
11041
|
+
"members": [
|
|
11042
|
+
{
|
|
11043
|
+
"kind": "field",
|
|
11044
|
+
"name": "id",
|
|
11045
|
+
"type": {
|
|
11046
|
+
"text": "string"
|
|
11047
|
+
},
|
|
11048
|
+
"default": "\"\"",
|
|
11049
|
+
"description": "Unique identifier. Auto-generated by the shared base if not provided.",
|
|
11050
|
+
"attribute": "id",
|
|
11051
|
+
"reflects": true
|
|
11052
|
+
},
|
|
11053
|
+
{
|
|
11054
|
+
"kind": "field",
|
|
11055
|
+
"name": "headingTracker",
|
|
11056
|
+
"type": {
|
|
11057
|
+
"text": "HeadingTag"
|
|
11058
|
+
},
|
|
11059
|
+
"default": "\"h2\"",
|
|
11060
|
+
"description": "Heading level to track and link. `h1` is excluded.",
|
|
11061
|
+
"attribute": "headingTracker"
|
|
11062
|
+
},
|
|
11063
|
+
{
|
|
11064
|
+
"kind": "field",
|
|
11065
|
+
"name": "heading",
|
|
11066
|
+
"type": {
|
|
11067
|
+
"text": "string"
|
|
11068
|
+
},
|
|
11069
|
+
"default": "\"On this page\"",
|
|
11070
|
+
"description": "Nav heading text.",
|
|
11071
|
+
"attribute": "heading"
|
|
11072
|
+
},
|
|
11073
|
+
{
|
|
11074
|
+
"kind": "field",
|
|
11075
|
+
"name": "scope",
|
|
11076
|
+
"type": {
|
|
11077
|
+
"text": "string"
|
|
11078
|
+
},
|
|
11079
|
+
"default": "\"main\"",
|
|
11080
|
+
"description": "CSS selector for the container whose headings are tracked.",
|
|
11081
|
+
"attribute": "scope"
|
|
11082
|
+
},
|
|
11083
|
+
{
|
|
11084
|
+
"kind": "field",
|
|
11085
|
+
"name": "disableSticky",
|
|
11086
|
+
"type": {
|
|
11087
|
+
"text": "boolean"
|
|
11088
|
+
},
|
|
11089
|
+
"default": "false",
|
|
11090
|
+
"description": "Turns off the sticky behavior, so the nav scrolls with the page.\nSticky only applies on viewports 480px wide or larger.",
|
|
11091
|
+
"attribute": "disableSticky",
|
|
11092
|
+
"reflects": true
|
|
11093
|
+
},
|
|
11094
|
+
{
|
|
11095
|
+
"kind": "field",
|
|
11096
|
+
"name": "offset",
|
|
11097
|
+
"type": {
|
|
11098
|
+
"text": "number"
|
|
11099
|
+
},
|
|
11100
|
+
"default": "80",
|
|
11101
|
+
"description": "Distance (px) from the viewport top to the trigger line. Also sets\n`scroll-margin-top` on tracked headings and the sticky `top` value.",
|
|
11102
|
+
"attribute": "offset"
|
|
11103
|
+
},
|
|
11104
|
+
{
|
|
11105
|
+
"kind": "field",
|
|
11106
|
+
"name": "disableSmoothScroll",
|
|
11107
|
+
"type": {
|
|
11108
|
+
"text": "boolean"
|
|
11109
|
+
},
|
|
11110
|
+
"default": "false",
|
|
11111
|
+
"description": "Turns off smooth scrolling. Already off for visitors with `prefers-reduced-motion`.",
|
|
11112
|
+
"attribute": "disableSmoothScroll",
|
|
11113
|
+
"reflects": true
|
|
11114
|
+
},
|
|
11115
|
+
{
|
|
11116
|
+
"kind": "field",
|
|
11117
|
+
"name": "hashBehavior",
|
|
11118
|
+
"type": {
|
|
11119
|
+
"text": "HashBehavior"
|
|
11120
|
+
},
|
|
11121
|
+
"default": "\"none\"",
|
|
11122
|
+
"description": "`hash` pushes history, `replace` updates the URL silently, `none` leaves it alone.",
|
|
11123
|
+
"attribute": "hashBehavior"
|
|
11124
|
+
},
|
|
11125
|
+
{
|
|
11126
|
+
"kind": "field",
|
|
11127
|
+
"name": "_items",
|
|
11128
|
+
"type": {
|
|
11129
|
+
"text": "TrackedHeading[]"
|
|
11130
|
+
},
|
|
11131
|
+
"privacy": "private",
|
|
11132
|
+
"default": "[]"
|
|
11133
|
+
},
|
|
11134
|
+
{
|
|
11135
|
+
"kind": "field",
|
|
11136
|
+
"name": "_activeId",
|
|
11137
|
+
"type": {
|
|
11138
|
+
"text": "string | null"
|
|
11139
|
+
},
|
|
11140
|
+
"privacy": "private",
|
|
11141
|
+
"default": "null"
|
|
11142
|
+
},
|
|
11143
|
+
{
|
|
11144
|
+
"kind": "field",
|
|
11145
|
+
"name": "_observer",
|
|
11146
|
+
"type": {
|
|
11147
|
+
"text": "MutationObserver | undefined"
|
|
11148
|
+
},
|
|
11149
|
+
"privacy": "private"
|
|
11150
|
+
},
|
|
11151
|
+
{
|
|
11152
|
+
"kind": "field",
|
|
11153
|
+
"name": "_scrollFrame",
|
|
11154
|
+
"type": {
|
|
11155
|
+
"text": "number"
|
|
11156
|
+
},
|
|
11157
|
+
"privacy": "private",
|
|
11158
|
+
"default": "0"
|
|
11159
|
+
},
|
|
11160
|
+
{
|
|
11161
|
+
"kind": "field",
|
|
11162
|
+
"name": "_rebuildFrame",
|
|
11163
|
+
"type": {
|
|
11164
|
+
"text": "number"
|
|
11165
|
+
},
|
|
11166
|
+
"privacy": "private",
|
|
11167
|
+
"default": "0"
|
|
11168
|
+
},
|
|
11169
|
+
{
|
|
11170
|
+
"kind": "field",
|
|
11171
|
+
"name": "_holdingActive",
|
|
11172
|
+
"type": {
|
|
11173
|
+
"text": "boolean"
|
|
11174
|
+
},
|
|
11175
|
+
"privacy": "private",
|
|
11176
|
+
"default": "false",
|
|
11177
|
+
"description": "True while a link-click scroll is in flight, so scroll events don't override the clicked link."
|
|
11178
|
+
},
|
|
11179
|
+
{
|
|
11180
|
+
"kind": "field",
|
|
11181
|
+
"name": "_holdTimer",
|
|
11182
|
+
"type": {
|
|
11183
|
+
"text": "number"
|
|
11184
|
+
},
|
|
11185
|
+
"privacy": "private",
|
|
11186
|
+
"default": "0"
|
|
11187
|
+
},
|
|
11188
|
+
{
|
|
11189
|
+
"kind": "method",
|
|
11190
|
+
"name": "_getScope",
|
|
11191
|
+
"privacy": "private",
|
|
11192
|
+
"description": "Functions\n--------------------------------------------------------------------------"
|
|
11193
|
+
},
|
|
11194
|
+
{
|
|
11195
|
+
"kind": "method",
|
|
11196
|
+
"name": "_isTrackable",
|
|
11197
|
+
"privacy": "private",
|
|
11198
|
+
"return": {
|
|
11199
|
+
"type": {
|
|
11200
|
+
"text": "boolean"
|
|
11201
|
+
}
|
|
11202
|
+
},
|
|
11203
|
+
"parameters": [
|
|
11204
|
+
{
|
|
11205
|
+
"name": "el",
|
|
11206
|
+
"type": {
|
|
11207
|
+
"text": "HTMLElement"
|
|
11208
|
+
}
|
|
11209
|
+
}
|
|
11210
|
+
],
|
|
11211
|
+
"description": "Checks if the header element is trackable:\nMeaning the element doesn't contain hidden data attribute, or is hidden, or is inside an accordion.\nVisibility must be true."
|
|
11212
|
+
},
|
|
11213
|
+
{
|
|
11214
|
+
"kind": "field",
|
|
11215
|
+
"name": "_scheduleRebuild",
|
|
11216
|
+
"privacy": "private"
|
|
11217
|
+
},
|
|
11218
|
+
{
|
|
11219
|
+
"kind": "method",
|
|
11220
|
+
"name": "_slugify",
|
|
11221
|
+
"privacy": "private",
|
|
11222
|
+
"return": {
|
|
11223
|
+
"type": {
|
|
11224
|
+
"text": "string"
|
|
11225
|
+
}
|
|
11226
|
+
},
|
|
11227
|
+
"parameters": [
|
|
11228
|
+
{
|
|
11229
|
+
"name": "text",
|
|
11230
|
+
"type": {
|
|
11231
|
+
"text": "string"
|
|
11232
|
+
}
|
|
11233
|
+
}
|
|
11234
|
+
]
|
|
11235
|
+
},
|
|
11236
|
+
{
|
|
11237
|
+
"kind": "method",
|
|
11238
|
+
"name": "_applyScrollMargin",
|
|
11239
|
+
"privacy": "private"
|
|
11240
|
+
},
|
|
11241
|
+
{
|
|
11242
|
+
"kind": "field",
|
|
11243
|
+
"name": "_rebuild",
|
|
11244
|
+
"privacy": "private",
|
|
11245
|
+
"description": "*\nCollects the headings, assigns ids where missing, and updates state if changed.\nRebuilds the content in this function."
|
|
11246
|
+
},
|
|
11247
|
+
{
|
|
11248
|
+
"kind": "method",
|
|
11249
|
+
"name": "_computeActive",
|
|
11250
|
+
"privacy": "private",
|
|
11251
|
+
"description": "Active item = the last tracked heading with the top edge at or above the trigger line. Not \"nearest to top\" since that would flicker at the boundaries"
|
|
11252
|
+
},
|
|
11253
|
+
{
|
|
11254
|
+
"kind": "method",
|
|
11255
|
+
"name": "_holdActive",
|
|
11256
|
+
"privacy": "private",
|
|
11257
|
+
"description": "Keeps the clicked link active until scrolling has been idle for 150ms."
|
|
11258
|
+
},
|
|
11259
|
+
{
|
|
11260
|
+
"kind": "field",
|
|
11261
|
+
"name": "_onScroll",
|
|
11262
|
+
"privacy": "private"
|
|
11263
|
+
},
|
|
11264
|
+
{
|
|
11265
|
+
"kind": "method",
|
|
11266
|
+
"name": "_handleClick",
|
|
11267
|
+
"privacy": "private",
|
|
11268
|
+
"parameters": [
|
|
11269
|
+
{
|
|
11270
|
+
"name": "e",
|
|
11271
|
+
"type": {
|
|
11272
|
+
"text": "MouseEvent"
|
|
11273
|
+
}
|
|
11274
|
+
},
|
|
11275
|
+
{
|
|
11276
|
+
"name": "item",
|
|
11277
|
+
"type": {
|
|
11278
|
+
"text": "TrackedHeading"
|
|
11279
|
+
}
|
|
11280
|
+
},
|
|
11281
|
+
{
|
|
11282
|
+
"name": "index",
|
|
11283
|
+
"type": {
|
|
11284
|
+
"text": "number"
|
|
11285
|
+
}
|
|
11286
|
+
}
|
|
11287
|
+
],
|
|
11288
|
+
"description": "Event Handlers\n--------------------------------------------------------------------------"
|
|
11289
|
+
}
|
|
11290
|
+
],
|
|
11291
|
+
"events": [
|
|
11292
|
+
{
|
|
11293
|
+
"type": {
|
|
11294
|
+
"text": "NysOnThisPageClickEvent"
|
|
11295
|
+
},
|
|
11296
|
+
"description": "Fired when a link is activated, by mouse or keyboard. Detail: `{id, label, index}`.",
|
|
11297
|
+
"name": "nys-click"
|
|
11298
|
+
}
|
|
11299
|
+
],
|
|
11300
|
+
"attributes": [
|
|
11301
|
+
{
|
|
11302
|
+
"name": "id",
|
|
11303
|
+
"type": {
|
|
11304
|
+
"text": "string"
|
|
11305
|
+
},
|
|
11306
|
+
"default": "\"\"",
|
|
11307
|
+
"description": "Unique identifier. Auto-generated by the shared base if not provided.",
|
|
11308
|
+
"fieldName": "id"
|
|
11309
|
+
},
|
|
11310
|
+
{
|
|
11311
|
+
"name": "headingTracker",
|
|
11312
|
+
"type": {
|
|
11313
|
+
"text": "HeadingTag"
|
|
11314
|
+
},
|
|
11315
|
+
"default": "\"h2\"",
|
|
11316
|
+
"description": "Heading level to track and link. `h1` is excluded.",
|
|
11317
|
+
"fieldName": "headingTracker"
|
|
11318
|
+
},
|
|
11319
|
+
{
|
|
11320
|
+
"name": "heading",
|
|
11321
|
+
"type": {
|
|
11322
|
+
"text": "string"
|
|
11323
|
+
},
|
|
11324
|
+
"default": "\"On this page\"",
|
|
11325
|
+
"description": "Nav heading text.",
|
|
11326
|
+
"fieldName": "heading"
|
|
11327
|
+
},
|
|
11328
|
+
{
|
|
11329
|
+
"name": "scope",
|
|
11330
|
+
"type": {
|
|
11331
|
+
"text": "string"
|
|
11332
|
+
},
|
|
11333
|
+
"default": "\"main\"",
|
|
11334
|
+
"description": "CSS selector for the container whose headings are tracked.",
|
|
11335
|
+
"fieldName": "scope"
|
|
11336
|
+
},
|
|
11337
|
+
{
|
|
11338
|
+
"name": "disableSticky",
|
|
11339
|
+
"type": {
|
|
11340
|
+
"text": "boolean"
|
|
11341
|
+
},
|
|
11342
|
+
"default": "false",
|
|
11343
|
+
"description": "Turns off the sticky behavior, so the nav scrolls with the page.\nSticky only applies on viewports 480px wide or larger.",
|
|
11344
|
+
"fieldName": "disableSticky"
|
|
11345
|
+
},
|
|
11346
|
+
{
|
|
11347
|
+
"name": "offset",
|
|
11348
|
+
"type": {
|
|
11349
|
+
"text": "number"
|
|
11350
|
+
},
|
|
11351
|
+
"default": "80",
|
|
11352
|
+
"description": "Distance (px) from the viewport top to the trigger line. Also sets\n`scroll-margin-top` on tracked headings and the sticky `top` value.",
|
|
11353
|
+
"fieldName": "offset"
|
|
11354
|
+
},
|
|
11355
|
+
{
|
|
11356
|
+
"name": "disableSmoothScroll",
|
|
11357
|
+
"type": {
|
|
11358
|
+
"text": "boolean"
|
|
11359
|
+
},
|
|
11360
|
+
"default": "false",
|
|
11361
|
+
"description": "Turns off smooth scrolling. Already off for visitors with `prefers-reduced-motion`.",
|
|
11362
|
+
"fieldName": "disableSmoothScroll"
|
|
11363
|
+
},
|
|
11364
|
+
{
|
|
11365
|
+
"name": "hashBehavior",
|
|
11366
|
+
"type": {
|
|
11367
|
+
"text": "HashBehavior"
|
|
11368
|
+
},
|
|
11369
|
+
"default": "\"none\"",
|
|
11370
|
+
"description": "`hash` pushes history, `replace` updates the URL silently, `none` leaves it alone.",
|
|
11371
|
+
"fieldName": "hashBehavior"
|
|
11372
|
+
}
|
|
11373
|
+
],
|
|
11374
|
+
"superclass": {
|
|
11375
|
+
"name": "NysElement",
|
|
11376
|
+
"package": "@nysds/internals"
|
|
11377
|
+
},
|
|
11378
|
+
"tagName": "nys-onthispage",
|
|
11379
|
+
"customElement": true,
|
|
11380
|
+
"summary": "In-page navigation that links to page headings and highlights the current section.",
|
|
11381
|
+
"examples": [
|
|
11382
|
+
{
|
|
11383
|
+
"title": "Basic",
|
|
11384
|
+
"code": "<div style=\"display: flex; gap: 2rem; align-items: flex-start;\">\n<nys-onthispage style=\"flex: 0 0 220px;\"></nys-onthispage>\n\n<main style=\"flex: 1; min-width: 0;\">\n<h1>Apply for a permit</h1>\n<p>Use this guide to find out if you qualify and how to apply.</p>\n\n<h2>Eligibility</h2>\n<p>You must be a New York State resident aged 18 or older.</p>\n<p>Additional eligibility requirements may apply.</p>\n<p>Review the requirements before submitting your application.</p>\n\n<h2>How to apply</h2>\n<p>Complete the online form and upload your supporting documents.</p>\n<p>Make sure all information is accurate before submitting.</p>\n<p>Keep a copy of your application for your records.</p>\n\n<h2>Required documents</h2>\n<p>Bring a valid proof of identity, proof of address, and any other supporting documentation.</p>\n<p>Additional documents may be requested during review.</p>\n<p>Ensure your documents are current and legible.</p>\n\n<h2>What happens next</h2>\n<p>We review applications within 10 business days.</p>\n<p>You may be contacted if additional information is needed.</p>\n<p>You will receive a notification when a decision has been made.</p>\n</main>\n</div>",
|
|
11385
|
+
"lang": "html"
|
|
11386
|
+
},
|
|
11387
|
+
{
|
|
11388
|
+
"title": "Turn off sticky",
|
|
11389
|
+
"code": "<div style=\"display: flex; gap: 2rem; align-items: flex-start;\">\n<nys-onthispage disableSticky offset=\"24\"></nys-onthispage>\n\n<main style=\"flex: 1; min-width: 0;\">\n<h1>Apply for a permit</h1>\n<p>Use this guide to find out if you qualify and how to apply.</p>\n\n<h2>Eligibility</h2>\n<p>You must be a New York State resident aged 18 or older.</p>\n<p style=\"min-height: 60vh;\">Review the requirements before submitting your application.</p>\n\n<h2>How to apply</h2>\n<p>Complete the online form and upload your supporting documents.</p>\n<p style=\"min-height: 60vh;\">Keep a copy of your application for your records.</p>\n\n<h2>Required documents</h2>\n<p>Bring a valid proof of identity, proof of address, and any other supporting documentation.</p>\n<p style=\"min-height: 60vh;\">Ensure your documents are current and legible.</p>\n\n<h2>What happens next</h2>\n<p>We review applications within 10 business days.</p>\n<p style=\"min-height: 60vh;\">You will receive a notification when a decision has been made.</p>\n</main>\n</div>",
|
|
11390
|
+
"lang": "html"
|
|
11391
|
+
},
|
|
11392
|
+
{
|
|
11393
|
+
"title": "Custom heading",
|
|
11394
|
+
"code": "<div style=\"display: flex; gap: 2rem; align-items: flex-start;\">\n<nys-onthispage\nheading=\"In this guide\"\n></nys-onthispage>\n\n<main style=\"flex: 1; min-width: 0;\">\n<h1>Apply for a permit</h1>\n\n<h2>Eligibility</h2>\n<p>You must be a New York State resident aged 18 or older.</p>\n\n<h2>How to apply</h2>\n<p>Complete the online form and upload your supporting documents.</p>\n\n<h2>What happens next</h2>\n<p>We review applications within 10 business days.</p>\n</main>\n</div>",
|
|
11395
|
+
"lang": "html"
|
|
11396
|
+
},
|
|
11397
|
+
{
|
|
11398
|
+
"title": "Track a different heading level",
|
|
11399
|
+
"code": "<nys-onthispage headingTracker=\"h3\" scope=\"#guide\"></nys-onthispage>\n\n<article id=\"guide\">\n<h1>Part 1 (h1 tag)</h1>\n<h2>Part 2 (h2 tag)</h2>\n<h3>Eligibility (h3 tag)</h3>\n<h3>How to apply (h3 tag)</h3>\n</article>",
|
|
11400
|
+
"lang": "html"
|
|
11401
|
+
},
|
|
11402
|
+
{
|
|
11403
|
+
"title": "Exclude a heading",
|
|
11404
|
+
"code": "<div style=\"display: flex; gap: 2rem; align-items: flex-start;\">\n<nys-onthispage></nys-onthispage>\n\n<main style=\"flex: 1; min-width: 0;\">\n<h1>Apply for a permit</h1>\n\n<h2>Eligibility</h2>\n<p>You must be a New York State resident aged 18 or older.</p>\n\n<h2>How to apply</h2>\n<p>Complete the online form and upload your supporting documents.</p>\n\n<h2 data-nys-onthispage-ignore>Related links</h2>\n<p>This heading does not appear in the list.</p>\n</main>\n</div>",
|
|
11405
|
+
"lang": "html"
|
|
11406
|
+
},
|
|
11407
|
+
{
|
|
11408
|
+
"title": "Use your own heading ids",
|
|
11409
|
+
"code": "<div style=\"display: flex; gap: 2rem; align-items: flex-start;\">\n<nys-onthispage style=\"flex: 0 0 220px;\"></nys-onthispage>\n\n<main style=\"flex: 1; min-width: 0;\">\n<h1>Apply for a permit</h1>\n\n<h2 id=\"eligibility\">Eligibility</h2>\n<p>The link uses your id: #eligibility.</p>\n\n<h2>How to apply</h2>\n<p>No id set, so one is generated: #how-to-apply.</p>\n\n<h2>How to apply</h2>\n<p>Same text, so the generated id gets a suffix: #how-to-apply-2.</p>\n</main>\n</div>",
|
|
11410
|
+
"lang": "html"
|
|
11411
|
+
},
|
|
11412
|
+
{
|
|
11413
|
+
"title": "Update the URL hash",
|
|
11414
|
+
"code": "<div style=\"display: flex; gap: 2rem; align-items: flex-start;\">\n<nys-onthispage\nhashBehavior=\"replace\"\nstyle=\"flex: 0 0 220px;\"\n></nys-onthispage>\n\n<main style=\"flex: 1; min-width: 0;\">\n<h1>Apply for a permit</h1>\n\n<h2>Eligibility</h2>\n<p style=\"min-height: 80vh;\">You must be a New York State resident.</p>\n\n<h2>How to apply</h2>\n<p style=\"min-height: 80vh;\">Complete the online form.</p>\n\n<h2>What happens next</h2>\n<p style=\"min-height: 80vh;\">We review applications within 10 business days.</p>\n</main>\n</div>",
|
|
11415
|
+
"lang": "html"
|
|
11416
|
+
},
|
|
11417
|
+
{
|
|
11418
|
+
"title": "Turn off smooth scrolling",
|
|
11419
|
+
"code": "<div style=\"display: flex; gap: 2rem; align-items: flex-start;\">\n<nys-onthispage\ndisableSmoothScroll\nstyle=\"flex: 0 0 220px;\"\n></nys-onthispage>\n\n<main style=\"flex: 1; min-width: 0;\">\n<h1>Apply for a permit</h1>\n\n<h2>Eligibility</h2>\n<p style=\"min-height: 80vh;\">You must be a New York State resident.</p>\n\n<h2>How to apply</h2>\n<p style=\"min-height: 80vh;\">Complete the online form.</p>\n\n<h2>What happens next</h2>\n<p style=\"min-height: 80vh;\">We review applications within 10 business days.</p>\n</main>\n</div>",
|
|
11420
|
+
"lang": "html"
|
|
11421
|
+
},
|
|
11422
|
+
{
|
|
11423
|
+
"title": "Page layout",
|
|
11424
|
+
"code": "<nys-unavheader></nys-unavheader>\n\n<nys-globalheader appName=\"NYS Design System\" homepageLink=\"/\">\n<ul>\n<li><a href=\"#\">Item 1</a></li>\n<li><a href=\"#\">Item 2</a></li>\n<li><a href=\"#\">Item 3</a></li>\n<li><a href=\"#\">Item 4</a></li>\n<li><a href=\"#\">Item 5</a></li>\n</ul>\n</nys-globalheader>\n\n<div class=\"nys-grid-container\">\n<div class=\"nys-grid-row nys-grid-gap\">\n<main class=\"nys-desktop:nys-grid-col-9\">\n<h1>Welcome to the Empire State of Mind</h1>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit? Nope. Here, we say: grab a bagel, check the Erie Canal, and see what the Adirondacks are up to today.</p>\n\n<h2>Apple picking season</h2>\n<p style=\"min-height: 60vh;\">Orchards from the Hudson Valley to the Finger Lakes are open. Bring a basket, a sweater, and a strong opinion about cider donuts. Honeycrisp is the correct answer, but we will hear other opinions.</p>\n\n<h2>Pizza by the slice</h2>\n<p style=\"min-height: 60vh;\">Fold it. Do not eat it with a fork. A proper slice is hot, floppy, and cheaper than your parking meter. Every borough believes theirs is the best, and every borough is slightly right.</p>\n\n<h2>Road trip to Niagara Falls</h2>\n<p style=\"min-height: 60vh;\">Pack snacks and head west on the Thruway. Rest stops are plentiful, the falls are loud, and the mist is free. Bring a poncho if you plan to get close.</p>\n\n<h2>Snow day survival guide</h2>\n<p style=\"min-height: 60vh;\">Upstate gets a lot of snow, and Upstate is not impressed. Shovel early, check on your neighbors, and keep the hot chocolate within reach.</p>\n</main>\n\n<aside class=\"nys-desktop:nys-grid-col-3 nys-order-first nys-desktop:nys-order-last\" style=\"margin-top: var(--nys-space-600)\">\n<nys-onthispage offset=\"24\"></nys-onthispage>\n</aside>\n</div>\n</div>\n\n<nys-globalfooter agencyName=\"NYS Design System\" homepageLink=\"/\">\n<ul>\n<li><a href=\"#\">Privacy Policy</a></li>\n<li><a href=\"#\">Terms of Use</a></li>\n</ul>\n</nys-globalfooter>\n<nys-unavfooter></nys-unavfooter>",
|
|
11425
|
+
"lang": "html"
|
|
11426
|
+
},
|
|
11427
|
+
{
|
|
11428
|
+
"title": "Listen for link activation",
|
|
11429
|
+
"code": "<div style=\"display: flex; gap: 2rem; align-items: flex-start;\">\n<nys-onthispage id=\"toc\" style=\"flex: 0 0 220px;\"></nys-onthispage>\n\n<main style=\"flex: 1; min-width: 0;\">\n<h1>Apply for a permit</h1>\n\n<h2>Eligibility</h2>\n<p>You must be a New York State resident aged 18 or older.</p>\n\n<h2>How to apply</h2>\n<p>Complete the online form and upload your supporting documents.</p>\n\n<h2>What happens next</h2>\n<p>We review applications within 10 business days.</p>\n</main>\n</div>\n\n<script>\ndocument.querySelector(\"#toc\").addEventListener(\"nys-click\", (e) => {\nconst { id, label, index } = e.detail;\nconsole.log(`Clicked \"${label}\" (#${id}, position ${index})`);\n});\n</script>",
|
|
11430
|
+
"lang": "html"
|
|
11431
|
+
}
|
|
11432
|
+
],
|
|
11433
|
+
"usage": [
|
|
11434
|
+
"Use as a table of contents on lengthy pages to give a structural overview and let users jump to a section.",
|
|
11435
|
+
"Use on pages with at least three distinct sections, or content longer than three screen heights.",
|
|
11436
|
+
"Keep the link order the same as the order of the section headings on the page.",
|
|
11437
|
+
"Use \"On this page\" as the heading so the nav is clearly labeled and stands apart from other links.",
|
|
11438
|
+
"Keep the link text identical to the heading it links to.",
|
|
11439
|
+
"Let link text wrap to a second line instead of truncating it.",
|
|
11440
|
+
"Clearly show the active link so users can track their position as they scroll or after they click a link.",
|
|
11441
|
+
"On desktop, place it in the left sidebar. If vertical navigation is on the left, place it in the right sidebar.",
|
|
11442
|
+
"On tablet and mobile, place it above the main content and below the page heading.",
|
|
11443
|
+
"Don't use on pages with minimal content or a small number of sections, where scrolling isn't an issue.",
|
|
11444
|
+
"Don't use to link to other pages. Use `<nys-verticalnav>` instead.",
|
|
11445
|
+
"Don't use for heading levels lower than H3, such as H4, H5, or H6.",
|
|
11446
|
+
"Don't shorten, rephrase, or summarize a heading for its link."
|
|
11447
|
+
]
|
|
11448
|
+
}
|
|
11449
|
+
],
|
|
11450
|
+
"exports": [
|
|
11451
|
+
{
|
|
11452
|
+
"kind": "custom-element-definition",
|
|
11453
|
+
"name": "nys-onthispage",
|
|
11454
|
+
"declaration": {
|
|
11455
|
+
"name": "NysOnthispage",
|
|
11456
|
+
"module": "packages/nys-onthispage/src/nys-onthispage.ts"
|
|
11457
|
+
}
|
|
11458
|
+
},
|
|
11459
|
+
{
|
|
11460
|
+
"kind": "js",
|
|
11461
|
+
"name": "NysOnthispage",
|
|
11462
|
+
"declaration": {
|
|
11463
|
+
"name": "NysOnthispage",
|
|
11464
|
+
"module": "packages/nys-onthispage/src/nys-onthispage.ts"
|
|
11465
|
+
}
|
|
11466
|
+
}
|
|
11467
|
+
]
|
|
11468
|
+
},
|
|
10994
11469
|
{
|
|
10995
11470
|
"kind": "javascript-module",
|
|
10996
11471
|
"path": "packages/nys-pagination/src/index.ts",
|
|
@@ -18980,7 +19455,7 @@
|
|
|
18980
19455
|
},
|
|
18981
19456
|
{
|
|
18982
19457
|
"title": "Dropdown group",
|
|
18983
|
-
"code": "<nys-verticalnav heading=\"NYS Design System\" headingLevel=\"h2\">\n<ul>\n<li><a href=\"/\">Foundations</a></li>\n<li><a href=\"/components\">Components</a></li>\n<li>\n<nys-verticalnavgroup label=\"Accessibility\">\n<ul>\n <li><a href=\"\">WCAG Guidelines</a></li>\n <li><a href=\"\">Screen Readers</a></li>\n <li><a href=\"\">Color Contrast</a></li>\n</ul>\n</nys-verticalnavgroup>\n</li>\n<li>\n<h3>Resources</h3>\n<ul>\n<li><a href=\"\">Design Tokens</a></li>\n<li><a href=\"\">Utilities</a></li>\n</ul>\n</li>\n</ul>\n</nys-verticalnav>",
|
|
19458
|
+
"code": "<nys-verticalnav heading=\"NYS Design System\" headingLevel=\"h2\">\n<ul>\n<li><a href=\"/\">Foundations</a></li>\n<li><a href=\"/components\">Components</a></li>\n<li>\n<nys-verticalnavgroup label=\"Accessibility\">\n<ul>\n <li><a href=\"\">WCAG Guidelines</a></li>\n <li><a href=\"\">Screen Readers</a></li>\n <li><a href=\"\">Color Contrast</a></li>\n <li><a href=\"\">Accordion Accessibility Checklist</a></li>\n <li><a href=\"\">Build an Accessible Accordion</a></li>\n</ul>\n</nys-verticalnavgroup>\n</li>\n<li>\n<h3>Resources</h3>\n<ul>\n<li><a href=\"\">Design Tokens</a></li>\n<li><a href=\"\">Utilities</a></li>\n</ul>\n</li>\n</ul>\n</nys-verticalnav>",
|
|
18984
19459
|
"lang": "html"
|
|
18985
19460
|
},
|
|
18986
19461
|
{
|