@nysds/components 1.13.0 → 1.13.1

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 (62) hide show
  1. package/custom-elements.json +10506 -0
  2. package/dist/.vscode/vscode.css-custom-data.json +47 -1
  3. package/dist/.vscode/vscode.html-custom-data.json +1248 -275
  4. package/dist/custom-elements.json +829 -202
  5. package/dist/nys-stepper/newsletter.html +4 -0
  6. package/dist/nys-stepper/personal.html +6 -0
  7. package/dist/nys-stepper/survey.html +5 -0
  8. package/dist/nys-stepper/team.html +6 -0
  9. package/dist/nysds.es.js +623 -559
  10. package/dist/nysds.es.js.map +1 -1
  11. package/dist/nysds.js +59 -47
  12. package/dist/nysds.js.map +1 -1
  13. package/dist/packages/mcp-server/src/index.d.ts +8 -0
  14. package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +95 -0
  15. package/dist/packages/mcp-server/src/lib/search.d.ts +19 -0
  16. package/dist/packages/mcp-server/src/lib/token-parser.d.ts +139 -0
  17. package/dist/packages/mcp-server/src/prompts/nysds-mode.d.ts +7 -0
  18. package/dist/packages/mcp-server/src/resources/components.d.ts +11 -0
  19. package/dist/packages/mcp-server/src/resources/guides.d.ts +10 -0
  20. package/dist/packages/mcp-server/src/resources/index.d.ts +7 -0
  21. package/dist/packages/mcp-server/src/resources/tokens.d.ts +16 -0
  22. package/dist/packages/mcp-server/src/server.d.ts +10 -0
  23. package/dist/packages/mcp-server/src/tools/component-tools.d.ts +13 -0
  24. package/dist/packages/mcp-server/src/tools/index.d.ts +7 -0
  25. package/dist/packages/mcp-server/src/tools/token-tools.d.ts +16 -0
  26. package/dist/packages/mcp-server/src/tools/validation-tools.d.ts +11 -0
  27. package/dist/packages/nys-accordion/src/nys-accordion.d.ts +25 -8
  28. package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +19 -7
  29. package/dist/packages/nys-alert/src/nys-alert.d.ts +32 -9
  30. package/dist/packages/nys-avatar/src/nys-avatar.d.ts +26 -7
  31. package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +17 -7
  32. package/dist/packages/nys-badge/src/nys-badge.d.ts +30 -4
  33. package/dist/packages/nys-button/src/nys-button.d.ts +126 -9
  34. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +43 -11
  35. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +33 -12
  36. package/dist/packages/nys-divider/src/nys-divider.d.ts +20 -2
  37. package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +10 -3
  38. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +37 -11
  39. package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +16 -2
  40. package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +16 -7
  41. package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +16 -10
  42. package/dist/packages/nys-icon/src/nys-icon.d.ts +25 -3
  43. package/dist/packages/nys-label/src/nys-label.d.ts +15 -3
  44. package/dist/packages/nys-modal/src/nys-modal.d.ts +30 -7
  45. package/dist/packages/nys-pagination/src/nys-pagination.d.ts +17 -5
  46. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +35 -13
  47. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +33 -8
  48. package/dist/packages/nys-select/src/nys-option.d.ts +24 -0
  49. package/dist/packages/nys-select/src/nys-select.d.ts +48 -12
  50. package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +19 -6
  51. package/dist/packages/nys-stepper/src/index.d.ts +2 -0
  52. package/dist/packages/nys-stepper/src/nys-step.d.ts +37 -0
  53. package/dist/packages/nys-stepper/src/nys-stepper.d.ts +48 -0
  54. package/dist/packages/nys-stepper/src/nys-stepper.figma.d.ts +1 -0
  55. package/dist/packages/nys-table/src/nys-table.d.ts +2 -1
  56. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +51 -8
  57. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +64 -9
  58. package/dist/packages/nys-toggle/src/nys-toggle.d.ts +35 -6
  59. package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +24 -11
  60. package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +12 -5
  61. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +25 -7
  62. package/package.json +12 -10
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * NYSDS MCP Server Entry Point
4
+ *
5
+ * Starts the MCP server with stdio transport for local execution.
6
+ * Run via: npx @nysds/mcp-server
7
+ */
8
+ export {};
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Custom Elements Manifest Parser
3
+ *
4
+ * Reads and parses the custom-elements.json manifest from @nysds/components.
5
+ */
6
+ export interface CEMAttribute {
7
+ name: string;
8
+ type?: {
9
+ text: string;
10
+ };
11
+ default?: string;
12
+ description?: string;
13
+ fieldName?: string;
14
+ }
15
+ export interface CEMMember {
16
+ kind: "field" | "method";
17
+ name: string;
18
+ type?: {
19
+ text: string;
20
+ };
21
+ default?: string;
22
+ description?: string;
23
+ privacy?: "public" | "private" | "protected";
24
+ attribute?: string;
25
+ }
26
+ export interface CEMEvent {
27
+ name: string;
28
+ type?: {
29
+ text: string;
30
+ };
31
+ description?: string;
32
+ }
33
+ export interface CEMSlot {
34
+ name: string;
35
+ description?: string;
36
+ }
37
+ export interface CEMCssProperty {
38
+ name: string;
39
+ default?: string;
40
+ description?: string;
41
+ }
42
+ export interface CEMCssPart {
43
+ name: string;
44
+ description?: string;
45
+ }
46
+ export interface CEMDeclaration {
47
+ kind: "class";
48
+ name: string;
49
+ tagName?: string;
50
+ summary?: string;
51
+ description?: string;
52
+ attributes?: CEMAttribute[];
53
+ members?: CEMMember[];
54
+ events?: CEMEvent[];
55
+ slots?: CEMSlot[];
56
+ cssProperties?: CEMCssProperty[];
57
+ cssParts?: CEMCssPart[];
58
+ superclass?: {
59
+ name: string;
60
+ package?: string;
61
+ };
62
+ }
63
+ export interface CEMModule {
64
+ kind: "javascript-module";
65
+ path: string;
66
+ declarations?: CEMDeclaration[];
67
+ exports?: Array<{
68
+ kind: string;
69
+ name: string;
70
+ declaration: {
71
+ name: string;
72
+ };
73
+ }>;
74
+ }
75
+ export interface CustomElementsManifest {
76
+ schemaVersion: string;
77
+ readme?: string;
78
+ modules: CEMModule[];
79
+ }
80
+ /**
81
+ * Load and parse the Custom Elements Manifest
82
+ */
83
+ export declare function getCEM(): CustomElementsManifest;
84
+ /**
85
+ * Get all component declarations from the manifest
86
+ */
87
+ export declare function getAllComponents(): CEMDeclaration[];
88
+ /**
89
+ * Get a specific component by tag name
90
+ */
91
+ export declare function getComponent(tagName: string): CEMDeclaration | undefined;
92
+ /**
93
+ * Clear the cached CEM (useful for testing)
94
+ */
95
+ export declare function clearCache(): void;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Search Utilities
3
+ *
4
+ * Fuzzy search functionality for components and tokens.
5
+ */
6
+ export interface SearchResult {
7
+ tagName: string;
8
+ name: string;
9
+ summary: string;
10
+ score: number;
11
+ }
12
+ /**
13
+ * Search components by name or description
14
+ */
15
+ export declare function searchComponents(query: string): SearchResult[];
16
+ /**
17
+ * Check if a string matches a search query
18
+ */
19
+ export declare function matchesQuery(text: string, query: string): boolean;
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Design Token Parser
3
+ *
4
+ * Reads and parses NYSDS design tokens with a CSS-centric approach.
5
+ * Returns data aligned with tokens.css output (not JSON internals).
6
+ *
7
+ * Key transformations:
8
+ * - Token paths are converted to CSS variable names
9
+ * - Alias references become var() expressions
10
+ * - Layer prefixes (primitive, applied) are stripped
11
+ */
12
+ /**
13
+ * Legacy interface for backward compatibility
14
+ */
15
+ export interface DesignToken {
16
+ name: string;
17
+ value: string;
18
+ category: string;
19
+ description?: string;
20
+ }
21
+ /**
22
+ * CSS-centric token info aligned with tokens.css output
23
+ */
24
+ export interface CSSTokenInfo {
25
+ /** CSS variable name, e.g., "--nys-color-text" */
26
+ cssVariable: string;
27
+ /** CSS value as it appears in tokens.css, e.g., "var(--nys-color-neutral-900)" or "#1b1b1b" */
28
+ cssValue: string;
29
+ /** If this is an alias, the variable it references, e.g., "--nys-color-neutral-900" */
30
+ referencesVariable?: string;
31
+ /** Fully resolved value for previews, e.g., "#1b1b1b" */
32
+ resolvedValue?: string;
33
+ /** Token description from $description field */
34
+ description?: string;
35
+ /** Token category (color, font, space, etc.) */
36
+ category: string;
37
+ /** Token layer (primitive, applied, color, etc.) */
38
+ layer: string;
39
+ /** Original JSON path for debugging */
40
+ jsonPath: string;
41
+ }
42
+ /**
43
+ * Token dependency graph node
44
+ */
45
+ export interface TokenGraphNode {
46
+ cssVariable: string;
47
+ referencesVariable?: string;
48
+ usedBy: string[];
49
+ }
50
+ export interface TokenGroup {
51
+ category: string;
52
+ tokens: DesignToken[];
53
+ }
54
+ /**
55
+ * Get the path to tokens.json file
56
+ * Uses ESM-compatible path resolution with fallbacks for different contexts
57
+ */
58
+ export declare function getTokensPath(): string | null;
59
+ /**
60
+ * Get the path to tokens.css file
61
+ */
62
+ export declare function getTokensCSSPath(): string | null;
63
+ /**
64
+ * Transform a JSON token path to CSS variable name
65
+ *
66
+ * Examples:
67
+ * - "primitive.color.neutral.900" → "--nys-color-neutral-900"
68
+ * - "applied.color.text.default" → "--nys-color-text"
69
+ * - "color.theme.default" → "--nys-color-theme"
70
+ * - "font.size.md" → "--nys-font-size-md"
71
+ */
72
+ export declare function toCSSVariable(jsonPath: string): string;
73
+ /**
74
+ * Convert an alias reference to CSS var() syntax
75
+ *
76
+ * Examples:
77
+ * - "{primitive.color.neutral.900}" → "var(--nys-color-neutral-900)"
78
+ * - "{font.size.md}" → "var(--nys-font-size-md)"
79
+ */
80
+ export declare function aliasToVarRef(aliasValue: string): {
81
+ cssValue: string;
82
+ referencesVariable: string;
83
+ };
84
+ /**
85
+ * Build a dependency graph of tokens
86
+ * Shows which tokens reference which, and which tokens are used by which
87
+ */
88
+ export declare function buildTokenGraph(): Map<string, TokenGraphNode>;
89
+ /**
90
+ * Get all tokens in CSS-centric format
91
+ */
92
+ export declare function getCSSTokens(): CSSTokenInfo[];
93
+ /**
94
+ * Get CSS tokens filtered by category
95
+ */
96
+ export declare function getCSSTokensByCategory(category: string): CSSTokenInfo[];
97
+ /**
98
+ * Get CSS tokens filtered by layer
99
+ */
100
+ export declare function getCSSTokensByLayer(layer: string): CSSTokenInfo[];
101
+ /**
102
+ * Search CSS tokens by variable name, value, or description
103
+ */
104
+ export declare function searchCSSTokens(query: string): CSSTokenInfo[];
105
+ /**
106
+ * Get a single token by CSS variable name
107
+ */
108
+ export declare function getCSSTokenByVariable(variableName: string): CSSTokenInfo | undefined;
109
+ /**
110
+ * Get all unique categories
111
+ */
112
+ export declare function getCSSTokenCategories(): {
113
+ category: string;
114
+ count: number;
115
+ }[];
116
+ /**
117
+ * Get raw tokens.css content
118
+ */
119
+ export declare function getTokensCSS(): string | null;
120
+ /**
121
+ * Load all design tokens (legacy format)
122
+ */
123
+ export declare function getAllTokens(): DesignToken[];
124
+ /**
125
+ * Get tokens filtered by category (legacy format)
126
+ */
127
+ export declare function getTokensByCategory(category: string): DesignToken[];
128
+ /**
129
+ * Search tokens by name or value (legacy format)
130
+ */
131
+ export declare function searchTokens(query: string): DesignToken[];
132
+ /**
133
+ * Get available token categories (legacy format)
134
+ */
135
+ export declare function getTokenCategories(): string[];
136
+ /**
137
+ * Clear all cached tokens (useful for testing)
138
+ */
139
+ export declare function clearTokenCache(): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * NYSDS Mode Prompt
3
+ *
4
+ * Activates NYSDS-aware coding assistance.
5
+ */
6
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ export declare function registerPrompts(server: McpServer): void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Component Resources
3
+ *
4
+ * MCP resources for NYSDS component documentation.
5
+ *
6
+ * P0 Resources:
7
+ * - nysds://components - Component overview list
8
+ * - nysds://component/{tag} - Individual component docs
9
+ */
10
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
+ export declare function registerComponentResources(server: McpServer): void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Guide Resources
3
+ *
4
+ * MCP resources for NYSDS installation and usage guides.
5
+ *
6
+ * P0 Resources:
7
+ * - nysds://installation - Installation guide
8
+ */
9
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
10
+ export declare function registerGuideResources(server: McpServer): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MCP Resources Registration
3
+ *
4
+ * Registers all NYSDS resources with the MCP server.
5
+ */
6
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ export declare function registerResources(server: McpServer): void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Token Resources
3
+ *
4
+ * MCP resources for NYSDS design tokens.
5
+ *
6
+ * Resources:
7
+ * - nysds://tokens - All tokens in CSS-centric format
8
+ * - nysds://tokens/css - Raw tokens.css file content
9
+ * - nysds://tokens/graph - Token dependency graph with stats
10
+ * - nysds://tokens/color - Color tokens only
11
+ * - nysds://tokens/font - Typography tokens
12
+ * - nysds://tokens/space - Spacing tokens
13
+ * - nysds://tokens/size - Size tokens
14
+ */
15
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
16
+ export declare function registerTokenResources(server: McpServer): void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * NYSDS MCP Server Setup
3
+ *
4
+ * Configures the MCP server with tools, resources, and prompts
5
+ * for the New York State Design System.
6
+ */
7
+ export interface NysdsMcpServer {
8
+ start(): Promise<void>;
9
+ }
10
+ export declare function createServer(): Promise<NysdsMcpServer>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Component Tools
3
+ *
4
+ * MCP tools for working with NYSDS components.
5
+ *
6
+ * P0 Tools:
7
+ * - list_components: List all NYSDS components with summaries
8
+ * - get_component_docs: Full documentation for a specific component
9
+ * - find_components: Search by name/description (fuzzy)
10
+ * - get_usage_guide: Installation and usage patterns
11
+ */
12
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
13
+ export declare function registerComponentTools(server: McpServer): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MCP Tools Registration
3
+ *
4
+ * Registers all NYSDS tools with the MCP server.
5
+ */
6
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ export declare function registerTools(server: McpServer): void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Token Tools
3
+ *
4
+ * MCP tools for working with NYSDS design tokens.
5
+ *
6
+ * Tools:
7
+ * - get_design_tokens: Get tokens with filtering and options
8
+ * - find_tokens: Search tokens by CSS variable, value, or description
9
+ * - list_themes: List all 8 agency themes
10
+ * - get_token_value: Get detailed info for a specific token
11
+ * - validate_token_usage: Validate token usage in context
12
+ * - list_token_categories: List categories with token counts
13
+ * - get_token_graph: Get token dependency graph
14
+ */
15
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
16
+ export declare function registerTokenTools(server: McpServer): void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Validation Tools
3
+ *
4
+ * MCP tools for validating NYSDS component usage.
5
+ *
6
+ * P1 Tools:
7
+ * - validate_component_api: Validate prop/attribute usage
8
+ * - setup_framework: Framework-specific guides
9
+ */
10
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
+ export declare function registerValidationTools(server: McpServer): void;
@@ -1,22 +1,39 @@
1
1
  import { LitElement } from "lit";
2
2
  import "./nys-accordionitem";
3
3
  /**
4
- * `<nys-accordion>` groups one or more `<nys-accordionitem>` elements.
4
+ * A container for grouping `nys-accordionitem` components with coordinated expand/collapse behavior.
5
5
  *
6
- * Features:
7
- * - Optionally enforces single-expanded-item behavior via `singleSelect`.
8
- * - Propagates shared visual `bordered` property to child items.
9
- * - Generates a stable unique identifier if none is provided.
6
+ * Place `nys-accordionitem` elements as children. Set `singleSelect` to allow only one item open at a time.
7
+ * The `bordered` style propagates to all children automatically.
10
8
  *
11
- * @slot default - Place one or more `<nys-accordionitem>` components here.
9
+ * @summary Container for accordion items with optional single-select and bordered styling.
10
+ * @element nys-accordion
12
11
  *
13
- * @fires nys-accordionitem-toggle - Fired when a child `<nys-accordionitem>` is toggled.
14
- * Event detail includes `{ id: string, heading: string, expanded: boolean }`.
12
+ * @slot - Default slot for `nys-accordionitem` elements.
13
+ *
14
+ * @example Basic accordion
15
+ * ```html
16
+ * <nys-accordion>
17
+ * <nys-accordionitem heading="Section 1">Content for section 1</nys-accordionitem>
18
+ * <nys-accordionitem heading="Section 2">Content for section 2</nys-accordionitem>
19
+ * </nys-accordion>
20
+ * ```
21
+ *
22
+ * @example Single-select accordion
23
+ * ```html
24
+ * <nys-accordion singleSelect bordered>
25
+ * <nys-accordionitem heading="FAQ 1" expanded>Answer 1</nys-accordionitem>
26
+ * <nys-accordionitem heading="FAQ 2">Answer 2</nys-accordionitem>
27
+ * </nys-accordion>
28
+ * ```
15
29
  */
16
30
  export declare class NysAccordion extends LitElement {
17
31
  static styles: import("lit").CSSResult;
32
+ /** Unique identifier. Auto-generated if not provided. */
18
33
  id: string;
34
+ /** Only one item can be expanded at a time. Expanding one collapses others. */
19
35
  singleSelect: boolean;
36
+ /** Adds borders around each accordion item. Propagates to all children. */
20
37
  bordered: boolean;
21
38
  /**
22
39
  * Lifecycle methods
@@ -1,21 +1,33 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-accordionitem>` represents a single collapsible item inside a `<nys-accordion>`.
3
+ * A collapsible content panel used within `nys-accordion`. Supports keyboard navigation and smooth animations.
4
4
  *
5
- * @slot - Default slot for the content inside the accordion panel.
5
+ * Place inside `nys-accordion`. Set `expanded` to open by default. The heading acts as a toggle button
6
+ * accessible via click, Enter, or Space. Parent accordion controls `bordered` and `singleSelect` behavior.
6
7
  *
7
- * @event nys-accordionitem-toggle - Fired when the item is expanded or collapsed.
8
- * @type {CustomEvent<{id: string, heading: string, expanded: boolean}>}
8
+ * @summary Collapsible panel for use within nys-accordion with keyboard support.
9
+ * @element nys-accordionitem
9
10
  *
10
- * Features:
11
- * - Click or keyboard (Enter/Space) toggles expansion.
12
- * - Animates height changes when expanding/collapsing.
11
+ * @slot - Default slot for panel content shown when expanded.
12
+ *
13
+ * @fires nys-accordionitem-toggle - Fired when expanded state changes. Detail: `{id, heading, expanded}`.
14
+ *
15
+ * @example Expanded item
16
+ * ```html
17
+ * <nys-accordionitem heading="How do I apply?" expanded>
18
+ * <p>Visit ny.gov and complete the online application.</p>
19
+ * </nys-accordionitem>
20
+ * ```
13
21
  */
14
22
  export declare class NysAccordionItem extends LitElement {
15
23
  static styles: import("lit").CSSResult;
24
+ /** Unique identifier. Auto-generated if not provided. */
16
25
  id: string;
26
+ /** Heading text displayed in the clickable toggle button. */
17
27
  heading: string;
28
+ /** Whether the content panel is visible. Toggle via click or keyboard. */
18
29
  expanded: boolean;
30
+ /** Adds border styling. Set by parent `nys-accordion`, not directly. */
19
31
  bordered: boolean;
20
32
  /**
21
33
  * Lifecycle methods
@@ -1,30 +1,53 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-alert>` renders an informational, success, warning, or error alert.
3
+ * Displays contextual feedback messages with semantic styling. Uses ARIA live regions for screen reader announcements.
4
4
  *
5
- * @slot - Default slot for additional alert content.
5
+ * Use `info` for neutral information, `success` for confirmations, `warning` for caution, `danger` for errors,
6
+ * and `emergency` for critical system-wide alerts. Set `dismissible` to let users close the alert.
6
7
  *
7
- * @event nys-close - Fired when alert is dismissed (manual or timeout).
8
- * @type {CustomEvent<{id: string, type: string, label: string}>}
8
+ * @summary Alert for contextual feedback with semantic types and live region support.
9
+ * @element nys-alert
9
10
  *
10
- * Features:
11
- * - Accessible ARIA roles and live-region announcements.
12
- * - Auto-close via `duration`.
13
- * - Handles default slot content or fallback `text`.
14
- * - Optional dismiss button.
11
+ * @slot - Default slot for custom body content. Overrides `text` prop when provided.
12
+ *
13
+ * @fires nys-close - Fired when alert is dismissed. Detail: `{id, type, label}`.
14
+ *
15
+ * @example Info alert
16
+ * ```html
17
+ * <nys-alert type="info" heading="Update available" text="A new version is ready to install."></nys-alert>
18
+ * ```
19
+ *
20
+ * @example Dismissible success alert
21
+ * ```html
22
+ * <nys-alert type="success" heading="Application submitted" dismissible></nys-alert>
23
+ * ```
15
24
  */
16
25
  export declare class NysAlert extends LitElement {
17
26
  static styles: import("lit").CSSResult;
27
+ /** Unique identifier. Auto-generated if not provided. */
18
28
  id: string;
29
+ /** Bold heading text displayed at the top of the alert. */
19
30
  heading: string;
31
+ /** Custom icon name. Defaults to type-appropriate icon if not set. */
20
32
  icon: string;
33
+ /** Shows close button allowing users to dismiss the alert. */
21
34
  dismissible: boolean;
35
+ /** Auto-dismiss after specified milliseconds. Set to 0 to disable. */
22
36
  duration: number;
37
+ /** Body text content. Ignored if slot content is provided. */
23
38
  text: string;
39
+ /** URL for the primary action link. */
24
40
  primaryAction: string;
41
+ /** URL for the secondary action link. */
25
42
  secondaryAction: string;
43
+ /** Label text for primary action link. */
26
44
  primaryLabel: string;
45
+ /** Label text for secondary action link. */
27
46
  secondaryLabel: string;
47
+ /**
48
+ * Semantic alert type affecting color and ARIA role. `danger`/`emergency` use assertive live region.
49
+ * @default "base"
50
+ */
28
51
  type: "base" | "info" | "success" | "warning" | "danger" | "emergency";
29
52
  private _alertClosed;
30
53
  private _slotHasContent;
@@ -1,25 +1,44 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-avatar>` displays a user avatar as an image, initials, or icon.
3
+ * Displays a user representation as image, initials, or icon with automatic fallback chain.
4
4
  *
5
- * @slot - Default slot for custom icon content. Fallback icon is used if slot is empty.
5
+ * Priority: `image` > `initials` > `icon` > default icon. Set `color` to customize background;
6
+ * foreground auto-adjusts for contrast. Use `interactive` for clickable avatars (e.g., profile menus).
6
7
  *
7
- * Features:
8
- * - Computes foreground color for sufficient contrast based on background.
9
- * - Supports interactive avatars with button role.
10
- * - Fallback to icon when image or initials are missing.
11
- * - Lazy loading for performance optimization.
8
+ * @summary User avatar with image, initials, or icon fallback and contrast-aware colors.
9
+ * @element nys-avatar
10
+ *
11
+ * @slot - Custom icon content. Overrides default icon when no image or initials.
12
+ *
13
+ * @example Image avatar
14
+ * ```html
15
+ * <nys-avatar image="/path/to/photo.jpg" ariaLabel="Jane Smith"></nys-avatar>
16
+ * ```
17
+ *
18
+ * @example Initials avatar with custom color
19
+ * ```html
20
+ * <nys-avatar initials="JS" color="var(--nys-color-theme)" ariaLabel="Jane Smith"></nys-avatar>
21
+ * ```
12
22
  */
13
23
  export declare class NysAvatar extends LitElement {
14
24
  static styles: import("lit").CSSResult;
25
+ /** Unique identifier. Auto-generated if not provided. */
15
26
  id: string;
27
+ /** Accessible label for screen readers. Required when no image `alt` is available. */
16
28
  ariaLabel: string;
29
+ /** Image URL. Takes priority over initials and icon. */
17
30
  image: string;
31
+ /** 1-2 character initials. Used when no image is provided. */
18
32
  initials: string;
33
+ /** Custom icon name. Falls back to `account_circle` if not set. */
19
34
  icon: string;
35
+ /** Background color. Foreground auto-adjusts for contrast. Accepts CSS values or variables. */
20
36
  color: string;
37
+ /** Makes avatar clickable with button role and focus ring. */
21
38
  interactive: boolean;
39
+ /** Prevents interaction when `interactive` is true. */
22
40
  disabled: boolean;
41
+ /** Enables lazy loading for the image. */
23
42
  lazy: boolean;
24
43
  private _slotHasContent;
25
44
  /**
@@ -1,18 +1,28 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-backtotop>` renders a button that scrolls the page to the top.
3
+ * A floating "Back to top" button that appears after scrolling. Smooth-scrolls to page top when clicked.
4
4
  *
5
- * Features:
6
- * - Automatically appears after scrolling past 1.5 viewport heights
7
- * if the page is at least 4 screens tall.
8
- * - Adapts to mobile screens (renders as a circle button when narrow).
9
- * - Can be explicitly shown with the `visible` attribute.
5
+ * Auto-shows after scrolling 1.5 viewports on pages 4+ screens tall. Set `visible` to force display.
6
+ * Renders as circle button on mobile. Position with `position` prop (`left` or `right`).
10
7
  *
11
- * @fires nys-click - Fired when the button is clicked (scrolls page to top).
8
+ * @summary Floating back-to-top button with auto-show behavior and smooth scroll.
9
+ * @element nys-backtotop
10
+ *
11
+ * @example Auto-appearing button
12
+ * ```html
13
+ * <nys-backtotop></nys-backtotop>
14
+ * ```
15
+ *
16
+ * @example Always visible, left position
17
+ * ```html
18
+ * <nys-backtotop visible position="left"></nys-backtotop>
19
+ * ```
12
20
  */
13
21
  export declare class NysBacktotop extends LitElement {
14
22
  static styles: import("lit").CSSResult;
23
+ /** Horizontal position: `left` or `right`. */
15
24
  position: string;
25
+ /** Force button visibility. Overrides auto-show scroll behavior. */
16
26
  visible: boolean;
17
27
  private isMobile;
18
28
  private forceVisible;