@nysds/components 1.18.0 → 1.18.3

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.
@@ -744,34 +744,34 @@ export type NysSkipnavProps = {
744
744
  };
745
745
 
746
746
  export type NysStepProps = {
747
- /** Whether this step is currently being viewed. Set by parent stepper. */
747
+ /** Which step is currently being displayed. If not set, defaults to the `current` step.
748
+ Setting this on a step after `current` is silently corrected to match `current`.
749
+ When controlling state from a framework, always set this explicitly. */
748
750
  selected?: boolean;
749
- /** Marks the furthest reached step. Steps before this are navigable. */
751
+ /** The furthest step the user has reached (progress boundary). Steps before this are navigable. */
750
752
  current?: boolean;
751
753
  /** Step label text displayed alongside the step number. */
752
754
  label?: string;
753
- /** URL for page navigation when step is clicked. Optional for SPA routing. */
755
+ /** URL navigated to when the step is activated, via `window.location.href`.
756
+ Navigation is suppressed if the `nys-step-click` listener calls `e.preventDefault()`.
757
+ Omit for SPA/framework routing and handle navigation in the event listener instead. */
754
758
  href?: string;
755
- /** Internal: Whether parent stepper's compact view is expanded. */
756
- isCompactExpanded?: boolean;
757
- /** Step number (1-indexed). Auto-assigned by parent stepper. */
758
- stepNumber?: number;
759
- /** Custom click handler. Called before `nys-step-click` event. */
759
+ /** Optional function called before `nys-step-click` is dispatched. Use for pre-navigation logic. */
760
760
  onClick?: (e: Event) => void | undefined;
761
- /** Fired when a navigable step is clicked. Detail: `{href, label}`. Cancelable. */
761
+ /** Fired when a navigable (`previous` or `current`) non-selected step is clicked or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call `e.preventDefault()` to suppress `window.location.href` navigation. */
762
762
  "onnys-step-click"?: (e: CustomEvent<never>) => void;
763
763
  };
764
764
 
765
765
  export type NysStepperProps = {
766
- /** Unique identifier. */
766
+ /** Unique identifier. Auto-generated as `nys-stepper-{n}-{timestamp}` if not provided. */
767
767
  id?: string;
768
768
  /** Name attribute for form association. */
769
769
  name?: string;
770
- /** Title displayed above the step counter. */
770
+ /** Title displayed above the step list and compact counter. */
771
771
  label?: string;
772
- /** Progress text (e.g., "Step 2 of 5"). Auto-updated based on selection. */
772
+ /** Progress text displayed in compact mode (e.g., "Step 2 of 5"). Auto-managed do not set manually. */
773
773
  counterText?: string;
774
- /** Whether compact mobile view is expanded to show all steps. */
774
+ /** Whether compact mobile view is expanded to show all steps. Toggled by clicking the counter. */
775
775
  isCompactExpanded?: boolean;
776
776
  };
777
777
 
@@ -1414,7 +1414,7 @@ export type CustomElements = {
1414
1414
  *
1415
1415
  *
1416
1416
  * ### **Events:**
1417
- * - **nys-step-click** - Fired when a navigable step is clicked. Detail: `{href, label}`. Cancelable.
1417
+ * - **nys-step-click** - Fired when a navigable (`previous` or `current`) non-selected step is clicked or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call `e.preventDefault()` to suppress `window.location.href` navigation.
1418
1418
  */
1419
1419
  "nys-step": Partial<NysStepProps & BaseProps & BaseEvents>;
1420
1420
 
@@ -1424,8 +1424,8 @@ export type CustomElements = {
1424
1424
  *
1425
1425
  *
1426
1426
  * ### **Slots:**
1427
- * - _default_ - Default slot for `nys-step` elements.
1428
- * - **actions** - Navigation buttons (e.g., Back, Continue). Must be wrapped in a `<div>`.
1427
+ * - _default_ - Default slot for `nys-step` elements. Only `nys-step` children are accepted; others are removed.
1428
+ * - **actions** - Persistent navigation buttons. Must contain exactly one `<div>` wrapping only `<nys-button>` elements.
1429
1429
  */
1430
1430
  "nys-stepper": Partial<NysStepperProps & BaseProps & BaseEvents>;
1431
1431
 
@@ -1,21 +0,0 @@
1
- /**
2
- * Format Utilities
3
- *
4
- * Helpers for formatting MCP tool responses.
5
- */
6
- /**
7
- * JSON replacer that strips null and undefined values from objects.
8
- * Use with JSON.stringify(obj, stripNulls, 2) for cleaner output.
9
- */
10
- export declare function stripNulls(_key: string, value: unknown): unknown;
11
- /**
12
- * Format an object as JSON, stripping null/undefined values and empty arrays.
13
- */
14
- export declare function formatResponse(data: unknown): string;
15
- /**
16
- * Create a text content response for MCP tools.
17
- */
18
- export declare function textContent(data: unknown): {
19
- type: "text";
20
- text: string;
21
- };