@nysds/components 1.12.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 (70) hide show
  1. package/README.md +3 -1
  2. package/custom-elements.json +10506 -0
  3. package/dist/.vscode/vscode.css-custom-data.json +47 -1
  4. package/dist/.vscode/vscode.html-custom-data.json +1280 -266
  5. package/dist/custom-elements.json +2183 -332
  6. package/dist/nys-stepper/newsletter.html +4 -0
  7. package/dist/nys-stepper/personal.html +6 -0
  8. package/dist/nys-stepper/survey.html +5 -0
  9. package/dist/nys-stepper/team.html +6 -0
  10. package/dist/nysds.es.js +3325 -1564
  11. package/dist/nysds.es.js.map +1 -1
  12. package/dist/nysds.js +280 -164
  13. package/dist/nysds.js.map +1 -1
  14. package/dist/packages/mcp-server/src/index.d.ts +8 -0
  15. package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +95 -0
  16. package/dist/packages/mcp-server/src/lib/search.d.ts +19 -0
  17. package/dist/packages/mcp-server/src/lib/token-parser.d.ts +139 -0
  18. package/dist/packages/mcp-server/src/prompts/nysds-mode.d.ts +7 -0
  19. package/dist/packages/mcp-server/src/resources/components.d.ts +11 -0
  20. package/dist/packages/mcp-server/src/resources/guides.d.ts +10 -0
  21. package/dist/packages/mcp-server/src/resources/index.d.ts +7 -0
  22. package/dist/packages/mcp-server/src/resources/tokens.d.ts +16 -0
  23. package/dist/packages/mcp-server/src/server.d.ts +10 -0
  24. package/dist/packages/mcp-server/src/tools/component-tools.d.ts +13 -0
  25. package/dist/packages/mcp-server/src/tools/index.d.ts +7 -0
  26. package/dist/packages/mcp-server/src/tools/token-tools.d.ts +16 -0
  27. package/dist/packages/mcp-server/src/tools/validation-tools.d.ts +11 -0
  28. package/dist/packages/nys-accordion/src/nys-accordion.d.ts +37 -3
  29. package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +32 -0
  30. package/dist/packages/nys-alert/src/nys-alert.d.ts +62 -1
  31. package/dist/packages/nys-avatar/src/nys-avatar.d.ts +44 -0
  32. package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +29 -0
  33. package/dist/packages/nys-badge/src/nys-badge.d.ts +46 -0
  34. package/dist/packages/nys-button/src/nys-button.d.ts +141 -0
  35. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +65 -1
  36. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +50 -0
  37. package/dist/packages/nys-datepicker/src/index.d.ts +1 -0
  38. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +116 -0
  39. package/dist/packages/nys-datepicker/src/nys-datepicker.figma.d.ts +1 -0
  40. package/dist/packages/nys-divider/src/nys-divider.d.ts +22 -0
  41. package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +16 -0
  42. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +59 -0
  43. package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +18 -0
  44. package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +29 -0
  45. package/dist/packages/nys-globalheader/src/nys-global.logo.d.ts +2 -0
  46. package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +32 -5
  47. package/dist/packages/nys-icon/src/nys-icon.d.ts +33 -0
  48. package/dist/packages/nys-label/src/nys-label.d.ts +17 -0
  49. package/dist/packages/nys-modal/src/nys-modal.d.ts +47 -0
  50. package/dist/packages/nys-pagination/src/nys-pagination.d.ts +33 -0
  51. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +52 -3
  52. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +55 -1
  53. package/dist/packages/nys-select/src/nys-option.d.ts +24 -0
  54. package/dist/packages/nys-select/src/nys-select.d.ts +70 -1
  55. package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +26 -0
  56. package/dist/packages/nys-stepper/src/index.d.ts +2 -0
  57. package/dist/packages/nys-stepper/src/nys-step.d.ts +37 -0
  58. package/dist/packages/nys-stepper/src/nys-stepper.d.ts +48 -0
  59. package/dist/packages/nys-stepper/src/nys-stepper.figma.d.ts +1 -0
  60. package/dist/packages/nys-table/src/index.d.ts +1 -0
  61. package/dist/packages/nys-table/src/nys-table.d.ts +39 -0
  62. package/dist/packages/nys-table/src/nys-table.figma.d.ts +1 -0
  63. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +72 -1
  64. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +85 -1
  65. package/dist/packages/nys-toggle/src/nys-toggle.d.ts +52 -0
  66. package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +41 -0
  67. package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +19 -0
  68. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +38 -2
  69. package/dist/src/index.d.ts +2 -0
  70. package/package.json +22 -17
@@ -1,9 +1,34 @@
1
1
  import { LitElement } from "lit";
2
+ /**
3
+ * Shows contextual help text on hover/focus. Auto-positions to stay within viewport and supports keyboard dismiss.
4
+ *
5
+ * Link to a trigger element via `for` attribute matching the trigger's `id`. Tooltip appears on hover or focus
6
+ * and dismisses on blur, mouse leave, or Escape key. Use for supplementary info only—not critical content.
7
+ *
8
+ * @summary Contextual tooltip with auto-positioning, keyboard support, and screen reader integration.
9
+ * @element nys-tooltip
10
+ *
11
+ * @example Tooltip for button
12
+ * ```html
13
+ * <nys-button id="help-btn" label="Help" circle icon="help"></nys-button>
14
+ * <nys-tooltip for="help-btn" text="Click for assistance"></nys-tooltip>
15
+ * ```
16
+ *
17
+ * @example Positioned tooltip
18
+ * ```html
19
+ * <nys-icon id="info-icon" name="info"></nys-icon>
20
+ * <nys-tooltip for="info-icon" text="Additional details" position="right"></nys-tooltip>
21
+ * ```
22
+ */
2
23
  export declare class NysTooltip extends LitElement {
3
24
  static styles: import("lit").CSSResult;
25
+ /** Unique identifier. Auto-generated if not provided. */
4
26
  id: string;
27
+ /** Tooltip content text. Required. */
5
28
  text: string;
29
+ /** Adjusts colors for dark backgrounds. */
6
30
  inverted: boolean;
31
+ /** ID of the trigger element to attach this tooltip to. Required. */
7
32
  for: string;
8
33
  private _active;
9
34
  private _userHasSetPosition;
@@ -11,13 +36,25 @@ export declare class NysTooltip extends LitElement {
11
36
  private _internallyUpdatingPosition;
12
37
  private _hideTimeout;
13
38
  private _position;
39
+ /**
40
+ * Preferred position relative to trigger. Auto-adjusts if space is insufficient.
41
+ * @default null (auto-positioned based on available space)
42
+ */
14
43
  get position(): "right" | "top" | "bottom" | "left" | null;
15
44
  set position(value: "right" | "top" | "bottom" | "left" | null);
45
+ /**
46
+ * Lifecycle Methods
47
+ * --------------------------------------------------------------------------
48
+ */
16
49
  constructor();
17
50
  connectedCallback(): void;
18
51
  disconnectedCallback(): void;
19
52
  firstUpdated(): Promise<void>;
20
53
  updated(changedProps: Map<string, unknown>): void;
54
+ /**
55
+ * Event Handlers
56
+ * --------------------------------------------------------------------------
57
+ */
21
58
  private _showTooltip;
22
59
  private _handleBlurOrMouseLeave;
23
60
  private _triggerFadeOut;
@@ -26,6 +63,10 @@ export declare class NysTooltip extends LitElement {
26
63
  private _removeScrollListeners;
27
64
  private _handleScrollOrResize;
28
65
  private _handleEscapeKey;
66
+ /**
67
+ * Functions
68
+ * --------------------------------------------------------------------------
69
+ */
29
70
  private _getReferenceElement;
30
71
  private _passAria;
31
72
  /**
@@ -1,6 +1,25 @@
1
1
  import { LitElement } from "lit";
2
+ /**
3
+ * Universal NYS footer with logo and statewide navigation links. Required on all NYS sites.
4
+ *
5
+ * Place as the last element before `</body>`. Displays NY.gov logo and links to Agencies,
6
+ * App Directory, Counties, Events, Programs, and Services. No configuration needed.
7
+ *
8
+ * @summary Universal NYS footer with logo and statewide links. Required site-wide.
9
+ * @element nys-unavfooter
10
+ *
11
+ * @example Standard usage
12
+ * ```html
13
+ * <nys-globalfooter>...</nys-globalfooter>
14
+ * <nys-unavfooter></nys-unavfooter>
15
+ * ```
16
+ */
2
17
  export declare class NysUnavFooter extends LitElement {
3
18
  static styles: import("lit").CSSResult;
19
+ /**
20
+ * Functions
21
+ * --------------------------------------------------------------------------
22
+ */
4
23
  private _getNysLogo;
5
24
  render(): import("lit-html").TemplateResult<1>;
6
25
  }
@@ -1,13 +1,51 @@
1
1
  import { LitElement } from "lit";
2
+ /**
3
+ * Universal NYS header with trust bar, logo, search, and language translation. Required on all NYS sites.
4
+ *
5
+ * Place as the first element in `<body>`. Includes "official site" trust indicator, NY.gov logo,
6
+ * site search (searches ny.gov), and 14-language translation dropdown. Use `hideSearch` or `hideTranslate`
7
+ * to remove features if not applicable.
8
+ *
9
+ * @summary Universal NYS header with trust bar, search, and translation. Required site-wide.
10
+ * @element nys-unavheader
11
+ *
12
+ * @example Standard usage
13
+ * ```html
14
+ * <nys-unavheader></nys-unavheader>
15
+ * <nys-globalheader>...</nys-globalheader>
16
+ * ```
17
+ *
18
+ * @example Without search
19
+ * ```html
20
+ * <nys-unavheader hideSearch></nys-unavheader>
21
+ * ```
22
+ */
2
23
  export declare class NysUnavHeader extends LitElement {
3
24
  static styles: import("lit").CSSResult;
25
+ /** Internal: Whether trust bar panel is expanded. */
4
26
  trustbarVisible: boolean;
27
+ /** Internal: Whether search dropdown is visible (mobile). */
5
28
  searchDropdownVisible: boolean;
29
+ /** Internal: Whether language dropdown is visible. */
6
30
  languageVisible: boolean;
31
+ /** Internal: Whether search input is focused. */
7
32
  isSearchFocused: boolean;
33
+ /** Hides the translation dropdown. */
8
34
  hideTranslate: boolean;
35
+ /** Hides the search functionality. */
9
36
  hideSearch: boolean;
37
+ searchUrl: string;
10
38
  private languages;
39
+ /**
40
+ * Lifecycle Methods
41
+ * --------------------------------------------------------------------------
42
+ */
43
+ connectedCallback(): void;
44
+ disconnectedCallback(): void;
45
+ /**
46
+ * Functions
47
+ * --------------------------------------------------------------------------
48
+ */
11
49
  private _getNysLogo;
12
50
  private _toggleTrustbar;
13
51
  private _toggleLanguageList;
@@ -17,7 +55,5 @@ export declare class NysUnavHeader extends LitElement {
17
55
  private _handleSearchKeyup;
18
56
  private _handleSearchButton;
19
57
  private _handleSearch;
20
- connectedCallback(): void;
21
- disconnectedCallback(): void;
22
58
  render(): import("lit-html").TemplateResult<1>;
23
59
  }
@@ -5,6 +5,7 @@ export * from "../packages/nys-backtotop/src/index";
5
5
  export * from "../packages/nys-button/src/index";
6
6
  export * from "../packages/nys-badge/src/index";
7
7
  export * from "../packages/nys-checkbox/src/index";
8
+ export * from "../packages/nys-datepicker/src/index";
8
9
  export * from "../packages/nys-divider/src/index";
9
10
  export * from "../packages/nys-errormessage/src/index";
10
11
  export * from "../packages/nys-fileinput/src/index";
@@ -16,6 +17,7 @@ export * from "../packages/nys-radiobutton/src/index";
16
17
  export * from "../packages/nys-select/src/index";
17
18
  export * from "../packages/nys-skipnav/src/index";
18
19
  export * from "../packages/nys-stepper/src/index";
20
+ export * from "../packages/nys-table/src/index";
19
21
  export * from "../packages/nys-textarea/src/index";
20
22
  export * from "../packages/nys-textinput/src/index";
21
23
  export * from "../packages/nys-toggle/src/index";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/components",
3
- "version": "1.12.0",
3
+ "version": "1.13.1",
4
4
  "description": "New York State's design system and code component library.",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "files": [
10
10
  "dist/",
11
- "!nys-stepper/"
11
+ "custom-elements.json"
12
12
  ],
13
13
  "main": "dist/nysds.js",
14
14
  "module": "dist/nysds.es.js",
@@ -20,31 +20,33 @@
20
20
  "require": "./dist/nysds.js"
21
21
  }
22
22
  },
23
+ "customElements": "custom-elements.json",
23
24
  "scripts": {
24
25
  "dev": "vite",
25
26
  "gen": "plop",
26
27
  "build": "tsc --emitDeclarationOnly && vite build",
27
28
  "build:umd": "tsc --emitDeclarationOnly && vite build --config vite.config.umd.js",
28
29
  "build:packages": "node src/scripts/build-order.js",
29
- "build:all": "npm run clean:dist && npm run lit-analyze && npm run lint && NODE_ENV=production npm run build:packages && NODE_ENV=production npm run build && NODE_ENV=production npm run build:umd && npm run cem",
30
+ "build:all": "npm run clean:dist && npm run lint && cross-env NODE_ENV=production npm run build:packages && cross-env NODE_ENV=production npm run build && cross-env NODE_ENV=production npm run build:umd && npm run lit-analyze || true && npm run cem && npm run cem:copy",
30
31
  "build:link": "npm run build:all && npm link",
31
32
  "lint": "eslint",
32
33
  "lint:fix": "eslint --fix",
33
- "lit-analyze": "lit-analyzer $(find ./packages -name '*.ts' ! -name '*.figma.*')",
34
- "release": "NODE_ENV=production npm run build:all && NODE_ENV=production npm run test && npm run cem && NODE_ENV=production npm publish --workspaces --access public && NODE_ENV=production npm publish --access public",
35
- "release:dry-run": "NODE_ENV=production npm run build:all && NODE_ENV=production npm run test && npm run cem && node src/scripts/publish-dry-run.js",
34
+ "lit-analyze": "find ./packages/nys-*/ -name '*.ts' ! -name '*.figma.*' | xargs lit-analyzer {}",
35
+ "release": "cross-env NODE_ENV=production npm run build:all && cross-env NODE_ENV=production npm run test && npm run cem && cross-env NODE_ENV=production npm publish --workspaces --access public && cross-env NODE_ENV=production npm publish --access public",
36
+ "release:dry-run": "cross-env NODE_ENV=production npm run build:all && cross-env NODE_ENV=production npm run test && npm run cem && node src/scripts/publish-dry-run.js",
36
37
  "release:alpha": "npm run build && npm run build:umd && npm publish --tag next",
37
38
  "test": "npx playwright install && wtr --node-resolve",
38
39
  "test:build": "npm run build:all && npm run test",
39
- "storybook": "NODE_ENV=production storybook dev -p 6006",
40
- "storybook:build:all": "NODE_ENV=production npm run build:all && npm run storybook",
40
+ "storybook": "cross-env NODE_ENV=production storybook dev -p 6006",
41
+ "storybook:build:all": "cross-env NODE_ENV=production npm run build:all && npm run storybook",
41
42
  "build-storybook": "npm run build:packages && storybook build",
42
43
  "storybook:cibuild": "storybook build",
43
44
  "clean:node": "rm -rf node_modules && rm -rf packages/*/node_modules && rm -rf packages/**/*/node_modules",
44
45
  "clean:dist": "rm -rf storybook-static && rm -rf coverage && rm -rf packages/*/coverage && rm -rf dist && rm -rf packages/*/dist && rm -rf packages/**/*/dist",
45
46
  "clean:all": "npm run clean:dist && npm run clean:node",
46
47
  "code-connect": "dotenv -- npx figma connect publish",
47
- "cem": "npx cem analyze --config 'custom-elements-manifest.config.mjs'"
48
+ "cem": "npx cem analyze --config ./custom-elements-manifest.config.mjs",
49
+ "cem:copy": "cp ./custom-elements.json dist/"
48
50
  },
49
51
  "repository": {
50
52
  "type": "git",
@@ -57,15 +59,15 @@
57
59
  },
58
60
  "homepage": "https://designsystem.ny.gov/",
59
61
  "devDependencies": {
60
- "@chromatic-com/storybook": "^4.1.3",
62
+ "@chromatic-com/storybook": "^5.0.0",
61
63
  "@custom-elements-manifest/analyzer": "^0.11.0",
62
64
  "@figma/code-connect": "^1.3.7",
63
65
  "@floating-ui/dom": "^1.7.4",
64
66
  "@open-wc/testing": "^4.0.0",
65
- "@storybook/addon-a11y": "10.0.8",
66
- "@storybook/addon-docs": "10.0.8",
67
- "@storybook/addon-links": "10.0.8",
68
- "@storybook/web-components-vite": "10.0.8",
67
+ "@storybook/addon-a11y": "10.2.0",
68
+ "@storybook/addon-docs": "10.2.0",
69
+ "@storybook/addon-links": "10.2.0",
70
+ "@storybook/web-components-vite": "10.2.0",
69
71
  "@types/mocha": "^10.0.10",
70
72
  "@typescript-eslint/eslint-plugin": "^8.46.2",
71
73
  "@typescript-eslint/parser": "^8.46.2",
@@ -74,13 +76,14 @@
74
76
  "@web/test-runner": "^0.20.2",
75
77
  "@web/test-runner-commands": "^0.9.0",
76
78
  "@web/test-runner-playwright": "^0.11.1",
79
+ "cross-env": "^10.1.0",
77
80
  "custom-element-react-wrappers": "^1.7.3",
78
81
  "custom-element-vs-code-integration": "^1.5.0",
79
82
  "dotenv-cli": "^10.0.0",
80
83
  "eslint": "^9.38.0",
81
84
  "eslint-plugin-lit": "^2.1.1",
82
85
  "eslint-plugin-prettier": "^5.5.4",
83
- "eslint-plugin-storybook": "10.0.8",
86
+ "eslint-plugin-storybook": "10.2.0",
84
87
  "i": "^0.3.7",
85
88
  "lit": "^3.3.1",
86
89
  "lit-analyzer": "^2.0.3",
@@ -90,7 +93,7 @@
90
93
  "rollup-plugin-visualizer": "^6.0.5",
91
94
  "sass": "^1.94.0",
92
95
  "sinon": "^21.0.0",
93
- "storybook": "10.0.8",
96
+ "storybook": "10.2.0",
94
97
  "tslib": "^2.8.1",
95
98
  "typescript": "^5.9.3",
96
99
  "vite": "^7.2.2"
@@ -103,5 +106,7 @@
103
106
  "overrides": {
104
107
  "storybook": "$storybook"
105
108
  },
106
- "customElements": "dist/custom-elements.json"
109
+ "dependencies": {
110
+ "wc-datepicker": "^0.9.2"
111
+ }
107
112
  }