@nysds/components 1.16.1 → 1.18.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 (64) hide show
  1. package/custom-elements.json +4245 -3280
  2. package/dist/.vscode/vscode.html-custom-data.json +114 -30
  3. package/dist/custom-elements.json +4245 -3280
  4. package/dist/nysds.es.js +2550 -1977
  5. package/dist/nysds.es.js.map +1 -1
  6. package/dist/nysds.js +186 -164
  7. package/dist/nysds.js.map +1 -1
  8. package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +15 -3
  9. package/dist/packages/nys-badge/src/nys-badge.d.ts +2 -0
  10. package/dist/packages/nys-breadcrumbs/src/index.d.ts +1 -0
  11. package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +119 -0
  12. package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.figma.d.ts +1 -0
  13. package/dist/packages/nys-button/src/nys-button.d.ts +2 -2
  14. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +0 -2
  15. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +1 -4
  16. package/dist/packages/nys-combobox/src/nys-combobox.d.ts +8 -0
  17. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +1 -0
  18. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +3 -1
  19. package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +2 -2
  20. package/dist/packages/nys-label/src/nys-label.d.ts +9 -6
  21. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +0 -2
  22. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +1 -4
  23. package/dist/packages/nys-tab/src/index.d.ts +3 -0
  24. package/dist/packages/nys-tab/src/nys-tab.d.ts +116 -0
  25. package/dist/packages/nys-tab/src/nys-tab.figma.d.ts +1 -0
  26. package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +197 -0
  27. package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +46 -0
  28. package/dist/packages/nys-table/src/nys-table.d.ts +10 -7
  29. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +1 -1
  30. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +2 -1
  31. package/dist/packages/nys-video/src/nys-video.d.ts +25 -0
  32. package/dist/src/index.d.ts +2 -0
  33. package/package.json +3 -2
  34. package/packages/react/NysBacktotop.d.ts +1 -1
  35. package/packages/react/NysBadge.d.ts +3 -0
  36. package/packages/react/NysBadge.js +2 -0
  37. package/packages/react/NysBreadcrumbItem.d.ts +72 -0
  38. package/packages/react/NysBreadcrumbItem.js +42 -0
  39. package/packages/react/NysBreadcrumbs.d.ts +89 -0
  40. package/packages/react/NysBreadcrumbs.js +50 -0
  41. package/packages/react/NysButton.d.ts +2 -2
  42. package/packages/react/NysCheckbox.d.ts +0 -3
  43. package/packages/react/NysCheckbox.js +0 -2
  44. package/packages/react/NysCheckboxgroup.d.ts +0 -3
  45. package/packages/react/NysCheckboxgroup.js +0 -2
  46. package/packages/react/NysErrorMessage.d.ts +3 -0
  47. package/packages/react/NysErrorMessage.js +2 -1
  48. package/packages/react/NysLabel.d.ts +16 -4
  49. package/packages/react/NysLabel.js +17 -3
  50. package/packages/react/NysRadiobutton.d.ts +0 -3
  51. package/packages/react/NysRadiobutton.js +0 -2
  52. package/packages/react/NysRadiogroup.d.ts +0 -3
  53. package/packages/react/NysRadiogroup.js +0 -2
  54. package/packages/react/NysTab.d.ts +90 -0
  55. package/packages/react/NysTab.js +39 -0
  56. package/packages/react/NysTabgroup.d.ts +75 -0
  57. package/packages/react/NysTabgroup.js +22 -0
  58. package/packages/react/NysTabpanel.d.ts +63 -0
  59. package/packages/react/NysTabpanel.js +21 -0
  60. package/packages/react/NysVideo.d.ts +7 -1
  61. package/packages/react/NysVideo.js +14 -1
  62. package/packages/react/index.d.ts +4 -0
  63. package/packages/react/index.js +4 -0
  64. package/packages/react/nysds-jsx.d.ts +167 -14
@@ -163,6 +163,8 @@ export type NysBadgeProps = {
163
163
  prefixLabel?: string;
164
164
  /** Primary label text displayed in the badge. */
165
165
  label?: string;
166
+ /** Screen reader text appended after the label for additional context. */
167
+ srText?: string;
166
168
  /** */
167
169
  variant?: "strong" | "";
168
170
  /** */
@@ -171,6 +173,32 @@ export type NysBadgeProps = {
171
173
  suffixicon?: string | boolean;
172
174
  };
173
175
 
176
+ export type NysBreadcrumbsProps = {
177
+ /** Unique identifier. Auto-generated if not provided. */
178
+ id?: string;
179
+ /** Accessible label for the `<nav>` landmark. Defaults to "path to this page" if not set.
180
+ Override when multiple crumbs exist on the same page. */
181
+ ariaLabel?: string;
182
+ /** Controls the visual size of the breadcrumb text and spacing: `sm` for dense layouts, `md` (default) for standard use. */
183
+ size?: "sm" | "md" | "";
184
+ /** On mobile, renders the trail as a single back-to-parent link pointing to the item before the current page.
185
+ Has no effect on desktop or when only one item is present (which always renders as a back link). */
186
+ backToParent?: boolean;
187
+ /** Forces the trail into its collapsed state.
188
+ It shows only the first item, an ellipsis, and the last two items.
189
+ The user can still expand the trail by clicking the ellipsis. */
190
+ collapsed?: boolean;
191
+ /** Renders a filled light theme background bar behind the breadcrumb trail. */
192
+ backgroundBar?: boolean;
193
+ /** Prevents interaction. */
194
+ disabled?: boolean;
195
+
196
+ /** */
197
+ "onnys-expand"?: (e: CustomEvent<CustomEvent>) => void;
198
+ /** Fired when the user clicks the ellipsis to expand the trail. */
199
+ "onnys-breadcrumbs-expand"?: (e: CustomEvent<never>) => void;
200
+ };
201
+
174
202
  export type NysButtonProps = {
175
203
  /** Unique identifier. Auto-generated if not provided. */
176
204
  id?: string;
@@ -190,9 +218,9 @@ export type NysButtonProps = {
190
218
  ariaLabel?: string;
191
219
  /** ID of controlled element (e.g., dropdown or modal). Sets `aria-controls`. */
192
220
  ariaControls?: string;
193
- /** Material Symbol icon before label. Not shown for `text` variant or `circle` mode. */
221
+ /** Material Symbol icon before label. Not shown for `circle` mode. */
194
222
  prefixIcon?: string;
195
- /** Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `text` variant or `circle` mode. */
223
+ /** Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode. */
196
224
  suffixIcon?: string;
197
225
  /** Renders circular icon-only button. Requires `icon` prop. `label` becomes aria-label. */
198
226
  circle?: boolean;
@@ -249,8 +277,6 @@ export type NysCheckboxProps = {
249
277
  groupExist?: boolean;
250
278
  /** Renders as tile with larger clickable area. Apply to group for consistency. */
251
279
  tile?: boolean;
252
- /** Adjusts colors for dark backgrounds. */
253
- inverted?: boolean;
254
280
  /** Tooltip text shown on hover/focus of info icon. */
255
281
  tooltip?: string;
256
282
  /** Checkbox size: `sm` (24px) or `md` (32px, default). */
@@ -296,8 +322,6 @@ export type NysCheckboxgroupProps = {
296
322
  tile?: boolean;
297
323
  /** Tooltip text shown on hover/focus of info icon. */
298
324
  tooltip?: string;
299
- /** Adjusts colors for dark backgrounds. Applied to all children. */
300
- inverted?: boolean;
301
325
  /** Form `id` to associate with. Applied to all children. */
302
326
  form?: string | null;
303
327
  /** Checkbox size for all children: `sm` (24px) or `md` (32px, default). */
@@ -425,6 +449,8 @@ export type NysDropdownMenuItemProps = {
425
449
  };
426
450
 
427
451
  export type NysErrorMessageProps = {
452
+ /** The "id" of the error message. */
453
+ id?: string;
428
454
  /** Whether to display the error message. */
429
455
  showError?: boolean;
430
456
  /** Error text to display. Falls back to native validation message if available. */
@@ -537,8 +563,8 @@ export type NysIconProps = {
537
563
  };
538
564
 
539
565
  export type NysLabelProps = {
540
- /** ID of the form element this label is associated with. */
541
- for?: string;
566
+ /** The ID of the label. */
567
+ id?: string;
542
568
  /** Label text displayed above the form field. */
543
569
  label?: string;
544
570
  /** Helper text displayed below the label. */
@@ -549,6 +575,9 @@ export type NysLabelProps = {
549
575
  inverted?: boolean;
550
576
  /** Tooltip text shown on hover/focus of info icon next to label. */
551
577
  tooltip?: string;
578
+
579
+ /** */
580
+ "onnys-label-click"?: (e: CustomEvent<CustomEvent>) => void;
552
581
  };
553
582
 
554
583
  export type NysModalProps = {
@@ -604,8 +633,6 @@ export type NysRadiobuttonProps = {
604
633
  name?: string;
605
634
  /** Value submitted when this radio is selected. */
606
635
  value?: string;
607
- /** Adjusts colors for dark backgrounds. */
608
- inverted?: boolean;
609
636
  /** Form `id` to associate with. */
610
637
  form?: string | null;
611
638
  /** Radio size: `sm` (24px) or `md` (32px, default). */
@@ -652,8 +679,6 @@ export type NysRadiogroupProps = {
652
679
  tile?: boolean;
653
680
  /** Tooltip text shown on hover/focus of info icon. */
654
681
  tooltip?: string;
655
- /** Adjusts colors for dark backgrounds. Applied to all children. */
656
- inverted?: boolean;
657
682
  /** Form `id` to associate with. Applied to all children. */
658
683
  form?: string | null;
659
684
  /** Radio size for all children: `sm` (24px) or `md` (32px, default). */
@@ -750,6 +775,45 @@ export type NysStepperProps = {
750
775
  isCompactExpanded?: boolean;
751
776
  };
752
777
 
778
+ export type NysTabProps = {
779
+ /** Unique identifier for the tab element.
780
+ Reflected to the DOM attribute so `aria-controls` references resolve. */
781
+ id?: string;
782
+ /** Visible text label rendered inside the inner `<span>`. */
783
+ label?: string;
784
+ /** Whether this tab is the currently active tab.
785
+ Managed by `<nys-tabgroup>`; reflected for CSS attribute selectors. */
786
+ selected?: boolean;
787
+ /** Whether this tab is disabled.
788
+ Reflected to the DOM attribute for CSS styling. */
789
+ disabled?: boolean;
790
+
791
+ /** Dispatched when the tab is activated via click or Enter / Space. Bubbles and crosses shadow DOM boundaries. `detail: { id: string, label: string }` */
792
+ "onnys-tab-select"?: (e: CustomEvent<CustomEvent>) => void;
793
+ /** Dispatched when the host receives focus. Bubbles and crosses shadow DOM boundaries. `detail: { id: string }` */
794
+ "onnys-tab-focus"?: (e: CustomEvent<never>) => void;
795
+ /** Dispatched when the host loses focus. Bubbles and crosses shadow DOM boundaries. `detail: { id: string }` */
796
+ "onnys-tab-blur"?: (e: CustomEvent<never>) => void;
797
+ };
798
+
799
+ export type NysTabgroupProps = {
800
+ /** Unique identifier for the tabgroup element.
801
+ If not provided, one is auto-generated in `connectedCallback`.
802
+ Reflected to the DOM attribute. */
803
+ id?: string;
804
+ /** The name of the tab group.
805
+ Used for form submission and accessibility purposes. */
806
+ name?: string;
807
+ };
808
+
809
+ export type NysTabpanelProps = {
810
+ /** Unique identifier for the panel element.
811
+ If not provided, one is auto-generated in `connectedCallback`.
812
+ Reflected to the DOM attribute so `aria-controls` references on sibling
813
+ `<nys-tab>` elements resolve correctly. */
814
+ id?: string;
815
+ };
816
+
753
817
  export type NysTableProps = {
754
818
  /** */
755
819
  id?: string;
@@ -965,6 +1029,9 @@ Falls back to YouTube's auto-generated thumbnail if not provided. */
965
1029
  autoplay?: boolean;
966
1030
  /** Prevents the video from being played */
967
1031
  disabled?: boolean;
1032
+
1033
+ /** Fired when the user clicks the thumbnail to load the player. */
1034
+ "onnys-video-play"?: (e: CustomEvent<never>) => void;
968
1035
  };
969
1036
 
970
1037
  export type CustomElements = {
@@ -1020,7 +1087,7 @@ export type CustomElements = {
1020
1087
  "nys-avatar": Partial<NysAvatarProps & BaseProps & BaseEvents>;
1021
1088
 
1022
1089
  /**
1023
- * Floating back-to-top button with auto-show behavior and smooth scroll.
1090
+ * Floating back-to-top button with auto-show behavior, smooth scroll, and focus management.
1024
1091
  * ---
1025
1092
  *
1026
1093
  */
@@ -1033,6 +1100,20 @@ export type CustomElements = {
1033
1100
  */
1034
1101
  "nys-badge": Partial<NysBadgeProps & BaseProps & BaseEvents>;
1035
1102
 
1103
+ /**
1104
+ * Breadcrumb navigation trail with responsive collapse support.
1105
+ * ---
1106
+ *
1107
+ *
1108
+ * ### **Events:**
1109
+ * - **nys-expand**
1110
+ * - **nys-breadcrumbs-expand** - Fired when the user clicks the ellipsis to expand the trail.
1111
+ *
1112
+ * ### **Slots:**
1113
+ * - _default_ - One or more `nys-breadcrumbitem` elements defining the trail.
1114
+ */
1115
+ "nys-breadcrumbs": Partial<NysBreadcrumbsProps & BaseProps & BaseEvents>;
1116
+
1036
1117
  /**
1037
1118
  * Button for actions and CTAs with variants, sizes, and icon support.
1038
1119
  * ---
@@ -1224,6 +1305,9 @@ export type CustomElements = {
1224
1305
  * ---
1225
1306
  *
1226
1307
  *
1308
+ * ### **Events:**
1309
+ * - **nys-label-click**
1310
+ *
1227
1311
  * ### **Slots:**
1228
1312
  * - **description** - Custom HTML description content below the label.
1229
1313
  */
@@ -1345,6 +1429,72 @@ export type CustomElements = {
1345
1429
  */
1346
1430
  "nys-stepper": Partial<NysStepperProps & BaseProps & BaseEvents>;
1347
1431
 
1432
+ /**
1433
+ * `<nys-tab>` is a single tab within a `<nys-tabgroup>`.
1434
+ *
1435
+ * The host element carries `role="tab"`, `tabindex`, `aria-selected`,
1436
+ * `aria-controls`, and `aria-disabled` so assistive technologies see the
1437
+ * correct ARIA tab semantics on the element that is actually focused.
1438
+ * `<nys-tabgroup>` manages `tabindex`, `aria-selected`, and `aria-controls`
1439
+ * via `_applySelection`; do not set them directly on this element.
1440
+ * ---
1441
+ *
1442
+ *
1443
+ * ### **Events:**
1444
+ * - **nys-tab-select** - Dispatched when the tab is activated via click or Enter / Space. Bubbles and crosses shadow DOM boundaries. `detail: { id: string, label: string }`
1445
+ * - **nys-tab-focus** - Dispatched when the host receives focus. Bubbles and crosses shadow DOM boundaries. `detail: { id: string }`
1446
+ * - **nys-tab-blur** - Dispatched when the host loses focus. Bubbles and crosses shadow DOM boundaries. `detail: { id: string }`
1447
+ *
1448
+ * ### **Methods:**
1449
+ * - **focus(options: _FocusOptions_): _void_** - Focuses the host element. The host carries `role="tab"` and `tabindex`,
1450
+ * so it is the correct element for AT to land on.
1451
+ *
1452
+ * ### **Slots:**
1453
+ * - _default_ - No slots; content is derived from the `label` property.
1454
+ */
1455
+ "nys-tab": Partial<NysTabProps & BaseProps & BaseEvents>;
1456
+
1457
+ /**
1458
+ * `<nys-tabgroup>` is the container for `<nys-tab>` and `<nys-tabpanel>`
1459
+ * elements.
1460
+ *
1461
+ * Accepts tabs and panels as flat light-DOM children in any order (interleaved
1462
+ * or grouped). On slot change, children are sorted into dedicated shadow-DOM
1463
+ * containers, ARIA relationships are wired, and the first selected (or first)
1464
+ * tab is activated.
1465
+ *
1466
+ * Scroll shadows are rendered on either side of the tab list and toggled via
1467
+ * `ResizeObserver` and a `scroll` listener so they accurately reflect whether
1468
+ * overflow content exists in each direction.
1469
+ *
1470
+ * Keyboard navigation follows the
1471
+ * https://www.w3.org/WAI/ARIA/apg/patterns/tabs/ ARIA Tabs Pattern:
1472
+ * - Arrow keys move focus without changing selection.
1473
+ * - Enter / Space confirm selection on the focused tab.
1474
+ * ---
1475
+ *
1476
+ *
1477
+ * ### **Slots:**
1478
+ * - _default_ - Accepts `<nys-tab>` and `<nys-tabpanel>` children. Elements are moved into internal shadow-DOM containers on `slotchange`; the slot itself is not rendered visibly.
1479
+ */
1480
+ "nys-tabgroup": Partial<NysTabgroupProps & BaseProps & BaseEvents>;
1481
+
1482
+ /**
1483
+ * `<nys-tabpanel>` is a content panel paired with a `<nys-tab>` inside a
1484
+ * `<nys-tabgroup>`.
1485
+ *
1486
+ * Pairing is determined by render order: the Nth `<nys-tabpanel>` child of a
1487
+ * `<nys-tabgroup>` corresponds to the Nth `<nys-tab>` child.
1488
+ * `aria-labelledby` and the `hidden` attribute are managed externally by
1489
+ * `<nys-tabgroup>` via `_applySelection`; do not set them directly.
1490
+ * ---
1491
+ *
1492
+ *
1493
+ * ### **Slots:**
1494
+ * - _default_ - Default slot for panel content. Rendered inside a wrapper `<div>` with the `.nys-tabpanel` class for styling.
1495
+ */
1496
+ "nys-tabpanel": Partial<NysTabpanelProps & BaseProps & BaseEvents>;
1497
+
1348
1498
  /**
1349
1499
  * `<nys-table>` is a responsive table component that can display native HTML tables,
1350
1500
  * supports striped and bordered styling, sortable columns, and CSV download.
@@ -1439,9 +1589,12 @@ export type CustomElements = {
1439
1589
  "nys-unavheader": Partial<NysUnavHeaderProps & BaseProps & BaseEvents>;
1440
1590
 
1441
1591
  /**
1442
- *
1592
+ * YouTube video player with thumbnail preview and accessibility announcements.
1443
1593
  * ---
1444
1594
  *
1595
+ *
1596
+ * ### **Events:**
1597
+ * - **nys-video-play** - Fired when the user clicks the thumbnail to load the player.
1445
1598
  */
1446
1599
  "nys-video": Partial<NysVideoProps & BaseProps & BaseEvents>;
1447
1600
  };