@nysds/components 1.16.0-alpha-2 → 1.16.0-alpha3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/components",
3
- "version": "1.16.0-alpha-2",
3
+ "version": "1.16.0-alpha3",
4
4
  "description": "New York State's design system and code component library.",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -20,39 +20,41 @@
20
20
  "import": "./dist/nysds.es.js",
21
21
  "require": "./dist/nysds.js"
22
22
  },
23
- "./react": {
24
- "import": "./packages/react/index.js",
25
- "types": "./packages/react/index.d.ts"
26
- }
23
+ "./react": {
24
+ "import": "./packages/react/index.js",
25
+ "types": "./packages/react/index.d.ts"
26
+ }
27
27
  },
28
28
  "customElements": "custom-elements.json",
29
29
  "scripts": {
30
30
  "dev": "vite",
31
31
  "gen": "plop",
32
32
  "build": "tsc --emitDeclarationOnly && vite build",
33
- "build:umd": "tsc --emitDeclarationOnly && vite build --config vite.config.umd.js",
34
- "build:packages": "node src/scripts/build-order.js",
35
- "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 && npm run mcp-server:build",
36
- "build:link": "npm run build:all && npm link",
37
- "lint": "eslint && stylelint **/*.scss || true",
33
+ "build:umd": "cross-env BUILD_FORMAT=umd vite build",
34
+ "tsc:packages": "tsc -b tsconfig.build.json",
35
+ "build:packages": "npm run tsc:packages && turbo run build --filter='./packages/*'",
36
+ "build:root": "cross-env NODE_ENV=production npm run build && cross-env NODE_ENV=production npm run build:umd",
37
+ "build:all": "npm run clean:dist && npm run lint && npm run lit-analyze || true && cross-env NODE_ENV=production npm run build:packages && npm run build:root && npm run cem && npm run mcp-server:build",
38
+ "build:link": "npm run build:all && npm link && cd packages/styles && npm link",
39
+ "lint": "eslint --cache --cache-location node_modules/.cache/eslint && stylelint **/*.scss || true",
38
40
  "lint:fix": "eslint --fix && stylelint **/*.scss --fix",
39
41
  "lit-analyze": "find ./packages/nys-*/ -name '*.ts' ! -name '*.figma.*' | xargs lit-analyzer {}",
40
42
  "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",
41
43
  "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",
42
44
  "release:alpha": "npm run build && npm run build:umd && npm publish --tag next",
45
+ "release:zip": "npm run build:all && node src/scripts/create-release-zip.js",
43
46
  "test": "npx playwright install && wtr --node-resolve",
44
47
  "test:build": "npm run build:all && npm run test",
45
48
  "storybook": "cross-env NODE_ENV=production storybook dev -p 6006",
46
49
  "storybook:build:all": "cross-env NODE_ENV=production npm run build:all && npm run storybook",
47
50
  "build-storybook": "npm run build:packages && storybook build",
48
51
  "storybook:cibuild": "storybook build",
49
- "mcp-server:build": "node src/scripts/build-mcp-server.js",
52
+ "mcp-server:build": "turbo run build --filter=@nysds/mcp-server",
50
53
  "clean:node": "rm -rf node_modules && rm -rf packages/*/node_modules && rm -rf packages/**/*/node_modules",
51
54
  "clean:dist": "rm -rf storybook-static && rm -rf coverage && rm -rf packages/*/coverage && rm -rf dist && find packages -type d -name dist ! -path '*/mcp-server/dist' -exec rm -rf {} + 2>/dev/null || true",
52
- "clean:all": "npm run clean:dist && npm run clean:node",
55
+ "clean:all": "npm run clean:dist && npm run clean:node && find packages -name '*.tsbuildinfo' -delete 2>/dev/null || true",
53
56
  "code-connect": "dotenv -- npx figma connect publish",
54
- "cem": "npx cem analyze --config ./custom-elements-manifest.config.mjs",
55
- "cem:copy": "cp ./custom-elements.json dist/"
57
+ "cem": "npx cem analyze --config ./custom-elements-manifest.config.mjs && cp ./custom-elements.json dist/ && node src/scripts/patch-react-utils.js"
56
58
  },
57
59
  "repository": {
58
60
  "type": "git",
@@ -64,6 +66,7 @@
64
66
  "url": "https://github.com/ITS-HCD/nysds/issues"
65
67
  },
66
68
  "homepage": "https://designsystem.ny.gov/",
69
+ "packageManager": "npm@11.6.2",
67
70
  "devDependencies": {
68
71
  "@chromatic-com/storybook": "^5.0.1",
69
72
  "@custom-elements-manifest/analyzer": "^0.11.0",
@@ -83,6 +86,7 @@
83
86
  "@web/test-runner-commands": "^0.9.0",
84
87
  "@web/test-runner-playwright": "^0.11.1",
85
88
  "cross-env": "^10.1.0",
89
+ "custom-element-jsx-integration": "^1.6.0",
86
90
  "custom-element-react-wrappers": "^1.7.3",
87
91
  "custom-element-vs-code-integration": "^1.5.0",
88
92
  "dotenv-cli": "^10.0.0",
@@ -104,6 +108,7 @@
104
108
  "stylelint-config-standard": "^40.0.0",
105
109
  "stylelint-config-standard-scss": "^17.0.0",
106
110
  "tslib": "^2.8.1",
111
+ "turbo": "^2.8.20",
107
112
  "typescript": "^5.9.3",
108
113
  "vite": "^7.3.1"
109
114
  },
@@ -59,6 +59,9 @@ export interface NysTableProps extends Pick<
59
59
 
60
60
  /** Fired when the download button or sortable headers are clicked. */
61
61
  onNysClick?: (event: CustomEvent) => void;
62
+
63
+ /** Fired when a sortable column header is clicked. Can be prevented by calling `event.preventDefault()` to override default sort behavior. Detail: { columnIndex: number, columnLabel: string, sortDirection: "asc" | "desc" | "none" } */
64
+ onNysColumnSort?: (event: CustomEvent) => void;
62
65
  }
63
66
 
64
67
  /**
@@ -69,6 +72,7 @@ export interface NysTableProps extends Pick<
69
72
  *
70
73
  * ### **Events:**
71
74
  * - **nys-click** - Fired when the download button or sortable headers are clicked.
75
+ * - **nys-column-sort** - Fired when a sortable column header is clicked. Can be prevented by calling `event.preventDefault()` to override default sort behavior. Detail: { columnIndex: number, columnLabel: string, sortDirection: "asc" | "desc" | "none" }
72
76
  *
73
77
  * ### **Slots:**
74
78
  * - _default_ - Accepts a `<table>` element. Only the first table is rendered.
@@ -9,6 +9,7 @@ export const NysTable = forwardRef((props, forwardedRef) => {
9
9
 
10
10
  /** Event listeners - run once */
11
11
  useEventListener(ref, "nys-click", props.onNysClick);
12
+ useEventListener(ref, "nys-column-sort", props.onNysColumnSort);
12
13
 
13
14
  return React.createElement(
14
15
  "nys-table",
@@ -1,6 +1,6 @@
1
1
  # `@nysds/components/react` — Auto-generated React Wrappers
2
2
 
3
- This folder is **fully auto-generated** — do not edit files inside it directly.
3
+ ⚠️ This folder is **fully auto-generated** — do not edit files inside it directly!
4
4
  Files are regenerated every time `npm run cem` runs, which is called automatically by `npm run build:all`.
5
5
 
6
6
  ---
@@ -12,11 +12,11 @@ npm run cem
12
12
  └─► cem analyze --config custom-elements-manifest.config.mjs
13
13
  └─► customElementReactWrapperPlugin (custom-element-react-wrappers)
14
14
  └─► packages/react/
15
- ├── index.js barrel, one export per component
16
- ├── index.d.ts TypeScript types
17
- ├── react-utils.js internal hooks used by wrappers, do not use directly
18
- ├── NysButton.js one file per component
19
- └── etc.
15
+ ├── index.js <= barrel, one export per component
16
+ ├── index.d.ts <= TypeScript types
17
+ ├── react-utils.js <= auto generated internal hooks used by wrappers, do not use directly
18
+ ├── NysButton.js <= one file per component
19
+ └── ...etc.
20
20
  ```
21
21
 
22
22
  The plugin is configured in `custom-elements-manifest.config.mjs` at the repo root.
@@ -81,12 +81,12 @@ React 19 improves web component interop but doesn't bridge custom events to `on*
81
81
  ## Repo layout
82
82
 
83
83
  ```
84
- custom-elements-manifest.config.mjs plugin configured here
85
- package.json "./react" subpath export declared here
84
+ custom-elements-manifest.config.mjs <= plugin configured here
85
+ package.json <= "./react" subpath export declared here
86
86
  packages/
87
- react/ auto-generated, do not edit
87
+ react/ <= auto-generated, do not edit
88
88
  index.js
89
89
  index.d.ts
90
90
  react-utils.js
91
- NysButton.js etc.
91
+ NysButton.js ...etc.
92
92
  ```
@@ -1,37 +1,37 @@
1
1
  export * from "./NysAccordion.js";
2
2
  export * from "./NysAccordionItem.js";
3
+ export * from "./NysAlert.js";
3
4
  export * from "./NysAvatar.js";
4
5
  export * from "./NysBacktotop.js";
5
6
  export * from "./NysBadge.js";
6
- export * from "./NysAlert.js";
7
7
  export * from "./NysButton.js";
8
8
  export * from "./NysCheckbox.js";
9
9
  export * from "./NysCheckboxgroup.js";
10
10
  export * from "./NysCombobox.js";
11
+ export * from "./NysDatepicker.js";
11
12
  export * from "./NysDivider.js";
12
13
  export * from "./NysDropdownMenu.js";
13
14
  export * from "./NysDropdownMenuItem.js";
15
+ export * from "./NysErrorMessage.js";
14
16
  export * from "./NysFileinput.js";
15
17
  export * from "./NysFileItem.js";
16
18
  export * from "./NysGlobalFooter.js";
17
- export * from "./NysErrorMessage.js";
18
- export * from "./NysDatepicker.js";
19
19
  export * from "./NysGlobalHeader.js";
20
20
  export * from "./NysIcon.js";
21
+ export * from "./NysLabel.js";
21
22
  export * from "./NysModal.js";
22
23
  export * from "./NysPagination.js";
24
+ export * from "./NysRadiobutton.js";
25
+ export * from "./NysRadiogroup.js";
23
26
  export * from "./NysOption.js";
24
27
  export * from "./NysSelect.js";
25
28
  export * from "./NysSkipnav.js";
26
- export * from "./NysLabel.js";
27
- export * from "./NysRadiobutton.js";
28
- export * from "./NysRadiogroup.js";
29
29
  export * from "./NysStep.js";
30
30
  export * from "./NysStepper.js";
31
31
  export * from "./NysTable.js";
32
- export * from "./NysTooltip.js";
32
+ export * from "./NysTextarea.js";
33
+ export * from "./NysTextinput.js";
33
34
  export * from "./NysToggle.js";
35
+ export * from "./NysTooltip.js";
34
36
  export * from "./NysUnavFooter.js";
35
- export * from "./NysTextarea.js";
36
37
  export * from "./NysUnavHeader.js";
37
- export * from "./NysTextinput.js";
@@ -1,37 +1,37 @@
1
1
  export * from "./NysAccordion.js";
2
2
  export * from "./NysAccordionItem.js";
3
+ export * from "./NysAlert.js";
3
4
  export * from "./NysAvatar.js";
4
5
  export * from "./NysBacktotop.js";
5
6
  export * from "./NysBadge.js";
6
- export * from "./NysAlert.js";
7
7
  export * from "./NysButton.js";
8
8
  export * from "./NysCheckbox.js";
9
9
  export * from "./NysCheckboxgroup.js";
10
10
  export * from "./NysCombobox.js";
11
+ export * from "./NysDatepicker.js";
11
12
  export * from "./NysDivider.js";
12
13
  export * from "./NysDropdownMenu.js";
13
14
  export * from "./NysDropdownMenuItem.js";
15
+ export * from "./NysErrorMessage.js";
14
16
  export * from "./NysFileinput.js";
15
17
  export * from "./NysFileItem.js";
16
18
  export * from "./NysGlobalFooter.js";
17
- export * from "./NysErrorMessage.js";
18
- export * from "./NysDatepicker.js";
19
19
  export * from "./NysGlobalHeader.js";
20
20
  export * from "./NysIcon.js";
21
+ export * from "./NysLabel.js";
21
22
  export * from "./NysModal.js";
22
23
  export * from "./NysPagination.js";
24
+ export * from "./NysRadiobutton.js";
25
+ export * from "./NysRadiogroup.js";
23
26
  export * from "./NysOption.js";
24
27
  export * from "./NysSelect.js";
25
28
  export * from "./NysSkipnav.js";
26
- export * from "./NysLabel.js";
27
- export * from "./NysRadiobutton.js";
28
- export * from "./NysRadiogroup.js";
29
29
  export * from "./NysStep.js";
30
30
  export * from "./NysStepper.js";
31
31
  export * from "./NysTable.js";
32
- export * from "./NysTooltip.js";
32
+ export * from "./NysTextarea.js";
33
+ export * from "./NysTextinput.js";
33
34
  export * from "./NysToggle.js";
35
+ export * from "./NysTooltip.js";
34
36
  export * from "./NysUnavFooter.js";
35
- export * from "./NysTextarea.js";
36
37
  export * from "./NysUnavHeader.js";
37
- export * from "./NysTextinput.js";