diff --git a/change/@fluentui-chart-utilities-b37959c8-1fc0-4957-bef8-ef7436cd7541.json b/change/@fluentui-chart-utilities-b37959c8-1fc0-4957-bef8-ef7436cd7541.json new file mode 100644 index 00000000000000..190d0249ff7c88 --- /dev/null +++ b/change/@fluentui-chart-utilities-b37959c8-1fc0-4957-bef8-ef7436cd7541.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Add nested `module` condition under `node` so node-targeted bundlers (SSR) resolve ESM and tree-shake; bare Node and `require` consumers keep resolving CommonJS unchanged", + "packageName": "@fluentui/chart-utilities", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-global-context-e8e7b932-bc36-4fdc-9be9-1e12a1d8a949.json b/change/@fluentui-global-context-e8e7b932-bc36-4fdc-9be9-1e12a1d8a949.json new file mode 100644 index 00000000000000..dee6c6dad1e6b8 --- /dev/null +++ b/change/@fluentui-global-context-e8e7b932-bc36-4fdc-9be9-1e12a1d8a949.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/global-context", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-keyboard-keys-c678d39e-975b-4d2e-ae1a-de3f97489383.json b/change/@fluentui-keyboard-keys-c678d39e-975b-4d2e-ae1a-de3f97489383.json new file mode 100644 index 00000000000000..b36361c5b71bc9 --- /dev/null +++ b/change/@fluentui-keyboard-keys-c678d39e-975b-4d2e-ae1a-de3f97489383.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/keyboard-keys", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-priority-overflow-ddd98c10-4c8d-4597-b296-50c33b97a811.json b/change/@fluentui-priority-overflow-ddd98c10-4c8d-4597-b296-50c33b97a811.json new file mode 100644 index 00000000000000..b6e650bb52a632 --- /dev/null +++ b/change/@fluentui-priority-overflow-ddd98c10-4c8d-4597-b296-50c33b97a811.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/priority-overflow", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-accordion-24a1d1e2-1ae3-4d6b-8128-eb7dfe95f499.json b/change/@fluentui-react-accordion-24a1d1e2-1ae3-4d6b-8128-eb7dfe95f499.json new file mode 100644 index 00000000000000..4a03d47d47e439 --- /dev/null +++ b/change/@fluentui-react-accordion-24a1d1e2-1ae3-4d6b-8128-eb7dfe95f499.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-accordion", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-alert-a83574d9-d54d-47b0-b58f-96aefc791571.json b/change/@fluentui-react-alert-a83574d9-d54d-47b0-b58f-96aefc791571.json new file mode 100644 index 00000000000000..bef13b20e3085c --- /dev/null +++ b/change/@fluentui-react-alert-a83574d9-d54d-47b0-b58f-96aefc791571.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-alert", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-aria-ec2def8d-af70-4c22-ae1a-b6dacb83e837.json b/change/@fluentui-react-aria-ec2def8d-af70-4c22-ae1a-b6dacb83e837.json new file mode 100644 index 00000000000000..ee6b3e2958e414 --- /dev/null +++ b/change/@fluentui-react-aria-ec2def8d-af70-4c22-ae1a-b6dacb83e837.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-aria", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-avatar-6ecfeed1-dee8-46f7-8e45-cff428e62deb.json b/change/@fluentui-react-avatar-6ecfeed1-dee8-46f7-8e45-cff428e62deb.json new file mode 100644 index 00000000000000..c5b3c71d4aa3ab --- /dev/null +++ b/change/@fluentui-react-avatar-6ecfeed1-dee8-46f7-8e45-cff428e62deb.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-avatar", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-badge-36d58dfa-d47a-4090-b6df-3ddc9eae27e8.json b/change/@fluentui-react-badge-36d58dfa-d47a-4090-b6df-3ddc9eae27e8.json new file mode 100644 index 00000000000000..135d32d46cea87 --- /dev/null +++ b/change/@fluentui-react-badge-36d58dfa-d47a-4090-b6df-3ddc9eae27e8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-badge", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-breadcrumb-8830165f-d40a-48dd-9420-8e44e6e37c64.json b/change/@fluentui-react-breadcrumb-8830165f-d40a-48dd-9420-8e44e6e37c64.json new file mode 100644 index 00000000000000..cd8043f77c92b3 --- /dev/null +++ b/change/@fluentui-react-breadcrumb-8830165f-d40a-48dd-9420-8e44e6e37c64.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-breadcrumb", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-button-05c79b7f-0d9a-4431-9a44-72fc2e726d1a.json b/change/@fluentui-react-button-05c79b7f-0d9a-4431-9a44-72fc2e726d1a.json new file mode 100644 index 00000000000000..5f5039d8cba69d --- /dev/null +++ b/change/@fluentui-react-button-05c79b7f-0d9a-4431-9a44-72fc2e726d1a.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat: expose useSplitButtonBase_unstable hook", + "packageName": "@fluentui/react-button", + "email": "vgenaev@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-button-5ca0f2ec-a203-47ba-af0b-af4795b41072.json b/change/@fluentui-react-button-5ca0f2ec-a203-47ba-af0b-af4795b41072.json new file mode 100644 index 00000000000000..2f916976f740f4 --- /dev/null +++ b/change/@fluentui-react-button-5ca0f2ec-a203-47ba-af0b-af4795b41072.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-button", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-calendar-compat-a322fd69-9454-4406-a10f-2ab9c809f3ee.json b/change/@fluentui-react-calendar-compat-a322fd69-9454-4406-a10f-2ab9c809f3ee.json new file mode 100644 index 00000000000000..0411c113211de9 --- /dev/null +++ b/change/@fluentui-react-calendar-compat-a322fd69-9454-4406-a10f-2ab9c809f3ee.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-calendar-compat", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-card-e94fecd0-f1b0-4726-a65b-8ea1e905b3c0.json b/change/@fluentui-react-card-e94fecd0-f1b0-4726-a65b-8ea1e905b3c0.json new file mode 100644 index 00000000000000..a1418d7bd21960 --- /dev/null +++ b/change/@fluentui-react-card-e94fecd0-f1b0-4726-a65b-8ea1e905b3c0.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-card", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-carousel-6907df6f-c557-487f-b926-dcea2ad9db44.json b/change/@fluentui-react-carousel-6907df6f-c557-487f-b926-dcea2ad9db44.json new file mode 100644 index 00000000000000..c6549a2ffde0b7 --- /dev/null +++ b/change/@fluentui-react-carousel-6907df6f-c557-487f-b926-dcea2ad9db44.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-carousel", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-charts-6c79d2b2-1236-4326-8d7e-3b95706edd2c.json b/change/@fluentui-react-charts-6c79d2b2-1236-4326-8d7e-3b95706edd2c.json new file mode 100644 index 00000000000000..63ac55fb943097 --- /dev/null +++ b/change/@fluentui-react-charts-6c79d2b2-1236-4326-8d7e-3b95706edd2c.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-charts", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-checkbox-4c5c4691-f756-4134-be64-866fab3b2c70.json b/change/@fluentui-react-checkbox-4c5c4691-f756-4134-be64-866fab3b2c70.json new file mode 100644 index 00000000000000..46b66cfb6cf7b2 --- /dev/null +++ b/change/@fluentui-react-checkbox-4c5c4691-f756-4134-be64-866fab3b2c70.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-checkbox", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-color-picker-244d4727-8a5d-4863-94f9-545b45df99d3.json b/change/@fluentui-react-color-picker-244d4727-8a5d-4863-94f9-545b45df99d3.json new file mode 100644 index 00000000000000..3fb57a09e2aa29 --- /dev/null +++ b/change/@fluentui-react-color-picker-244d4727-8a5d-4863-94f9-545b45df99d3.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "refactor: Replace the tinycolor dependency with internal utilities.", + "packageName": "@fluentui/react-color-picker", + "email": "dmytrokirpa@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-color-picker-c39025a0-527e-43a7-bdb2-b8f3f6f32653.json b/change/@fluentui-react-color-picker-c39025a0-527e-43a7-bdb2-b8f3f6f32653.json new file mode 100644 index 00000000000000..1e68b6aae2f819 --- /dev/null +++ b/change/@fluentui-react-color-picker-c39025a0-527e-43a7-bdb2-b8f3f6f32653.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-color-picker", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-combobox-2279c1cb-6864-4788-bac7-0505dde975b2.json b/change/@fluentui-react-combobox-2279c1cb-6864-4788-bac7-0505dde975b2.json new file mode 100644 index 00000000000000..19f739b6ab7a6c --- /dev/null +++ b/change/@fluentui-react-combobox-2279c1cb-6864-4788-bac7-0505dde975b2.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-combobox", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-components-afa0f223-70bc-49a0-85ef-5ccb4feff18a.json b/change/@fluentui-react-components-afa0f223-70bc-49a0-85ef-5ccb4feff18a.json new file mode 100644 index 00000000000000..27825cf6bffb08 --- /dev/null +++ b/change/@fluentui-react-components-afa0f223-70bc-49a0-85ef-5ccb4feff18a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-components", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-context-selector-7955484a-23dc-4909-9b29-fc0cb35e56c9.json b/change/@fluentui-react-context-selector-7955484a-23dc-4909-9b29-fc0cb35e56c9.json new file mode 100644 index 00000000000000..167fd11e82a62f --- /dev/null +++ b/change/@fluentui-react-context-selector-7955484a-23dc-4909-9b29-fc0cb35e56c9.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-context-selector", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-datepicker-compat-42a1ccdd-192d-4609-ba13-4aac94badd54.json b/change/@fluentui-react-datepicker-compat-42a1ccdd-192d-4609-ba13-4aac94badd54.json new file mode 100644 index 00000000000000..0fa691645f130d --- /dev/null +++ b/change/@fluentui-react-datepicker-compat-42a1ccdd-192d-4609-ba13-4aac94badd54.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-datepicker-compat", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-dialog-587cb476-df03-4b70-99ca-93af982b6f50.json b/change/@fluentui-react-dialog-587cb476-df03-4b70-99ca-93af982b6f50.json new file mode 100644 index 00000000000000..246c6b91528063 --- /dev/null +++ b/change/@fluentui-react-dialog-587cb476-df03-4b70-99ca-93af982b6f50.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-dialog", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-divider-3f853e4d-6f0b-4fb9-87b0-485f2d4839c9.json b/change/@fluentui-react-divider-3f853e4d-6f0b-4fb9-87b0-485f2d4839c9.json new file mode 100644 index 00000000000000..3cfcb5118743fd --- /dev/null +++ b/change/@fluentui-react-divider-3f853e4d-6f0b-4fb9-87b0-485f2d4839c9.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-divider", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-drawer-e194a08d-0888-40b5-a147-369a950ba288.json b/change/@fluentui-react-drawer-e194a08d-0888-40b5-a147-369a950ba288.json new file mode 100644 index 00000000000000..92c0dc5d4e23a4 --- /dev/null +++ b/change/@fluentui-react-drawer-e194a08d-0888-40b5-a147-369a950ba288.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-drawer", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-field-470f4e2f-092b-4903-bd34-d654b75731b8.json b/change/@fluentui-react-field-470f4e2f-092b-4903-bd34-d654b75731b8.json new file mode 100644 index 00000000000000..40e27a93fd8b59 --- /dev/null +++ b/change/@fluentui-react-field-470f4e2f-092b-4903-bd34-d654b75731b8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-field", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-headless-components-preview-0cbb853a-317a-4383-a7be-92db2ea054de.json b/change/@fluentui-react-headless-components-preview-0cbb853a-317a-4383-a7be-92db2ea054de.json new file mode 100644 index 00000000000000..b9f03434726ef3 --- /dev/null +++ b/change/@fluentui-react-headless-components-preview-0cbb853a-317a-4383-a7be-92db2ea054de.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Add `module` export condition so node-targeted bundlers resolve ESM (tree-shaking) while bare Node stays CommonJS; emit fully-specified .js import paths", + "packageName": "@fluentui/react-headless-components-preview", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-headless-components-preview-36d8a49b-db93-4a50-84b4-98bccd2f1e61.json b/change/@fluentui-react-headless-components-preview-36d8a49b-db93-4a50-84b4-98bccd2f1e61.json new file mode 100644 index 00000000000000..0a686162cc8839 --- /dev/null +++ b/change/@fluentui-react-headless-components-preview-36d8a49b-db93-4a50-84b4-98bccd2f1e61.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "feat: add headless SplitButton", + "packageName": "@fluentui/react-headless-components-preview", + "email": "vgenaev@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-headless-components-preview-7c3a1f2e-4b8d-4e6a-9f1c-2d5e8a9b0c4d.json b/change/@fluentui-react-headless-components-preview-7c3a1f2e-4b8d-4e6a-9f1c-2d5e8a9b0c4d.json new file mode 100644 index 00000000000000..7d3577e3060a44 --- /dev/null +++ b/change/@fluentui-react-headless-components-preview-7c3a1f2e-4b8d-4e6a-9f1c-2d5e8a9b0c4d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-headless-components-preview", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-headless-components-preview-c8cb7148-c943-4b57-a108-30f93ac28556.json b/change/@fluentui-react-headless-components-preview-c8cb7148-c943-4b57-a108-30f93ac28556.json new file mode 100644 index 00000000000000..90ef6a8b3432c7 --- /dev/null +++ b/change/@fluentui-react-headless-components-preview-c8cb7148-c943-4b57-a108-30f93ac28556.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: use custom renderTagPicker function for TagPicker component to avoid pulling Portal", + "packageName": "@fluentui/react-headless-components-preview", + "email": "dmytrokirpa@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-icons-compat-3bf3eb47-ac44-4571-9305-11044a55d237.json b/change/@fluentui-react-icons-compat-3bf3eb47-ac44-4571-9305-11044a55d237.json new file mode 100644 index 00000000000000..292bb93e8112c7 --- /dev/null +++ b/change/@fluentui-react-icons-compat-3bf3eb47-ac44-4571-9305-11044a55d237.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-icons-compat", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-image-c303b1bf-f400-4a3e-9e68-a0e966bafffb.json b/change/@fluentui-react-image-c303b1bf-f400-4a3e-9e68-a0e966bafffb.json new file mode 100644 index 00000000000000..c4297a97fa7712 --- /dev/null +++ b/change/@fluentui-react-image-c303b1bf-f400-4a3e-9e68-a0e966bafffb.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-image", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-infobutton-34bbeca0-e082-464d-8820-8a545252a02d.json b/change/@fluentui-react-infobutton-34bbeca0-e082-464d-8820-8a545252a02d.json new file mode 100644 index 00000000000000..a25e9a9c817725 --- /dev/null +++ b/change/@fluentui-react-infobutton-34bbeca0-e082-464d-8820-8a545252a02d.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-infobutton", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-infolabel-2c6af8d9-d1e7-4641-bf52-b59c7b159ac8.json b/change/@fluentui-react-infolabel-2c6af8d9-d1e7-4641-bf52-b59c7b159ac8.json new file mode 100644 index 00000000000000..a5eec0569a1191 --- /dev/null +++ b/change/@fluentui-react-infolabel-2c6af8d9-d1e7-4641-bf52-b59c7b159ac8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-infolabel", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-input-62cfaa70-308e-4d8d-b296-339766551db3.json b/change/@fluentui-react-input-62cfaa70-308e-4d8d-b296-339766551db3.json new file mode 100644 index 00000000000000..487430ea33209c --- /dev/null +++ b/change/@fluentui-react-input-62cfaa70-308e-4d8d-b296-339766551db3.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-input", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-jsx-runtime-0c75dc50-61fb-49f5-b472-18ad918207ba.json b/change/@fluentui-react-jsx-runtime-0c75dc50-61fb-49f5-b472-18ad918207ba.json new file mode 100644 index 00000000000000..b6e68920348369 --- /dev/null +++ b/change/@fluentui-react-jsx-runtime-0c75dc50-61fb-49f5-b472-18ad918207ba.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-jsx-runtime", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-label-5aa3bb7a-26a3-4b44-9fbc-9593db7fbfcb.json b/change/@fluentui-react-label-5aa3bb7a-26a3-4b44-9fbc-9593db7fbfcb.json new file mode 100644 index 00000000000000..4382b1bdebfe57 --- /dev/null +++ b/change/@fluentui-react-label-5aa3bb7a-26a3-4b44-9fbc-9593db7fbfcb.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-label", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-link-5c956aaa-9ef3-42b2-953b-af7b9b467e9e.json b/change/@fluentui-react-link-5c956aaa-9ef3-42b2-953b-af7b9b467e9e.json new file mode 100644 index 00000000000000..da78d7208d92ce --- /dev/null +++ b/change/@fluentui-react-link-5c956aaa-9ef3-42b2-953b-af7b9b467e9e.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-link", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-list-bec2fc87-aaec-465b-9bed-e753037522a5.json b/change/@fluentui-react-list-bec2fc87-aaec-465b-9bed-e753037522a5.json new file mode 100644 index 00000000000000..2531d4aa333526 --- /dev/null +++ b/change/@fluentui-react-list-bec2fc87-aaec-465b-9bed-e753037522a5.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-list", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-menu-a1afb852-808b-4b9b-8412-bac5ed6e3af3.json b/change/@fluentui-react-menu-a1afb852-808b-4b9b-8412-bac5ed6e3af3.json new file mode 100644 index 00000000000000..6d1063f7bf219b --- /dev/null +++ b/change/@fluentui-react-menu-a1afb852-808b-4b9b-8412-bac5ed6e3af3.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-menu", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-menu-grid-preview-e3405dd1-491b-40a4-a8b6-16b1fb14a018.json b/change/@fluentui-react-menu-grid-preview-e3405dd1-491b-40a4-a8b6-16b1fb14a018.json new file mode 100644 index 00000000000000..fb4d6b9183e597 --- /dev/null +++ b/change/@fluentui-react-menu-grid-preview-e3405dd1-491b-40a4-a8b6-16b1fb14a018.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-menu-grid-preview", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-message-bar-17c4c1cb-68f9-4b1a-9c16-716aa6bfd315.json b/change/@fluentui-react-message-bar-17c4c1cb-68f9-4b1a-9c16-716aa6bfd315.json new file mode 100644 index 00000000000000..e25db3d1bbac36 --- /dev/null +++ b/change/@fluentui-react-message-bar-17c4c1cb-68f9-4b1a-9c16-716aa6bfd315.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-message-bar", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-migration-v0-v9-173f8687-50f3-452d-a46c-7507bb15c424.json b/change/@fluentui-react-migration-v0-v9-173f8687-50f3-452d-a46c-7507bb15c424.json new file mode 100644 index 00000000000000..99fa0f3f742ce2 --- /dev/null +++ b/change/@fluentui-react-migration-v0-v9-173f8687-50f3-452d-a46c-7507bb15c424.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-migration-v0-v9", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-migration-v8-v9-e0c706a9-5ec7-4f6c-b42f-0af13e508b15.json b/change/@fluentui-react-migration-v8-v9-e0c706a9-5ec7-4f6c-b42f-0af13e508b15.json new file mode 100644 index 00000000000000..edb76982941ff1 --- /dev/null +++ b/change/@fluentui-react-migration-v8-v9-e0c706a9-5ec7-4f6c-b42f-0af13e508b15.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-migration-v8-v9", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-motion-812a7dcc-49a0-403a-b3c0-fa033fae5d4e.json b/change/@fluentui-react-motion-812a7dcc-49a0-403a-b3c0-fa033fae5d4e.json new file mode 100644 index 00000000000000..be7114046e539b --- /dev/null +++ b/change/@fluentui-react-motion-812a7dcc-49a0-403a-b3c0-fa033fae5d4e.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-motion", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-motion-components-preview-6919eecc-3e3a-4ab2-9508-2acfc8be6892.json b/change/@fluentui-react-motion-components-preview-6919eecc-3e3a-4ab2-9508-2acfc8be6892.json new file mode 100644 index 00000000000000..5314085df5331b --- /dev/null +++ b/change/@fluentui-react-motion-components-preview-6919eecc-3e3a-4ab2-9508-2acfc8be6892.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-motion-components-preview", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-nav-eaf56730-d52b-4309-a6af-26f425d1e4af.json b/change/@fluentui-react-nav-eaf56730-d52b-4309-a6af-26f425d1e4af.json new file mode 100644 index 00000000000000..7bd2b4ba6b2f94 --- /dev/null +++ b/change/@fluentui-react-nav-eaf56730-d52b-4309-a6af-26f425d1e4af.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-nav", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-overflow-b940e0cd-3a31-4210-a484-205bfe15aa86.json b/change/@fluentui-react-overflow-b940e0cd-3a31-4210-a484-205bfe15aa86.json new file mode 100644 index 00000000000000..d66c28ae099342 --- /dev/null +++ b/change/@fluentui-react-overflow-b940e0cd-3a31-4210-a484-205bfe15aa86.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-overflow", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-persona-fe72f585-73fd-4728-b66b-81208f5db93a.json b/change/@fluentui-react-persona-fe72f585-73fd-4728-b66b-81208f5db93a.json new file mode 100644 index 00000000000000..533f31dbbb8936 --- /dev/null +++ b/change/@fluentui-react-persona-fe72f585-73fd-4728-b66b-81208f5db93a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-persona", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-popover-d3158fd7-1157-4349-a532-d0a9333d8d59.json b/change/@fluentui-react-popover-d3158fd7-1157-4349-a532-d0a9333d8d59.json new file mode 100644 index 00000000000000..76eaf0a1bc4618 --- /dev/null +++ b/change/@fluentui-react-popover-d3158fd7-1157-4349-a532-d0a9333d8d59.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-popover", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-portal-7c7856eb-7a90-4391-bf5e-e46d4f8120a6.json b/change/@fluentui-react-portal-7c7856eb-7a90-4391-bf5e-e46d4f8120a6.json new file mode 100644 index 00000000000000..99bf3372c1afbe --- /dev/null +++ b/change/@fluentui-react-portal-7c7856eb-7a90-4391-bf5e-e46d4f8120a6.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-portal", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-portal-compat-45f99d4d-35b4-4112-99af-12aa3a6eadcd.json b/change/@fluentui-react-portal-compat-45f99d4d-35b4-4112-99af-12aa3a6eadcd.json new file mode 100644 index 00000000000000..c319cfb3769b48 --- /dev/null +++ b/change/@fluentui-react-portal-compat-45f99d4d-35b4-4112-99af-12aa3a6eadcd.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-portal-compat", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-portal-compat-context-988005d7-a101-4dc4-8bcd-1b600e00add9.json b/change/@fluentui-react-portal-compat-context-988005d7-a101-4dc4-8bcd-1b600e00add9.json new file mode 100644 index 00000000000000..412b6703947a74 --- /dev/null +++ b/change/@fluentui-react-portal-compat-context-988005d7-a101-4dc4-8bcd-1b600e00add9.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-portal-compat-context", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-positioning-75c6dfb1-fbac-4e84-b2fc-3a10e6bc3e43.json b/change/@fluentui-react-positioning-75c6dfb1-fbac-4e84-b2fc-3a10e6bc3e43.json new file mode 100644 index 00000000000000..c4f781a066027c --- /dev/null +++ b/change/@fluentui-react-positioning-75c6dfb1-fbac-4e84-b2fc-3a10e6bc3e43.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-positioning", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-progress-0d1a6e0e-460c-433f-9f2e-066f9bb123f9.json b/change/@fluentui-react-progress-0d1a6e0e-460c-433f-9f2e-066f9bb123f9.json new file mode 100644 index 00000000000000..c23cc03dc16d8a --- /dev/null +++ b/change/@fluentui-react-progress-0d1a6e0e-460c-433f-9f2e-066f9bb123f9.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-progress", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-provider-3b71f083-6280-4945-840a-9e4d65059122.json b/change/@fluentui-react-provider-3b71f083-6280-4945-840a-9e4d65059122.json new file mode 100644 index 00000000000000..49199ca9988b4b --- /dev/null +++ b/change/@fluentui-react-provider-3b71f083-6280-4945-840a-9e4d65059122.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-provider", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-radio-5a2cfd79-edb9-4bf8-b179-ed1431ee6e7f.json b/change/@fluentui-react-radio-5a2cfd79-edb9-4bf8-b179-ed1431ee6e7f.json new file mode 100644 index 00000000000000..5994c940f5bc37 --- /dev/null +++ b/change/@fluentui-react-radio-5a2cfd79-edb9-4bf8-b179-ed1431ee6e7f.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-radio", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-rating-c5360c9f-1ee0-4126-a996-d62c09304d3d.json b/change/@fluentui-react-rating-c5360c9f-1ee0-4126-a996-d62c09304d3d.json new file mode 100644 index 00000000000000..572158c38d9f39 --- /dev/null +++ b/change/@fluentui-react-rating-c5360c9f-1ee0-4126-a996-d62c09304d3d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-rating", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-search-f36078f9-e5fc-4344-b2db-44b941ffa91a.json b/change/@fluentui-react-search-f36078f9-e5fc-4344-b2db-44b941ffa91a.json new file mode 100644 index 00000000000000..18c722d3cc9864 --- /dev/null +++ b/change/@fluentui-react-search-f36078f9-e5fc-4344-b2db-44b941ffa91a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-search", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-select-50a85be5-0955-4c16-b6db-527d2bfe6f06.json b/change/@fluentui-react-select-50a85be5-0955-4c16-b6db-527d2bfe6f06.json new file mode 100644 index 00000000000000..0e946cdc575f57 --- /dev/null +++ b/change/@fluentui-react-select-50a85be5-0955-4c16-b6db-527d2bfe6f06.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-select", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-shared-contexts-e8cb05d3-69e1-4bc6-bab3-017d3e8a1494.json b/change/@fluentui-react-shared-contexts-e8cb05d3-69e1-4bc6-bab3-017d3e8a1494.json new file mode 100644 index 00000000000000..87cc3c0033739c --- /dev/null +++ b/change/@fluentui-react-shared-contexts-e8cb05d3-69e1-4bc6-bab3-017d3e8a1494.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-shared-contexts", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-skeleton-b0363764-3e25-49b3-8534-959a0834591a.json b/change/@fluentui-react-skeleton-b0363764-3e25-49b3-8534-959a0834591a.json new file mode 100644 index 00000000000000..ce24884cda8125 --- /dev/null +++ b/change/@fluentui-react-skeleton-b0363764-3e25-49b3-8534-959a0834591a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-skeleton", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-slider-c6183a1f-7fc7-42f2-91d0-998387bcfd40.json b/change/@fluentui-react-slider-c6183a1f-7fc7-42f2-91d0-998387bcfd40.json new file mode 100644 index 00000000000000..ced5b2a8e671e0 --- /dev/null +++ b/change/@fluentui-react-slider-c6183a1f-7fc7-42f2-91d0-998387bcfd40.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-slider", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-spinbutton-dca37a6e-a46f-4f45-bd1e-92c5860795f8.json b/change/@fluentui-react-spinbutton-dca37a6e-a46f-4f45-bd1e-92c5860795f8.json new file mode 100644 index 00000000000000..d2927029ea06a4 --- /dev/null +++ b/change/@fluentui-react-spinbutton-dca37a6e-a46f-4f45-bd1e-92c5860795f8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-spinbutton", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-spinner-f5da929d-c544-49d3-a8b9-4e942a0ab991.json b/change/@fluentui-react-spinner-f5da929d-c544-49d3-a8b9-4e942a0ab991.json new file mode 100644 index 00000000000000..ae9ebefc3e0738 --- /dev/null +++ b/change/@fluentui-react-spinner-f5da929d-c544-49d3-a8b9-4e942a0ab991.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-spinner", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-storybook-addon-22046dc1-5e5f-4957-b654-02a63311aa3b.json b/change/@fluentui-react-storybook-addon-22046dc1-5e5f-4957-b654-02a63311aa3b.json new file mode 100644 index 00000000000000..2c7d8c6d2623a0 --- /dev/null +++ b/change/@fluentui-react-storybook-addon-22046dc1-5e5f-4957-b654-02a63311aa3b.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Add `module` export condition so node-targeted bundlers resolve ESM (tree-shaking) while bare Node stays CommonJS; emit fully-specified .js import paths", + "packageName": "@fluentui/react-storybook-addon", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-storybook-addon-export-to-sandbox-c0469bed-1761-4a1f-930a-5f4a92d97749.json b/change/@fluentui-react-storybook-addon-export-to-sandbox-c0469bed-1761-4a1f-930a-5f4a92d97749.json new file mode 100644 index 00000000000000..546ebf27d5faa0 --- /dev/null +++ b/change/@fluentui-react-storybook-addon-export-to-sandbox-c0469bed-1761-4a1f-930a-5f4a92d97749.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Add `module` export condition so node-targeted bundlers resolve ESM (tree-shaking) while bare Node stays CommonJS; emit fully-specified .js import paths", + "packageName": "@fluentui/react-storybook-addon-export-to-sandbox", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-swatch-picker-29cb736f-3997-4405-aad2-ec8d968a0b8b.json b/change/@fluentui-react-swatch-picker-29cb736f-3997-4405-aad2-ec8d968a0b8b.json new file mode 100644 index 00000000000000..2d33f3461698b9 --- /dev/null +++ b/change/@fluentui-react-swatch-picker-29cb736f-3997-4405-aad2-ec8d968a0b8b.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: Move ColorSwatch styling out of the headless base hook.", + "packageName": "@fluentui/react-swatch-picker", + "email": "dmytrokirpa@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-swatch-picker-2beeb0ee-6c84-4cbc-8418-06c3a2b20b7e.json b/change/@fluentui-react-swatch-picker-2beeb0ee-6c84-4cbc-8418-06c3a2b20b7e.json new file mode 100644 index 00000000000000..0a645b300e7666 --- /dev/null +++ b/change/@fluentui-react-swatch-picker-2beeb0ee-6c84-4cbc-8418-06c3a2b20b7e.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-swatch-picker", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-switch-3dd465b9-7d34-4360-ba4b-78e0953a5f74.json b/change/@fluentui-react-switch-3dd465b9-7d34-4360-ba4b-78e0953a5f74.json new file mode 100644 index 00000000000000..b7e2acb3d36d7e --- /dev/null +++ b/change/@fluentui-react-switch-3dd465b9-7d34-4360-ba4b-78e0953a5f74.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-switch", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-table-2e387656-9d47-4fcf-a040-ded685f88e61.json b/change/@fluentui-react-table-2e387656-9d47-4fcf-a040-ded685f88e61.json new file mode 100644 index 00000000000000..f919f3c63be95e --- /dev/null +++ b/change/@fluentui-react-table-2e387656-9d47-4fcf-a040-ded685f88e61.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-table", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-tabs-cbe17ac0-877b-42ae-8b6c-2ca1c54f0b15.json b/change/@fluentui-react-tabs-cbe17ac0-877b-42ae-8b6c-2ca1c54f0b15.json new file mode 100644 index 00000000000000..150c6e4b8718a9 --- /dev/null +++ b/change/@fluentui-react-tabs-cbe17ac0-877b-42ae-8b6c-2ca1c54f0b15.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-tabs", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-tabster-ebc0290d-74b5-422e-ad4f-cee62c088f36.json b/change/@fluentui-react-tabster-ebc0290d-74b5-422e-ad4f-cee62c088f36.json new file mode 100644 index 00000000000000..e37199d01b820c --- /dev/null +++ b/change/@fluentui-react-tabster-ebc0290d-74b5-422e-ad4f-cee62c088f36.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-tabster", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-tag-picker-766c6c8b-75ed-4068-8d69-017c7a2809ef.json b/change/@fluentui-react-tag-picker-766c6c8b-75ed-4068-8d69-017c7a2809ef.json new file mode 100644 index 00000000000000..e0f1acf894519a --- /dev/null +++ b/change/@fluentui-react-tag-picker-766c6c8b-75ed-4068-8d69-017c7a2809ef.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-tag-picker", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-tags-1edffb10-ddbd-4600-8119-079e31643710.json b/change/@fluentui-react-tags-1edffb10-ddbd-4600-8119-079e31643710.json new file mode 100644 index 00000000000000..3c07d9a9d2811b --- /dev/null +++ b/change/@fluentui-react-tags-1edffb10-ddbd-4600-8119-079e31643710.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-tags", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-teaching-popover-553c3344-fa74-41f3-96d3-c49ebb45fffa.json b/change/@fluentui-react-teaching-popover-553c3344-fa74-41f3-96d3-c49ebb45fffa.json new file mode 100644 index 00000000000000..9bb890e86a4338 --- /dev/null +++ b/change/@fluentui-react-teaching-popover-553c3344-fa74-41f3-96d3-c49ebb45fffa.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-teaching-popover", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-text-b5a6e03f-c376-460a-a4e8-2b8c67f99eda.json b/change/@fluentui-react-text-b5a6e03f-c376-460a-a4e8-2b8c67f99eda.json new file mode 100644 index 00000000000000..4c126ce3c44c91 --- /dev/null +++ b/change/@fluentui-react-text-b5a6e03f-c376-460a-a4e8-2b8c67f99eda.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-text", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-textarea-c90bdd60-d827-43ab-96b0-d4f519ef0176.json b/change/@fluentui-react-textarea-c90bdd60-d827-43ab-96b0-d4f519ef0176.json new file mode 100644 index 00000000000000..d86fafd9dd324b --- /dev/null +++ b/change/@fluentui-react-textarea-c90bdd60-d827-43ab-96b0-d4f519ef0176.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-textarea", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-theme-38b2cfbb-76be-4daa-ba35-588ce1e208bb.json b/change/@fluentui-react-theme-38b2cfbb-76be-4daa-ba35-588ce1e208bb.json new file mode 100644 index 00000000000000..1bcad654e68fd7 --- /dev/null +++ b/change/@fluentui-react-theme-38b2cfbb-76be-4daa-ba35-588ce1e208bb.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-theme", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-theme-sass-6eda362e-202b-44cb-9a94-3c6bbb3fef2e.json b/change/@fluentui-react-theme-sass-6eda362e-202b-44cb-9a94-3c6bbb3fef2e.json new file mode 100644 index 00000000000000..64575cf9f3240f --- /dev/null +++ b/change/@fluentui-react-theme-sass-6eda362e-202b-44cb-9a94-3c6bbb3fef2e.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-theme-sass", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-timepicker-compat-191558d0-8705-4856-935a-c47bbffe6f5c.json b/change/@fluentui-react-timepicker-compat-191558d0-8705-4856-935a-c47bbffe6f5c.json new file mode 100644 index 00000000000000..fd11311041f7c6 --- /dev/null +++ b/change/@fluentui-react-timepicker-compat-191558d0-8705-4856-935a-c47bbffe6f5c.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-timepicker-compat", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-toast-6ca07605-6ced-470a-a8af-e9025f217c2d.json b/change/@fluentui-react-toast-6ca07605-6ced-470a-a8af-e9025f217c2d.json new file mode 100644 index 00000000000000..71a3951b651f81 --- /dev/null +++ b/change/@fluentui-react-toast-6ca07605-6ced-470a-a8af-e9025f217c2d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-toast", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-toolbar-a424ed41-dd0d-4072-8a39-4a4f3b5e8dd7.json b/change/@fluentui-react-toolbar-a424ed41-dd0d-4072-8a39-4a4f3b5e8dd7.json new file mode 100644 index 00000000000000..0813b0595617e9 --- /dev/null +++ b/change/@fluentui-react-toolbar-a424ed41-dd0d-4072-8a39-4a4f3b5e8dd7.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-toolbar", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-tooltip-20492802-285d-4140-a5eb-2a617752160f.json b/change/@fluentui-react-tooltip-20492802-285d-4140-a5eb-2a617752160f.json new file mode 100644 index 00000000000000..6be6d83542c3b7 --- /dev/null +++ b/change/@fluentui-react-tooltip-20492802-285d-4140-a5eb-2a617752160f.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-tooltip", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-tree-58c91467-4503-4983-b7bf-b42a20acc81b.json b/change/@fluentui-react-tree-58c91467-4503-4983-b7bf-b42a20acc81b.json new file mode 100644 index 00000000000000..dad190fa5461fe --- /dev/null +++ b/change/@fluentui-react-tree-58c91467-4503-4983-b7bf-b42a20acc81b.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-tree", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-utilities-01a47879-4d97-4d59-82ba-62879cabef50.json b/change/@fluentui-react-utilities-01a47879-4d97-4d59-82ba-62879cabef50.json new file mode 100644 index 00000000000000..442dc83bc2cb2e --- /dev/null +++ b/change/@fluentui-react-utilities-01a47879-4d97-4d59-82ba-62879cabef50.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-utilities", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-virtualizer-bf8007d9-90c1-44e2-9773-8eedddda347d.json b/change/@fluentui-react-virtualizer-bf8007d9-90c1-44e2-9773-8eedddda347d.json new file mode 100644 index 00000000000000..f9761ca1793b74 --- /dev/null +++ b/change/@fluentui-react-virtualizer-bf8007d9-90c1-44e2-9773-8eedddda347d.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/react-virtualizer", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-tokens-010b8f43-184f-46ed-a093-72532aeec11d.json b/change/@fluentui-tokens-010b8f43-184f-46ed-a093-72532aeec11d.json new file mode 100644 index 00000000000000..59413f311b4344 --- /dev/null +++ b/change/@fluentui-tokens-010b8f43-184f-46ed-a093-72532aeec11d.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake.", + "packageName": "@fluentui/tokens", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-web-components-104cf3d5-cc75-4155-bf96-361db73b4f56.json b/change/@fluentui-web-components-104cf3d5-cc75-4155-bf96-361db73b4f56.json new file mode 100644 index 00000000000000..ec479c130161d9 --- /dev/null +++ b/change/@fluentui-web-components-104cf3d5-cc75-4155-bf96-361db73b4f56.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "Use a namespace import for the now ESM-only `@fluentui/tokens`", + "packageName": "@fluentui/web-components", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/packages/charts/chart-utilities/package.json b/packages/charts/chart-utilities/package.json index 9d9c6d1d7ecc75..3cc275ff359110 100644 --- a/packages/charts/chart-utilities/package.json +++ b/packages/charts/chart-utilities/package.json @@ -35,7 +35,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", + "node": { + "module": "./lib/index.js", + "default": "./lib-commonjs/index.js" + }, "import": "./lib/index.js", "require": "./lib-commonjs/index.js" }, diff --git a/packages/charts/react-charts/library/.swcrc b/packages/charts/react-charts/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/charts/react-charts/library/.swcrc +++ b/packages/charts/react-charts/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/charts/react-charts/library/config/tests.js b/packages/charts/react-charts/library/config/tests.cjs similarity index 100% rename from packages/charts/react-charts/library/config/tests.js rename to packages/charts/react-charts/library/config/tests.cjs diff --git a/packages/charts/react-charts/library/eslint.config.js b/packages/charts/react-charts/library/eslint.config.cjs similarity index 100% rename from packages/charts/react-charts/library/eslint.config.js rename to packages/charts/react-charts/library/eslint.config.cjs diff --git a/packages/charts/react-charts/library/jest.config.js b/packages/charts/react-charts/library/jest.config.cjs similarity index 97% rename from packages/charts/react-charts/library/jest.config.js rename to packages/charts/react-charts/library/jest.config.cjs index 254c931717b07a..ff7edc6484f5ca 100644 --- a/packages/charts/react-charts/library/jest.config.js +++ b/packages/charts/react-charts/library/jest.config.cjs @@ -58,7 +58,7 @@ module.exports = { ], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], moduleNameMapper: Object.fromEntries( d3Libs.map(libraryName => [`^${libraryName}$`, createD3LibMappingToCommonJs(libraryName)]), diff --git a/packages/charts/react-charts/library/package.json b/packages/charts/react-charts/library/package.json index cc06b68ad1f5da..4adb2dfa326967 100644 --- a/packages/charts/react-charts/library/package.json +++ b/packages/charts/react-charts/library/package.json @@ -2,13 +2,15 @@ "name": "@fluentui/react-charts", "version": "9.3.23", "description": "React web chart controls for Microsoft fluentui v9 system.", - "main": "lib-commonjs/index.js", + "type": "module", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -64,10 +66,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, diff --git a/packages/charts/react-charts/library/src/components/HeatMapChart/HeatMapChart.test.tsx b/packages/charts/react-charts/library/src/components/HeatMapChart/HeatMapChart.test.tsx index cf7236453a2f80..bccda5bf0f77fe 100644 --- a/packages/charts/react-charts/library/src/components/HeatMapChart/HeatMapChart.test.tsx +++ b/packages/charts/react-charts/library/src/components/HeatMapChart/HeatMapChart.test.tsx @@ -6,7 +6,7 @@ import { axe, toHaveNoViolations } from 'jest-axe'; import { conditionalTest, getByClass, isTimezoneSet } from '../../utilities/TestUtility.test'; const { Timezone } = require('../../../scripts/constants'); import { FluentProvider } from '@fluentui/react-provider'; -const env = require('../../../config/tests'); +const env = require('../../../config/tests.cjs'); expect.extend(toHaveNoViolations); diff --git a/packages/charts/react-charts/library/src/components/Sparkline/SparklineChartUT.test.tsx b/packages/charts/react-charts/library/src/components/Sparkline/SparklineChartUT.test.tsx index d5597b46f297b6..de364116961f76 100644 --- a/packages/charts/react-charts/library/src/components/Sparkline/SparklineChartUT.test.tsx +++ b/packages/charts/react-charts/library/src/components/Sparkline/SparklineChartUT.test.tsx @@ -5,7 +5,7 @@ import { emptySparklinePoints } from './Sparkline.test'; import { getByRole, queryAllByAttribute, render } from '@testing-library/react'; import * as React from 'react'; -const env = require('../../../config/tests.js'); +const env = require('../../../config/tests.cjs'); const runTest = env === 'TEST' ? describe : describe; const sparkline1Points: ChartProps = { diff --git a/packages/charts/react-charts/library/src/components/VerticalBarChart/VerticalBarChart.test.tsx b/packages/charts/react-charts/library/src/components/VerticalBarChart/VerticalBarChart.test.tsx index 1dbe92bfa70130..dffd2fc26ced95 100644 --- a/packages/charts/react-charts/library/src/components/VerticalBarChart/VerticalBarChart.test.tsx +++ b/packages/charts/react-charts/library/src/components/VerticalBarChart/VerticalBarChart.test.tsx @@ -18,7 +18,7 @@ import type { VerticalBarChartDataPoint } from '../../index'; import { allNegativeChartPointsVBC, chartPointsVBC, negativeChartPointsVBC } from '../../utilities/test-data'; import { axe, toHaveNoViolations } from 'jest-axe'; const { Timezone } = require('../../../scripts/constants'); -const env = require('../../../config/tests'); +const env = require('../../../config/tests.cjs'); expect.extend(toHaveNoViolations); diff --git a/packages/charts/react-charts/library/src/utilities/TestUtility.test.tsx b/packages/charts/react-charts/library/src/utilities/TestUtility.test.tsx index 45b7291d42c5a8..9fa07849115bbb 100644 --- a/packages/charts/react-charts/library/src/utilities/TestUtility.test.tsx +++ b/packages/charts/react-charts/library/src/utilities/TestUtility.test.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { act, queryAllByAttribute, render, waitFor } from '@testing-library/react'; import * as React from 'react'; -const env = require('../../config/tests'); +const env = require('../../config/tests.cjs'); const { Timezone } = require('../../scripts/constants'); diff --git a/packages/charts/react-charts/library/src/utilities/UtilityUnitTests.test.ts b/packages/charts/react-charts/library/src/utilities/UtilityUnitTests.test.ts index 13a136b274bc90..e2d3b3fb45a19c 100644 --- a/packages/charts/react-charts/library/src/utilities/UtilityUnitTests.test.ts +++ b/packages/charts/react-charts/library/src/utilities/UtilityUnitTests.test.ts @@ -15,7 +15,7 @@ import * as vbcUtils from './vbc-utils'; import { formatToLocaleString } from '@fluentui/chart-utilities'; import { fireEvent } from '@testing-library/react'; const { Timezone } = require('../../scripts/constants'); -const env = require('../../config/tests'); +const env = require('../../config/tests.cjs'); // Reference to the test plan: packages\react-charting\docs\TestPlans\Utilities\UnitTests.md const X_ORIGIN = 0; diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 14d4e10ad3a591..7ec9da91db766c 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -30,7 +30,7 @@ "fs-extra": "^8.1.0", "globals": "13.24.0", "jju": "^1.4.0", - "minimatch": "^3.1.2", + "minimatch": "^3.1.4", "typescript-eslint": "^8.46.2" }, "peerDependencies": { diff --git a/packages/react-components/component-selector-preview/library/.swcrc b/packages/react-components/component-selector-preview/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/component-selector-preview/library/.swcrc +++ b/packages/react-components/component-selector-preview/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/component-selector-preview/library/config/tests.js b/packages/react-components/component-selector-preview/library/config/tests.cjs similarity index 100% rename from packages/react-components/component-selector-preview/library/config/tests.js rename to packages/react-components/component-selector-preview/library/config/tests.cjs diff --git a/packages/react-components/component-selector-preview/library/eslint.config.js b/packages/react-components/component-selector-preview/library/eslint.config.cjs similarity index 100% rename from packages/react-components/component-selector-preview/library/eslint.config.js rename to packages/react-components/component-selector-preview/library/eslint.config.cjs diff --git a/packages/react-components/component-selector-preview/library/jest.config.js b/packages/react-components/component-selector-preview/library/jest.config.cjs similarity index 96% rename from packages/react-components/component-selector-preview/library/jest.config.js rename to packages/react-components/component-selector-preview/library/jest.config.cjs index 6be0523d0159bb..a2c1f38fe47cbe 100644 --- a/packages/react-components/component-selector-preview/library/jest.config.js +++ b/packages/react-components/component-selector-preview/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/component-selector-preview/library/package.json b/packages/react-components/component-selector-preview/library/package.json index 8b5253adfe76b9..f361fb64d94c2c 100644 --- a/packages/react-components/component-selector-preview/library/package.json +++ b/packages/react-components/component-selector-preview/library/package.json @@ -3,13 +3,14 @@ "version": "0.0.0", "private": true, "description": "New fluentui react package", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -34,10 +35,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -46,5 +51,6 @@ "major", "prerelease" ] - } + }, + "type": "module" } diff --git a/packages/react-components/deprecated/react-alert/.swcrc b/packages/react-components/deprecated/react-alert/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/deprecated/react-alert/.swcrc +++ b/packages/react-components/deprecated/react-alert/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/deprecated/react-alert/config/tests.js b/packages/react-components/deprecated/react-alert/config/tests.cjs similarity index 100% rename from packages/react-components/deprecated/react-alert/config/tests.js rename to packages/react-components/deprecated/react-alert/config/tests.cjs diff --git a/packages/react-components/deprecated/react-alert/eslint.config.js b/packages/react-components/deprecated/react-alert/eslint.config.cjs similarity index 100% rename from packages/react-components/deprecated/react-alert/eslint.config.js rename to packages/react-components/deprecated/react-alert/eslint.config.cjs diff --git a/packages/react-components/deprecated/react-alert/jest.config.js b/packages/react-components/deprecated/react-alert/jest.config.cjs similarity index 90% rename from packages/react-components/deprecated/react-alert/jest.config.js rename to packages/react-components/deprecated/react-alert/jest.config.cjs index 4aa36ebe5cad65..e55174fe492dfb 100644 --- a/packages/react-components/deprecated/react-alert/jest.config.js +++ b/packages/react-components/deprecated/react-alert/jest.config.cjs @@ -16,6 +16,6 @@ module.exports = { ], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/deprecated/react-alert/package.json b/packages/react-components/deprecated/react-alert/package.json index 1991785ac42a70..20f290c3a50fc1 100644 --- a/packages/react-components/deprecated/react-alert/package.json +++ b/packages/react-components/deprecated/react-alert/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-alert", "version": "9.0.0-beta.143", "description": "An alert component to display brief messages", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -37,17 +37,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/deprecated/react-infobutton/.swcrc b/packages/react-components/deprecated/react-infobutton/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/deprecated/react-infobutton/.swcrc +++ b/packages/react-components/deprecated/react-infobutton/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/deprecated/react-infobutton/config/tests.js b/packages/react-components/deprecated/react-infobutton/config/tests.cjs similarity index 100% rename from packages/react-components/deprecated/react-infobutton/config/tests.js rename to packages/react-components/deprecated/react-infobutton/config/tests.cjs diff --git a/packages/react-components/deprecated/react-infobutton/eslint.config.js b/packages/react-components/deprecated/react-infobutton/eslint.config.cjs similarity index 100% rename from packages/react-components/deprecated/react-infobutton/eslint.config.js rename to packages/react-components/deprecated/react-infobutton/eslint.config.cjs diff --git a/packages/react-components/deprecated/react-infobutton/jest.config.js b/packages/react-components/deprecated/react-infobutton/jest.config.cjs similarity index 90% rename from packages/react-components/deprecated/react-infobutton/jest.config.js rename to packages/react-components/deprecated/react-infobutton/jest.config.cjs index 39ba2cc0b2efc8..f83043c92183a5 100644 --- a/packages/react-components/deprecated/react-infobutton/jest.config.js +++ b/packages/react-components/deprecated/react-infobutton/jest.config.cjs @@ -16,6 +16,6 @@ module.exports = { ], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/deprecated/react-infobutton/package.json b/packages/react-components/deprecated/react-infobutton/package.json index 53be4dba01f266..69c27c68277312 100644 --- a/packages/react-components/deprecated/react-infobutton/package.json +++ b/packages/react-components/deprecated/react-infobutton/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-infobutton", "version": "9.0.0-beta.118", "description": "React components for building web experiences", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -37,17 +37,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/deprecated/react-virtualizer/.swcrc b/packages/react-components/deprecated/react-virtualizer/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/deprecated/react-virtualizer/.swcrc +++ b/packages/react-components/deprecated/react-virtualizer/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/deprecated/react-virtualizer/config/tests.js b/packages/react-components/deprecated/react-virtualizer/config/tests.cjs similarity index 100% rename from packages/react-components/deprecated/react-virtualizer/config/tests.js rename to packages/react-components/deprecated/react-virtualizer/config/tests.cjs diff --git a/packages/react-components/deprecated/react-virtualizer/eslint.config.js b/packages/react-components/deprecated/react-virtualizer/eslint.config.cjs similarity index 100% rename from packages/react-components/deprecated/react-virtualizer/eslint.config.js rename to packages/react-components/deprecated/react-virtualizer/eslint.config.cjs diff --git a/packages/react-components/deprecated/react-virtualizer/jest.config.js b/packages/react-components/deprecated/react-virtualizer/jest.config.cjs similarity index 96% rename from packages/react-components/deprecated/react-virtualizer/jest.config.js rename to packages/react-components/deprecated/react-virtualizer/jest.config.cjs index dc88c3fa6d9af5..4168b284e4c2e6 100644 --- a/packages/react-components/deprecated/react-virtualizer/jest.config.js +++ b/packages/react-components/deprecated/react-virtualizer/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/deprecated/react-virtualizer/package.json b/packages/react-components/deprecated/react-virtualizer/package.json index 0475685e992f3a..82520084111202 100644 --- a/packages/react-components/deprecated/react-virtualizer/package.json +++ b/packages/react-components/deprecated/react-virtualizer/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-virtualizer", "version": "9.0.0-alpha.114", "description": "Generic and composable virtualizer framework built on browser intersection observer", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -33,17 +33,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/global-context/.swcrc b/packages/react-components/global-context/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/global-context/.swcrc +++ b/packages/react-components/global-context/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/global-context/config/tests.js b/packages/react-components/global-context/config/tests.cjs similarity index 100% rename from packages/react-components/global-context/config/tests.js rename to packages/react-components/global-context/config/tests.cjs diff --git a/packages/react-components/global-context/eslint.config.js b/packages/react-components/global-context/eslint.config.cjs similarity index 100% rename from packages/react-components/global-context/eslint.config.js rename to packages/react-components/global-context/eslint.config.cjs diff --git a/packages/react-components/global-context/jest.config.js b/packages/react-components/global-context/jest.config.cjs similarity index 96% rename from packages/react-components/global-context/jest.config.js rename to packages/react-components/global-context/jest.config.cjs index d8b4384a280e01..8988772b4f2197 100644 --- a/packages/react-components/global-context/jest.config.js +++ b/packages/react-components/global-context/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/global-context/package.json b/packages/react-components/global-context/package.json index bae02908f28d81..eaa0abb483a5d4 100644 --- a/packages/react-components/global-context/package.json +++ b/packages/react-components/global-context/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/global-context", "version": "9.0.0-beta.103", "description": "Extension of React createContext to be a true singleton on the global scope", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -31,17 +31,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/keyboard-keys/.swcrc b/packages/react-components/keyboard-keys/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/keyboard-keys/.swcrc +++ b/packages/react-components/keyboard-keys/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/keyboard-keys/config/tests.js b/packages/react-components/keyboard-keys/config/tests.cjs similarity index 100% rename from packages/react-components/keyboard-keys/config/tests.js rename to packages/react-components/keyboard-keys/config/tests.cjs diff --git a/packages/react-components/keyboard-keys/eslint.config.js b/packages/react-components/keyboard-keys/eslint.config.cjs similarity index 100% rename from packages/react-components/keyboard-keys/eslint.config.js rename to packages/react-components/keyboard-keys/eslint.config.cjs diff --git a/packages/react-components/keyboard-keys/jest.config.js b/packages/react-components/keyboard-keys/jest.config.cjs similarity index 96% rename from packages/react-components/keyboard-keys/jest.config.js rename to packages/react-components/keyboard-keys/jest.config.cjs index 757f1c501d40c1..a6089c916a81e2 100644 --- a/packages/react-components/keyboard-keys/jest.config.js +++ b/packages/react-components/keyboard-keys/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/keyboard-keys/package.json b/packages/react-components/keyboard-keys/package.json index fc26425de1c8c9..4089b9032bc71d 100644 --- a/packages/react-components/keyboard-keys/package.json +++ b/packages/react-components/keyboard-keys/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/keyboard-keys", "version": "9.0.8", "description": "Contains a set of keyboard constants for key and keyCode", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -22,17 +22,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/priority-overflow/.swcrc b/packages/react-components/priority-overflow/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/priority-overflow/.swcrc +++ b/packages/react-components/priority-overflow/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/priority-overflow/config/tests.js b/packages/react-components/priority-overflow/config/tests.cjs similarity index 100% rename from packages/react-components/priority-overflow/config/tests.js rename to packages/react-components/priority-overflow/config/tests.cjs diff --git a/packages/react-components/priority-overflow/eslint.config.js b/packages/react-components/priority-overflow/eslint.config.cjs similarity index 100% rename from packages/react-components/priority-overflow/eslint.config.js rename to packages/react-components/priority-overflow/eslint.config.cjs diff --git a/packages/react-components/priority-overflow/jest.config.js b/packages/react-components/priority-overflow/jest.config.cjs similarity index 96% rename from packages/react-components/priority-overflow/jest.config.js rename to packages/react-components/priority-overflow/jest.config.cjs index 3885e65adcbb46..4fc1cd41dfb3ae 100644 --- a/packages/react-components/priority-overflow/jest.config.js +++ b/packages/react-components/priority-overflow/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/priority-overflow/package.json b/packages/react-components/priority-overflow/package.json index 85ce6eac4e2e49..724381015441b4 100644 --- a/packages/react-components/priority-overflow/package.json +++ b/packages/react-components/priority-overflow/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/priority-overflow", "version": "9.4.1", "description": "Vanilla JS utilities to implement overflow menus", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -22,17 +22,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-accordion/library/.swcrc b/packages/react-components/react-accordion/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-accordion/library/.swcrc +++ b/packages/react-components/react-accordion/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-accordion/library/config/tests.js b/packages/react-components/react-accordion/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-accordion/library/config/tests.js rename to packages/react-components/react-accordion/library/config/tests.cjs diff --git a/packages/react-components/react-accordion/library/eslint.config.js b/packages/react-components/react-accordion/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-accordion/library/eslint.config.js rename to packages/react-components/react-accordion/library/eslint.config.cjs diff --git a/packages/react-components/react-accordion/library/jest.config.js b/packages/react-components/react-accordion/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-accordion/library/jest.config.js rename to packages/react-components/react-accordion/library/jest.config.cjs index 709e4a2a4da592..da6fa3069a1200 100644 --- a/packages/react-components/react-accordion/library/jest.config.js +++ b/packages/react-components/react-accordion/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-accordion/library/package.json b/packages/react-components/react-accordion/library/package.json index e209aad0f24f08..9906c9fcbe853a 100644 --- a/packages/react-components/react-accordion/library/package.json +++ b/packages/react-components/react-accordion/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-accordion", "version": "9.12.1", "description": "Fluent UI accordion component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -39,17 +39,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-aria/library/.swcrc b/packages/react-components/react-aria/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-aria/library/.swcrc +++ b/packages/react-components/react-aria/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-aria/library/config/tests.js b/packages/react-components/react-aria/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-aria/library/config/tests.js rename to packages/react-components/react-aria/library/config/tests.cjs diff --git a/packages/react-components/react-aria/library/eslint.config.js b/packages/react-components/react-aria/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-aria/library/eslint.config.js rename to packages/react-components/react-aria/library/eslint.config.cjs diff --git a/packages/react-components/react-aria/library/jest.config.js b/packages/react-components/react-aria/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-aria/library/jest.config.js rename to packages/react-components/react-aria/library/jest.config.cjs index 57deee862a091a..364db9d11902b9 100644 --- a/packages/react-components/react-aria/library/jest.config.js +++ b/packages/react-components/react-aria/library/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/react-aria/library/package.json b/packages/react-components/react-aria/library/package.json index 3a6fb31be5d953..94f71c677e9de0 100644 --- a/packages/react-components/react-aria/library/package.json +++ b/packages/react-components/react-aria/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-aria", "version": "9.17.13", "description": "React helper to ensure ARIA", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -33,17 +33,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-avatar/library/.swcrc b/packages/react-components/react-avatar/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-avatar/library/.swcrc +++ b/packages/react-components/react-avatar/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-avatar/library/config/tests.js b/packages/react-components/react-avatar/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-avatar/library/config/tests.js rename to packages/react-components/react-avatar/library/config/tests.cjs diff --git a/packages/react-components/react-avatar/library/eslint.config.js b/packages/react-components/react-avatar/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-avatar/library/eslint.config.js rename to packages/react-components/react-avatar/library/eslint.config.cjs diff --git a/packages/react-components/react-avatar/library/jest.config.js b/packages/react-components/react-avatar/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-avatar/library/jest.config.js rename to packages/react-components/react-avatar/library/jest.config.cjs index dc18a8504c421d..56153ef8d9a8b8 100644 --- a/packages/react-components/react-avatar/library/jest.config.js +++ b/packages/react-components/react-avatar/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-avatar/library/package.json b/packages/react-components/react-avatar/library/package.json index d61683efeea61c..7ed3a71647597b 100644 --- a/packages/react-components/react-avatar/library/package.json +++ b/packages/react-components/react-avatar/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-avatar", "version": "9.11.4", "description": "React components for building Microsoft web experiences.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -42,17 +42,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-badge/library/.swcrc b/packages/react-components/react-badge/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-badge/library/.swcrc +++ b/packages/react-components/react-badge/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-badge/library/config/tests.js b/packages/react-components/react-badge/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-badge/library/config/tests.js rename to packages/react-components/react-badge/library/config/tests.cjs diff --git a/packages/react-components/react-badge/library/eslint.config.js b/packages/react-components/react-badge/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-badge/library/eslint.config.js rename to packages/react-components/react-badge/library/eslint.config.cjs diff --git a/packages/react-components/react-badge/library/jest.config.js b/packages/react-components/react-badge/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-badge/library/jest.config.js rename to packages/react-components/react-badge/library/jest.config.cjs index 9774395ae9a231..1b355873788980 100644 --- a/packages/react-components/react-badge/library/jest.config.js +++ b/packages/react-components/react-badge/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-badge/library/package.json b/packages/react-components/react-badge/library/package.json index 35227119f5a504..0a1da5aa4ed237 100644 --- a/packages/react-components/react-badge/library/package.json +++ b/packages/react-components/react-badge/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-badge", "version": "9.5.4", "description": "React components for building web experiences", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -34,17 +34,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-breadcrumb/library/.swcrc b/packages/react-components/react-breadcrumb/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-breadcrumb/library/.swcrc +++ b/packages/react-components/react-breadcrumb/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-breadcrumb/library/config/tests.js b/packages/react-components/react-breadcrumb/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-breadcrumb/library/config/tests.js rename to packages/react-components/react-breadcrumb/library/config/tests.cjs diff --git a/packages/react-components/react-breadcrumb/library/eslint.config.js b/packages/react-components/react-breadcrumb/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-breadcrumb/library/eslint.config.js rename to packages/react-components/react-breadcrumb/library/eslint.config.cjs diff --git a/packages/react-components/react-breadcrumb/library/jest.config.js b/packages/react-components/react-breadcrumb/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-breadcrumb/library/jest.config.js rename to packages/react-components/react-breadcrumb/library/jest.config.cjs index 3e1bdbdcd121b4..dbb94e0f9c3a21 100644 --- a/packages/react-components/react-breadcrumb/library/jest.config.js +++ b/packages/react-components/react-breadcrumb/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-breadcrumb/library/package.json b/packages/react-components/react-breadcrumb/library/package.json index da3de0eb74878b..1e04f04cfd647b 100644 --- a/packages/react-components/react-breadcrumb/library/package.json +++ b/packages/react-components/react-breadcrumb/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-breadcrumb", "version": "9.4.4", "description": "Breadcrumb component for Fluent UI React.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -38,17 +38,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-button/library/.swcrc b/packages/react-components/react-button/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-button/library/.swcrc +++ b/packages/react-components/react-button/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-button/library/config/tests.js b/packages/react-components/react-button/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-button/library/config/tests.js rename to packages/react-components/react-button/library/config/tests.cjs diff --git a/packages/react-components/react-button/library/eslint.config.js b/packages/react-components/react-button/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-button/library/eslint.config.js rename to packages/react-components/react-button/library/eslint.config.cjs diff --git a/packages/react-components/react-button/library/etc/react-button.api.md b/packages/react-components/react-button/library/etc/react-button.api.md index 1c87fa8d4de095..0fbc2e132f1db4 100644 --- a/packages/react-components/react-button/library/etc/react-button.api.md +++ b/packages/react-components/react-button/library/etc/react-button.api.md @@ -115,11 +115,24 @@ export const renderCompoundButton_unstable: (state: CompoundButtonBaseState) => export const renderMenuButton_unstable: (state: MenuButtonBaseState) => JSXElement; // @public -export const renderSplitButton_unstable: (state: SplitButtonState) => JSXElement; +export const renderSplitButton_unstable: (state: Pick, "root" | "menuButton" | "primaryActionButton">) => JSXElement; // @public export const SplitButton: ForwardRefComponent; +// @public +export type SplitButtonBaseProps = ComponentProps & Pick & Pick; + +// @public (undocumented) +export type SplitButtonBaseSlots = { + root: NonNullable>; + menuButton?: Slot; + primaryActionButton?: Slot; +}; + +// @public +export type SplitButtonBaseState = ComponentState & Required>; + // @public (undocumented) export const splitButtonClassNames: SlotClassNames; @@ -189,7 +202,10 @@ export const useMenuButtonBase_unstable: (props: MenuButtonBaseProps, ref: React export const useMenuButtonStyles_unstable: (state: MenuButtonState) => MenuButtonState; // @public -export const useSplitButton_unstable: (props: SplitButtonProps, ref: React_2.Ref) => SplitButtonState; +export const useSplitButton_unstable: (props: SplitButtonProps, ref: React_2.Ref) => SplitButtonState; + +// @public +export const useSplitButtonBase_unstable: (props: SplitButtonBaseProps, ref: React_2.Ref) => SplitButtonBaseState; // @public (undocumented) export const useSplitButtonStyles_unstable: (state: SplitButtonState) => SplitButtonState; diff --git a/packages/react-components/react-button/library/jest.config.js b/packages/react-components/react-button/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-button/library/jest.config.js rename to packages/react-components/react-button/library/jest.config.cjs index 6d295e622d5f86..e54d99918878f6 100644 --- a/packages/react-components/react-button/library/jest.config.js +++ b/packages/react-components/react-button/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-button/library/package.json b/packages/react-components/react-button/library/package.json index e4171093c75a2f..61f07c368508f4 100644 --- a/packages/react-components/react-button/library/package.json +++ b/packages/react-components/react-button/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-button", "version": "9.10.1", "description": "Fluent UI React Button component.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -37,17 +37,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-button/library/src/SplitButton.ts b/packages/react-components/react-button/library/src/SplitButton.ts index 4b3dc83adc8d5b..c62e06d0553d92 100644 --- a/packages/react-components/react-button/library/src/SplitButton.ts +++ b/packages/react-components/react-button/library/src/SplitButton.ts @@ -1,8 +1,16 @@ -export type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './components/SplitButton/index'; +export type { + SplitButtonBaseProps, + SplitButtonBaseSlots, + SplitButtonBaseState, + SplitButtonProps, + SplitButtonSlots, + SplitButtonState, +} from './components/SplitButton/index'; export { SplitButton, renderSplitButton_unstable, splitButtonClassNames, useSplitButtonStyles_unstable, useSplitButton_unstable, + useSplitButtonBase_unstable, } from './components/SplitButton/index'; diff --git a/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.test.tsx b/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.test.tsx index 641b1502cb3765..7f131003855222 100644 --- a/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.test.tsx +++ b/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.test.tsx @@ -212,4 +212,42 @@ describe('SplitButton', () => { expect(primaryActionButton[SLOT_ELEMENT_TYPE_SYMBOL]).toBe(Button); expect(menuButton[SLOT_ELEMENT_TYPE_SYMBOL]).toBe(MenuButton); }); + + it('does not forward disabledFocusable, icon, or iconPosition to native buttons', () => { + const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => undefined); + + try { + const { getAllByRole, getByTestId, getByText } = render( + } iconPosition="after"> + Primary action + , + ); + + const [primaryActionButton, menuButton] = getAllByRole('button'); + + // Neither native button should receive the non-standard props as DOM attributes + expect(primaryActionButton.getAttribute('disabledfocusable')).toBeNull(); + expect(primaryActionButton.getAttribute('iconposition')).toBeNull(); + expect(menuButton.getAttribute('disabledfocusable')).toBeNull(); + expect(menuButton.getAttribute('iconposition')).toBeNull(); + + // Both buttons should expose aria-disabled because disabledFocusable is true + expect(primaryActionButton.getAttribute('aria-disabled')).toBe('true'); + expect(menuButton.getAttribute('aria-disabled')).toBe('true'); + + // Primary action button should contain the icon and the label text + expect(primaryActionButton.contains(getByTestId('icon'))).toBe(true); + expect(primaryActionButton.contains(getByText('Primary action'))).toBe(true); + + // No React prop-forwarding warnings should have been emitted + const propWarningPattern = /Invalid value for prop|unknown prop|non-boolean attribute/i; + consoleErrorSpy.mock.calls.forEach(([message]) => { + if (typeof message === 'string') { + expect(message).not.toMatch(propWarningPattern); + } + }); + } finally { + consoleErrorSpy.mockRestore(); + } + }); }); diff --git a/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.tsx b/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.tsx index 6f9824b58e3459..4e589feb758914 100644 --- a/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.tsx +++ b/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.tsx @@ -12,15 +12,17 @@ import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts'; * SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary * action, while interacting with the second one opens a menu with secondary actions. */ -export const SplitButton: ForwardRefComponent = React.forwardRef((props, ref) => { - const state = useSplitButton_unstable(props, ref); +export const SplitButton: ForwardRefComponent = React.forwardRef( + (props, ref) => { + const state = useSplitButton_unstable(props, ref); - useSplitButtonStyles_unstable(state); + useSplitButtonStyles_unstable(state); - useCustomStyleHook_unstable('useSplitButtonStyles_unstable')(state); + useCustomStyleHook_unstable('useSplitButtonStyles_unstable')(state); - return renderSplitButton_unstable(state); - // Casting is required due to lack of distributive union to support unions on @types/react -}) as ForwardRefComponent; + return renderSplitButton_unstable(state); + // Casting is required due to lack of distributive union to support unions on @types/react + }, +) as ForwardRefComponent; SplitButton.displayName = 'SplitButton'; diff --git a/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.types.ts b/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.types.ts index 3211fc28a4b020..ee6b0ef5ab1854 100644 --- a/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.types.ts +++ b/packages/react-components/react-button/library/src/components/SplitButton/SplitButton.types.ts @@ -1,8 +1,8 @@ import type { Button } from '../Button/Button'; import type { MenuButton } from '../MenuButton/MenuButton'; import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities'; -import type { ButtonProps, ButtonState } from '../Button/Button.types'; -import type { MenuButtonProps, MenuButtonState } from '../MenuButton/MenuButton.types'; +import type { ButtonBaseProps, ButtonProps, ButtonState } from '../Button/Button.types'; +import type { MenuButtonBaseProps, MenuButtonProps, MenuButtonState } from '../MenuButton/MenuButton.types'; export type SplitButtonSlots = { /** @@ -27,3 +27,32 @@ export type SplitButtonProps = ComponentProps & export type SplitButtonState = ComponentState & Omit & Omit; + +export type SplitButtonBaseSlots = { + /** + * Root of the component that wraps the primary action button and menu button. + */ + root: NonNullable>; + + /** + * Button that opens menu with secondary actions in SplitButton. + */ + menuButton?: Slot; + /** + * Button to perform primary action in SplitButton. + */ + primaryActionButton?: Slot; +}; + +/** + * SplitButton props without the `appearance`/`size`/`shape` styling props, for headless usage. + */ +export type SplitButtonBaseProps = ComponentProps & + Pick & + Pick; + +/** + * SplitButton state without the `appearance`/`size`/`shape` styling props, for headless usage. + */ +export type SplitButtonBaseState = ComponentState & + Required>; diff --git a/packages/react-components/react-button/library/src/components/SplitButton/index.ts b/packages/react-components/react-button/library/src/components/SplitButton/index.ts index ba8bc5714108e2..16243d1c58e996 100644 --- a/packages/react-components/react-button/library/src/components/SplitButton/index.ts +++ b/packages/react-components/react-button/library/src/components/SplitButton/index.ts @@ -1,5 +1,12 @@ export { SplitButton } from './SplitButton'; -export type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './SplitButton.types'; +export type { + SplitButtonBaseProps, + SplitButtonBaseSlots, + SplitButtonBaseState, + SplitButtonProps, + SplitButtonSlots, + SplitButtonState, +} from './SplitButton.types'; export { renderSplitButton_unstable } from './renderSplitButton'; -export { useSplitButton_unstable } from './useSplitButton'; +export { useSplitButton_unstable, useSplitButtonBase_unstable } from './useSplitButton'; export { splitButtonClassNames, useSplitButtonStyles_unstable } from './useSplitButtonStyles.styles'; diff --git a/packages/react-components/react-button/library/src/components/SplitButton/renderSplitButton.tsx b/packages/react-components/react-button/library/src/components/SplitButton/renderSplitButton.tsx index 3c8982313edc91..cad3e38e5b612b 100644 --- a/packages/react-components/react-button/library/src/components/SplitButton/renderSplitButton.tsx +++ b/packages/react-components/react-button/library/src/components/SplitButton/renderSplitButton.tsx @@ -2,15 +2,17 @@ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { assertSlots } from '@fluentui/react-utilities'; -import type { JSXElement } from '@fluentui/react-utilities'; +import type { ComponentState, JSXElement } from '@fluentui/react-utilities'; -import type { SplitButtonSlots, SplitButtonState } from './SplitButton.types'; +import type { SplitButtonBaseSlots } from './SplitButton.types'; /** * Renders a SplitButton component by passing the state defined props to the appropriate slots. */ -export const renderSplitButton_unstable = (state: SplitButtonState): JSXElement => { - assertSlots(state); +export const renderSplitButton_unstable = ( + state: Pick, 'root' | 'menuButton' | 'primaryActionButton'>, +): JSXElement => { + assertSlots(state); return ( diff --git a/packages/react-components/react-button/library/src/components/SplitButton/useSplitButton.ts b/packages/react-components/react-button/library/src/components/SplitButton/useSplitButton.ts index 0f626da9ec2315..a221b9c53dc5bd 100644 --- a/packages/react-components/react-button/library/src/components/SplitButton/useSplitButton.ts +++ b/packages/react-components/react-button/library/src/components/SplitButton/useSplitButton.ts @@ -1,20 +1,79 @@ +'use client'; + import type * as React from 'react'; import { useId, slot } from '@fluentui/react-utilities'; import { Button } from '../Button/Button'; import { MenuButton } from '../MenuButton/MenuButton'; -import type { SplitButtonProps, SplitButtonState } from './SplitButton.types'; +import type { + SplitButtonBaseProps, + SplitButtonBaseState, + SplitButtonProps, + SplitButtonState, +} from './SplitButton.types'; /** * Given user props, defines default props for the SplitButton and returns processed state. * @param props - User provided props to the SplitButton component. * @param ref - User provided ref to be passed to the SplitButton component. */ -export const useSplitButton_unstable = ( - props: SplitButtonProps, - ref: React.Ref, -): SplitButtonState => { +export const useSplitButton_unstable = (props: SplitButtonProps, ref: React.Ref): SplitButtonState => { + const { appearance = 'secondary', icon, menuIcon, shape = 'rounded', size = 'medium', ...rest } = props; + const baseState = useSplitButtonBase_unstable(rest, ref); + + const menuButtonShorthand = slot.optional(props.menuButton, { + defaultProps: { + ...baseState.menuButton, + appearance, + disabledFocusable: baseState.disabledFocusable, + menuIcon, + shape, + size, + }, + renderByDefault: true, + elementType: MenuButton, + }); + const primaryActionButtonShorthand = slot.optional(props.primaryActionButton, { + defaultProps: { + ...baseState.primaryActionButton, + appearance, + disabledFocusable: baseState.disabledFocusable, + icon, + iconPosition: baseState.iconPosition, + shape, + size, + }, + renderByDefault: true, + elementType: Button, + }); + + return { + ...baseState, + // Props passed at the top-level + appearance, + shape, + size, + // Slots definition + components: { root: 'div', menuButton: MenuButton, primaryActionButton: Button }, + menuButton: menuButtonShorthand, + primaryActionButton: primaryActionButtonShorthand, + }; +}; + +/** + * Base hook for SplitButton component, which manages design-agnostic state related to slots + * structure and ARIA attributes, without design-specific props such as `appearance`, `shape`, or + * `size`. + * + * Concrete wrappers recreate child slots from these base prop defaults before rendering. + * + * @param props - User provided props to the SplitButton component. + * @param ref - User provided ref to be passed to the SplitButton component. + */ +export const useSplitButtonBase_unstable = ( + props: SplitButtonBaseProps, + ref: React.Ref, +): SplitButtonBaseState => { const { - appearance = 'secondary', children, disabled = false, disabledFocusable = false, @@ -23,38 +82,26 @@ export const useSplitButton_unstable = ( menuButton, menuIcon, primaryActionButton, - shape = 'rounded', - size = 'medium', ...rest } = props; const baseId = useId('splitButton-'); const menuButtonShorthand = slot.optional(menuButton, { defaultProps: { - appearance, disabled, - disabledFocusable, - menuIcon, - shape, - size, }, renderByDefault: true, - elementType: MenuButton, + elementType: 'button', }); + const primaryActionButtonShorthand = slot.optional(primaryActionButton, { defaultProps: { - appearance, children, disabled, - disabledFocusable, - icon, - iconPosition, id: baseId + '__primaryActionButton', - shape, - size, }, renderByDefault: true, - elementType: Button, + elementType: 'button', }); // Resolve menu button's aria-labelledby to be labelled by the primary action button if no label was provided by the @@ -69,15 +116,12 @@ export const useSplitButton_unstable = ( } return { - // Props passed at the top-level - appearance, disabled, disabledFocusable, iconPosition, - shape, - size, // Slots definition - components: { root: 'div', menuButton: MenuButton, primaryActionButton: Button }, - root: slot.always({ ref: ref as React.Ref, ...rest }, { elementType: 'div' }), + // Slots definition + components: { root: 'div', menuButton: 'button', primaryActionButton: 'button' }, + root: slot.always({ ref, ...rest }, { elementType: 'div' }), menuButton: menuButtonShorthand, primaryActionButton: primaryActionButtonShorthand, }; diff --git a/packages/react-components/react-button/library/src/index.ts b/packages/react-components/react-button/library/src/index.ts index e5744ce4e2d2ac..00192fbe5c7229 100644 --- a/packages/react-components/react-button/library/src/index.ts +++ b/packages/react-components/react-button/library/src/index.ts @@ -43,8 +43,16 @@ export { splitButtonClassNames, useSplitButtonStyles_unstable, useSplitButton_unstable, + useSplitButtonBase_unstable, +} from './SplitButton'; +export type { + SplitButtonBaseProps, + SplitButtonBaseSlots, + SplitButtonBaseState, + SplitButtonProps, + SplitButtonSlots, + SplitButtonState, } from './SplitButton'; -export type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './SplitButton'; export { ToggleButton, renderToggleButton_unstable, diff --git a/packages/react-components/react-calendar-compat/library/.swcrc b/packages/react-components/react-calendar-compat/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-calendar-compat/library/.swcrc +++ b/packages/react-components/react-calendar-compat/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-calendar-compat/library/config/tests.js b/packages/react-components/react-calendar-compat/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-calendar-compat/library/config/tests.js rename to packages/react-components/react-calendar-compat/library/config/tests.cjs diff --git a/packages/react-components/react-calendar-compat/library/eslint.config.js b/packages/react-components/react-calendar-compat/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-calendar-compat/library/eslint.config.js rename to packages/react-components/react-calendar-compat/library/eslint.config.cjs diff --git a/packages/react-components/react-calendar-compat/library/jest.config.js b/packages/react-components/react-calendar-compat/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-calendar-compat/library/jest.config.js rename to packages/react-components/react-calendar-compat/library/jest.config.cjs index f6ebe01a386f10..08b05f06cc0aa8 100644 --- a/packages/react-components/react-calendar-compat/library/jest.config.js +++ b/packages/react-components/react-calendar-compat/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-calendar-compat/library/package.json b/packages/react-components/react-calendar-compat/library/package.json index 3c7f976644ae11..e4328dd2755f92 100644 --- a/packages/react-components/react-calendar-compat/library/package.json +++ b/packages/react-components/react-calendar-compat/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-calendar-compat", "version": "0.4.4", "description": "Calendar compat component for Fluent UI v9", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -32,10 +32,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -48,7 +52,9 @@ "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-card/library/.swcrc b/packages/react-components/react-card/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-card/library/.swcrc +++ b/packages/react-components/react-card/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-card/library/config/tests.js b/packages/react-components/react-card/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-card/library/config/tests.js rename to packages/react-components/react-card/library/config/tests.cjs diff --git a/packages/react-components/react-card/library/eslint.config.js b/packages/react-components/react-card/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-card/library/eslint.config.js rename to packages/react-components/react-card/library/eslint.config.cjs diff --git a/packages/react-components/react-card/library/jest.config.js b/packages/react-components/react-card/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-card/library/jest.config.js rename to packages/react-components/react-card/library/jest.config.cjs index 818a6fd0a53f6c..90654a8fb4d6a9 100644 --- a/packages/react-components/react-card/library/jest.config.js +++ b/packages/react-components/react-card/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-card/library/package.json b/packages/react-components/react-card/library/package.json index db0ef096c17d07..8079af198bd5ec 100644 --- a/packages/react-components/react-card/library/package.json +++ b/packages/react-components/react-card/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-card", "version": "9.7.1", "description": "Card container components for Fluent UI React.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -35,17 +35,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-carousel/library/.swcrc b/packages/react-components/react-carousel/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-carousel/library/.swcrc +++ b/packages/react-components/react-carousel/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-carousel/library/config/tests.js b/packages/react-components/react-carousel/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-carousel/library/config/tests.js rename to packages/react-components/react-carousel/library/config/tests.cjs diff --git a/packages/react-components/react-carousel/library/eslint.config.js b/packages/react-components/react-carousel/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-carousel/library/eslint.config.js rename to packages/react-components/react-carousel/library/eslint.config.cjs diff --git a/packages/react-components/react-carousel/library/jest.config.js b/packages/react-components/react-carousel/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-carousel/library/jest.config.js rename to packages/react-components/react-carousel/library/jest.config.cjs index 6a3aa3bac93e0f..dfa00599f96a5d 100644 --- a/packages/react-components/react-carousel/library/jest.config.js +++ b/packages/react-components/react-carousel/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-carousel/library/package.json b/packages/react-components/react-carousel/library/package.json index 9ce6f887bb852c..00a95f42f247e4 100644 --- a/packages/react-components/react-carousel/library/package.json +++ b/packages/react-components/react-carousel/library/package.json @@ -2,13 +2,14 @@ "name": "@fluentui/react-carousel", "version": "9.9.11", "description": "A composable carousel component that enables pagination with minimal rerenders", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -42,10 +43,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -54,5 +59,6 @@ "major", "prerelease" ] - } + }, + "type": "module" } diff --git a/packages/react-components/react-checkbox/library/.swcrc b/packages/react-components/react-checkbox/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-checkbox/library/.swcrc +++ b/packages/react-components/react-checkbox/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-checkbox/library/config/tests.js b/packages/react-components/react-checkbox/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-checkbox/library/config/tests.js rename to packages/react-components/react-checkbox/library/config/tests.cjs diff --git a/packages/react-components/react-checkbox/library/eslint.config.js b/packages/react-components/react-checkbox/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-checkbox/library/eslint.config.js rename to packages/react-components/react-checkbox/library/eslint.config.cjs diff --git a/packages/react-components/react-checkbox/library/jest.config.js b/packages/react-components/react-checkbox/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-checkbox/library/jest.config.js rename to packages/react-components/react-checkbox/library/jest.config.cjs index 99ac23722e12f8..e3fd33ab083621 100644 --- a/packages/react-components/react-checkbox/library/jest.config.js +++ b/packages/react-components/react-checkbox/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-checkbox/library/package.json b/packages/react-components/react-checkbox/library/package.json index 06907412f45758..010dd7219705cd 100644 --- a/packages/react-components/react-checkbox/library/package.json +++ b/packages/react-components/react-checkbox/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-checkbox", "version": "9.6.3", "description": "Fluent UI checkbox component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -37,17 +37,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-color-picker/library/.swcrc b/packages/react-components/react-color-picker/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-color-picker/library/.swcrc +++ b/packages/react-components/react-color-picker/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-color-picker/library/config/tests.js b/packages/react-components/react-color-picker/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-color-picker/library/config/tests.js rename to packages/react-components/react-color-picker/library/config/tests.cjs diff --git a/packages/react-components/react-color-picker/library/eslint.config.js b/packages/react-components/react-color-picker/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-color-picker/library/eslint.config.js rename to packages/react-components/react-color-picker/library/eslint.config.cjs diff --git a/packages/react-components/react-color-picker/library/jest.config.js b/packages/react-components/react-color-picker/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-color-picker/library/jest.config.js rename to packages/react-components/react-color-picker/library/jest.config.cjs index 8476bbf5af6f97..23ccd81b507070 100644 --- a/packages/react-components/react-color-picker/library/jest.config.js +++ b/packages/react-components/react-color-picker/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-color-picker/library/package.json b/packages/react-components/react-color-picker/library/package.json index a2892af9ec52ff..5d2d5a3f6f0e1b 100644 --- a/packages/react-components/react-color-picker/library/package.json +++ b/packages/react-components/react-color-picker/library/package.json @@ -2,13 +2,14 @@ "name": "@fluentui/react-color-picker", "version": "9.2.19", "description": "ColorPicker component for Fluent UI React.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -18,7 +19,6 @@ }, "license": "MIT", "dependencies": { - "@ctrl/tinycolor": "^3.3.4", "@fluentui/react-context-selector": "^9.2.18", "@fluentui/react-jsx-runtime": "^9.4.4", "@fluentui/react-shared-contexts": "^9.26.2", @@ -36,10 +36,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -48,5 +52,6 @@ "major", "prerelease" ] - } + }, + "type": "module" } diff --git a/packages/react-components/react-color-picker/library/src/components/AlphaSlider/useAlphaSliderState.ts b/packages/react-components/react-color-picker/library/src/components/AlphaSlider/useAlphaSliderState.ts index 31764bb921566a..9bb07421f5b840 100644 --- a/packages/react-components/react-color-picker/library/src/components/AlphaSlider/useAlphaSliderState.ts +++ b/packages/react-components/react-color-picker/library/src/components/AlphaSlider/useAlphaSliderState.ts @@ -1,7 +1,6 @@ 'use client'; import type * as React from 'react'; -import { tinycolor } from '@ctrl/tinycolor'; import { clamp, useControllableState, useEventCallback } from '@fluentui/react-utilities'; import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts'; import { alphaSliderCSSVars } from './useAlphaSliderStyles.styles'; @@ -11,6 +10,7 @@ import { MIN, MAX } from '../../utils/constants'; import { getPercent } from '../../utils/getPercent'; import { adjustToTransparency, calculateTransparencyValue, getSliderDirection } from './alphaSliderUtils'; import { createHsvColor } from '../../utils/createHsvColor'; +import { createHslColor } from '../../utils/createHslColor'; export const useAlphaSliderState_unstable = (state: AlphaSliderState, props: AlphaSliderProps): AlphaSliderState => { const { dir } = useFluent(); @@ -18,7 +18,7 @@ export const useAlphaSliderState_unstable = (state: AlphaSliderState, props: Alp const colorFromContext = useColorPickerContextValue_unstable(ctx => ctx.color); const { color, onChange = onChangeFromContext, transparency = false, vertical = false } = props; const hsvColor = color || colorFromContext; - const hslColor = tinycolor(hsvColor).toHsl(); + const hslColor = createHslColor(hsvColor); const [currentValue, setCurrentValue] = useControllableState({ defaultState: calculateTransparencyValue(transparency, props.defaultColor?.a), diff --git a/packages/react-components/react-color-picker/library/src/components/ColorArea/ColorArea.test.tsx b/packages/react-components/react-color-picker/library/src/components/ColorArea/ColorArea.test.tsx index 0e6d164aa84de7..481ce44bd73253 100644 --- a/packages/react-components/react-color-picker/library/src/components/ColorArea/ColorArea.test.tsx +++ b/packages/react-components/react-color-picker/library/src/components/ColorArea/ColorArea.test.tsx @@ -15,7 +15,7 @@ describe('ColorArea', () => {
({ defaultState: props.defaultColor, @@ -105,7 +105,7 @@ export const useColorSliderBase_unstable = ( [colorSliderCSSVars.sliderDirectionVar]: vertical ? '180deg' : dir === 'ltr' ? '-90deg' : '90deg', [colorSliderCSSVars.sliderProgressVar]: `${valuePercent}%`, [colorSliderCSSVars.thumbColorVar]: - channel === 'hue' ? `hsl(${clampedValue}, 100%, 50%)` : tinycolor(hsvColor).toRgbString(), + channel === 'hue' ? `hsl(${clampedValue}, 100%, 50%)` : createHslColorString(hsvColor), [colorSliderCSSVars.railColorVar]: channel === 'hue' ? `hsl(${hslColor.h} ${hslColor.s * 100}%, ${hslColor.l * 100}%)` diff --git a/packages/react-components/react-color-picker/library/src/types/color.ts b/packages/react-components/react-color-picker/library/src/types/color.ts index 81d8ca3d897d6e..4eb6c1c27e30b2 100644 --- a/packages/react-components/react-color-picker/library/src/types/color.ts +++ b/packages/react-components/react-color-picker/library/src/types/color.ts @@ -4,3 +4,10 @@ export type HsvColor = { v: number; a?: number; }; + +export type HslColor = { + h: number; + s: number; + l: number; + a?: number; +}; diff --git a/packages/react-components/react-color-picker/library/src/utils/constants.ts b/packages/react-components/react-color-picker/library/src/utils/constants.ts index 391eee7f19f5ac..a885900ff9cb85 100644 --- a/packages/react-components/react-color-picker/library/src/utils/constants.ts +++ b/packages/react-components/react-color-picker/library/src/utils/constants.ts @@ -1,7 +1,5 @@ -import { tinycolor } from '@ctrl/tinycolor'; - export const MIN = 0; export const MAX = 100; export const HUE_MAX = 360; export const INITIAL_COLOR = '#FFF'; -export const INITIAL_COLOR_HSV = tinycolor(INITIAL_COLOR).toHsv(); +export const INITIAL_COLOR_HSV = { h: 0, s: 0, v: 1, a: 1 }; diff --git a/packages/react-components/react-color-picker/library/src/utils/createHslColor.test.ts b/packages/react-components/react-color-picker/library/src/utils/createHslColor.test.ts new file mode 100644 index 00000000000000..e3d8d14bad0e5a --- /dev/null +++ b/packages/react-components/react-color-picker/library/src/utils/createHslColor.test.ts @@ -0,0 +1,28 @@ +import { createHslColor, createHslColorString } from './createHslColor'; + +describe('createHslColor', () => { + it('should create a black HSL color with default values', () => { + expect(createHslColor({})).toEqual({ h: 0, s: 0, l: 0, a: 1 }); + }); + + it('should convert an HSV color to HSL', () => { + expect(createHslColor({ h: 0, s: 1, v: 1 })).toEqual({ h: 0, s: 1, l: 0.5, a: 1 }); + }); + + it('should preserve hue and alpha', () => { + const color = createHslColor({ h: 210, s: 0.5, v: 0.8, a: 0.4 }); + + expect(color.h).toBe(210); + expect(color.s).toBeCloseTo(0.5); + expect(color.l).toBeCloseTo(0.6); + expect(color.a).toBe(0.4); + }); + + it('should create an achromatic HSL color from white', () => { + expect(createHslColor({ h: 120, s: 0, v: 1 })).toEqual({ h: 120, s: 0, l: 1, a: 1 }); + }); + + it('should create an HSLA color string', () => { + expect(createHslColorString({ h: 210, s: 0.5, v: 0.8, a: 0.4 })).toBe('hsla(210, 50%, 60%, 0.4)'); + }); +}); diff --git a/packages/react-components/react-color-picker/library/src/utils/createHslColor.ts b/packages/react-components/react-color-picker/library/src/utils/createHslColor.ts new file mode 100644 index 00000000000000..b582fde0477265 --- /dev/null +++ b/packages/react-components/react-color-picker/library/src/utils/createHslColor.ts @@ -0,0 +1,30 @@ +import type { HslColor, HsvColor } from '../types/color'; + +/** + * + * Creates an HSL color object from a given HSV color object. + * + * @param color - HSV color object to convert to HSL. + * @returns HSL color object with the same hue and alpha values, and converted saturation and lightness values. + */ +export function createHslColor(color: Partial = {}): HslColor { + const { h = 0, s = 0, v = 0, a = 1 } = color; + const l = v * (1 - s / 2); + const hslSaturation = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l); + + return { h, s: hslSaturation, l, a }; +} + +/** + * Creates an HSL color string from a given HSV color object. + * + * @param color - HSV color object to convert to HSL string. + * @returns - HSL color string in the format of "hsla(h, s%, l%, a)". + */ +export function createHslColorString(color: Partial = {}): string { + const hslColor = createHslColor(color); + const saturation = Number((hslColor.s * 100).toFixed(2)); + const lightness = Number((hslColor.l * 100).toFixed(2)); + + return `hsla(${hslColor.h}, ${saturation}%, ${lightness}%, ${hslColor.a})`; +} diff --git a/packages/react-components/react-colorpicker-compat/.swcrc b/packages/react-components/react-colorpicker-compat/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-colorpicker-compat/.swcrc +++ b/packages/react-components/react-colorpicker-compat/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-colorpicker-compat/config/tests.js b/packages/react-components/react-colorpicker-compat/config/tests.cjs similarity index 100% rename from packages/react-components/react-colorpicker-compat/config/tests.js rename to packages/react-components/react-colorpicker-compat/config/tests.cjs diff --git a/packages/react-components/react-colorpicker-compat/eslint.config.js b/packages/react-components/react-colorpicker-compat/eslint.config.cjs similarity index 100% rename from packages/react-components/react-colorpicker-compat/eslint.config.js rename to packages/react-components/react-colorpicker-compat/eslint.config.cjs diff --git a/packages/react-components/react-colorpicker-compat/jest.config.js b/packages/react-components/react-colorpicker-compat/jest.config.cjs similarity index 96% rename from packages/react-components/react-colorpicker-compat/jest.config.js rename to packages/react-components/react-colorpicker-compat/jest.config.cjs index 76e2e0cbe6b4fd..a3e37cb6e05a5f 100644 --- a/packages/react-components/react-colorpicker-compat/jest.config.js +++ b/packages/react-components/react-colorpicker-compat/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-colorpicker-compat/package.json b/packages/react-components/react-colorpicker-compat/package.json index 7c2cdf57d58030..8611dea80dd24c 100644 --- a/packages/react-components/react-colorpicker-compat/package.json +++ b/packages/react-components/react-colorpicker-compat/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "description": "React components for building web experiences", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -34,17 +34,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-combobox/library/.swcrc b/packages/react-components/react-combobox/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-combobox/library/.swcrc +++ b/packages/react-components/react-combobox/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-combobox/library/config/tests.js b/packages/react-components/react-combobox/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-combobox/library/config/tests.js rename to packages/react-components/react-combobox/library/config/tests.cjs diff --git a/packages/react-components/react-combobox/library/eslint.config.js b/packages/react-components/react-combobox/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-combobox/library/eslint.config.js rename to packages/react-components/react-combobox/library/eslint.config.cjs diff --git a/packages/react-components/react-combobox/library/jest.config.js b/packages/react-components/react-combobox/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-combobox/library/jest.config.js rename to packages/react-components/react-combobox/library/jest.config.cjs index c37f332f562def..81be9ff63afe7d 100644 --- a/packages/react-components/react-combobox/library/jest.config.js +++ b/packages/react-components/react-combobox/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-combobox/library/package.json b/packages/react-components/react-combobox/library/package.json index dac8f768449248..7543bcf39f4ee7 100644 --- a/packages/react-components/react-combobox/library/package.json +++ b/packages/react-components/react-combobox/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-combobox", "version": "9.17.4", "description": "Fluent UI React Combobox component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -41,17 +41,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-components/.swcrc b/packages/react-components/react-components/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-components/.swcrc +++ b/packages/react-components/react-components/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-components/config/tests.js b/packages/react-components/react-components/config/tests.cjs similarity index 100% rename from packages/react-components/react-components/config/tests.js rename to packages/react-components/react-components/config/tests.cjs diff --git a/packages/react-components/react-components/eslint.config.js b/packages/react-components/react-components/eslint.config.cjs similarity index 100% rename from packages/react-components/react-components/eslint.config.js rename to packages/react-components/react-components/eslint.config.cjs diff --git a/packages/react-components/react-components/jest.config.js b/packages/react-components/react-components/jest.config.cjs similarity index 96% rename from packages/react-components/react-components/jest.config.js rename to packages/react-components/react-components/jest.config.cjs index 094414a8839794..4dcb6401852aaa 100644 --- a/packages/react-components/react-components/jest.config.js +++ b/packages/react-components/react-components/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-components/package.json b/packages/react-components/react-components/package.json index c21e8c83562998..7abc05067febb3 100644 --- a/packages/react-components/react-components/package.json +++ b/packages/react-components/react-components/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-components", "version": "9.74.5", "description": "Suite package for converged React components", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -88,22 +88,31 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json", "./unstable": { - "types": "./dist/unstable.d.ts", - "node": "./lib-commonjs/unstable/index.js", - "import": "./lib/unstable/index.js", - "require": "./lib-commonjs/unstable/index.js" + "import": { + "types": "./dist/unstable.d.ts", + "default": "./lib/unstable/index.js" + }, + "require": { + "types": "./dist/unstable.d.cts", + "default": "./lib-commonjs/unstable/index.cjs" + } } }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs", "unstable" @@ -113,5 +122,6 @@ "makeStyles": "@griffel/tag-processor/make-styles", "makeResetStyles": "@griffel/tag-processor/make-reset-styles" } - } + }, + "type": "module" } diff --git a/packages/react-components/react-context-selector/.swcrc b/packages/react-components/react-context-selector/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-context-selector/.swcrc +++ b/packages/react-components/react-context-selector/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-context-selector/config/tests.js b/packages/react-components/react-context-selector/config/tests.cjs similarity index 100% rename from packages/react-components/react-context-selector/config/tests.js rename to packages/react-components/react-context-selector/config/tests.cjs diff --git a/packages/react-components/react-context-selector/eslint.config.js b/packages/react-components/react-context-selector/eslint.config.cjs similarity index 100% rename from packages/react-components/react-context-selector/eslint.config.js rename to packages/react-components/react-context-selector/eslint.config.cjs diff --git a/packages/react-components/react-context-selector/jest.config.js b/packages/react-components/react-context-selector/jest.config.cjs similarity index 96% rename from packages/react-components/react-context-selector/jest.config.js rename to packages/react-components/react-context-selector/jest.config.cjs index 61d20ddfe16b41..caf127af7ea434 100644 --- a/packages/react-components/react-context-selector/jest.config.js +++ b/packages/react-components/react-context-selector/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/react-context-selector/package.json b/packages/react-components/react-context-selector/package.json index 71d92669eeee84..88a6f513558b20 100644 --- a/packages/react-components/react-context-selector/package.json +++ b/packages/react-components/react-context-selector/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-context-selector", "version": "9.2.18", "description": "React useContextSelector hook in userland", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -33,17 +33,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-datepicker-compat/library/.swcrc b/packages/react-components/react-datepicker-compat/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-datepicker-compat/library/.swcrc +++ b/packages/react-components/react-datepicker-compat/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-datepicker-compat/library/config/tests.js b/packages/react-components/react-datepicker-compat/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-datepicker-compat/library/config/tests.js rename to packages/react-components/react-datepicker-compat/library/config/tests.cjs diff --git a/packages/react-components/react-datepicker-compat/library/eslint.config.js b/packages/react-components/react-datepicker-compat/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-datepicker-compat/library/eslint.config.js rename to packages/react-components/react-datepicker-compat/library/eslint.config.cjs diff --git a/packages/react-components/react-datepicker-compat/library/jest.config.js b/packages/react-components/react-datepicker-compat/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-datepicker-compat/library/jest.config.js rename to packages/react-components/react-datepicker-compat/library/jest.config.cjs index f78b4bb2bdb9c7..678ba315e3b226 100644 --- a/packages/react-components/react-datepicker-compat/library/jest.config.js +++ b/packages/react-components/react-datepicker-compat/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-datepicker-compat/library/package.json b/packages/react-components/react-datepicker-compat/library/package.json index b9e6e7b44eb768..65b7dffaf62329 100644 --- a/packages/react-components/react-datepicker-compat/library/package.json +++ b/packages/react-components/react-datepicker-compat/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-datepicker-compat", "version": "0.6.35", "description": "React components for building web experiences", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -42,17 +42,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-dialog/library/.swcrc b/packages/react-components/react-dialog/library/.swcrc index 7c60535c03e245..a2c577cb1f91ea 100644 --- a/packages/react-components/react-dialog/library/.swcrc +++ b/packages/react-components/react-dialog/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "experimental": { "plugins": [["swc-plugin-de-indent-template-literal", {}]] }, diff --git a/packages/react-components/react-dialog/library/config/tests.js b/packages/react-components/react-dialog/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-dialog/library/config/tests.js rename to packages/react-components/react-dialog/library/config/tests.cjs diff --git a/packages/react-components/react-dialog/library/eslint.config.js b/packages/react-components/react-dialog/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-dialog/library/eslint.config.js rename to packages/react-components/react-dialog/library/eslint.config.cjs diff --git a/packages/react-components/react-dialog/library/jest.config.js b/packages/react-components/react-dialog/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-dialog/library/jest.config.js rename to packages/react-components/react-dialog/library/jest.config.cjs index 9bb2d9dde732d7..6ef437810dd4d8 100644 --- a/packages/react-components/react-dialog/library/jest.config.js +++ b/packages/react-components/react-dialog/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-dialog/library/package.json b/packages/react-components/react-dialog/library/package.json index 81815686f60182..cad726ca3246c0 100644 --- a/packages/react-components/react-dialog/library/package.json +++ b/packages/react-components/react-dialog/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-dialog", "version": "9.18.2", "description": "Dialog component for Fluent UI React", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -41,17 +41,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-divider/library/.swcrc b/packages/react-components/react-divider/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-divider/library/.swcrc +++ b/packages/react-components/react-divider/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-divider/library/config/tests.js b/packages/react-components/react-divider/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-divider/library/config/tests.js rename to packages/react-components/react-divider/library/config/tests.cjs diff --git a/packages/react-components/react-divider/library/eslint.config.js b/packages/react-components/react-divider/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-divider/library/eslint.config.js rename to packages/react-components/react-divider/library/eslint.config.cjs diff --git a/packages/react-components/react-divider/library/jest.config.js b/packages/react-components/react-divider/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-divider/library/jest.config.js rename to packages/react-components/react-divider/library/jest.config.cjs index e54733aa0d7ce0..f64025affd2a4b 100644 --- a/packages/react-components/react-divider/library/jest.config.js +++ b/packages/react-components/react-divider/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-divider/library/package.json b/packages/react-components/react-divider/library/package.json index fbca3c4304a0c5..d58e7c28471b6a 100644 --- a/packages/react-components/react-divider/library/package.json +++ b/packages/react-components/react-divider/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-divider", "version": "9.7.3", "description": "Fluent UI component to visually separate content.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -33,17 +33,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-drawer/library/.swcrc b/packages/react-components/react-drawer/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-drawer/library/.swcrc +++ b/packages/react-components/react-drawer/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-drawer/library/config/tests.js b/packages/react-components/react-drawer/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-drawer/library/config/tests.js rename to packages/react-components/react-drawer/library/config/tests.cjs diff --git a/packages/react-components/react-drawer/library/eslint.config.js b/packages/react-components/react-drawer/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-drawer/library/eslint.config.js rename to packages/react-components/react-drawer/library/eslint.config.cjs diff --git a/packages/react-components/react-drawer/library/jest.config.js b/packages/react-components/react-drawer/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-drawer/library/jest.config.js rename to packages/react-components/react-drawer/library/jest.config.cjs index 30599cabbbac9c..0c87b897561fe9 100644 --- a/packages/react-components/react-drawer/library/jest.config.js +++ b/packages/react-components/react-drawer/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-drawer/library/package.json b/packages/react-components/react-drawer/library/package.json index 4a315abb9d7734..81eaddbeffc286 100644 --- a/packages/react-components/react-drawer/library/package.json +++ b/packages/react-components/react-drawer/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-drawer", "version": "9.13.1", "description": "Drawer components for Fluent UI React", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -38,17 +38,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-field/library/.swcrc b/packages/react-components/react-field/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-field/library/.swcrc +++ b/packages/react-components/react-field/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-field/library/config/tests.js b/packages/react-components/react-field/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-field/library/config/tests.js rename to packages/react-components/react-field/library/config/tests.cjs diff --git a/packages/react-components/react-field/library/eslint.config.js b/packages/react-components/react-field/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-field/library/eslint.config.js rename to packages/react-components/react-field/library/eslint.config.cjs diff --git a/packages/react-components/react-field/library/jest.config.js b/packages/react-components/react-field/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-field/library/jest.config.js rename to packages/react-components/react-field/library/jest.config.cjs index 40140f5bad8a89..6774eb527a2a3c 100644 --- a/packages/react-components/react-field/library/jest.config.js +++ b/packages/react-components/react-field/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-field/library/package.json b/packages/react-components/react-field/library/package.json index 795bcce0e3835a..aa1497727af8ee 100644 --- a/packages/react-components/react-field/library/package.json +++ b/packages/react-components/react-field/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-field", "version": "9.5.3", "description": "Fluent UI Field components", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -36,17 +36,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-headless-components-preview/library/.swcrc b/packages/react-components/react-headless-components-preview/library/.swcrc index 6ae360015ce576..67f33cb59414a3 100644 --- a/packages/react-components/react-headless-components-preview/library/.swcrc +++ b/packages/react-components/react-headless-components-preview/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-headless-components-preview/library/bundle-isolation.config.json b/packages/react-components/react-headless-components-preview/library/bundle-isolation.config.json index d41f176334152c..66d5e19222b520 100644 --- a/packages/react-components/react-headless-components-preview/library/bundle-isolation.config.json +++ b/packages/react-components/react-headless-components-preview/library/bundle-isolation.config.json @@ -3,8 +3,5 @@ "fixturesRoot": "./bundle-size", "externals": ["react", "react-dom", "react/jsx-runtime", "react/compiler-runtime"], "forbiddenPackages": ["tabster", "@griffel/*", "@fluentui/react-icons"], - "allowedViolations": { - "AllComponents.fixture.js": ["@griffel/core", "@griffel/react"], - "TagPicker.fixture.js": ["@griffel/core", "@griffel/react"] - } + "allowedViolations": {} } diff --git a/packages/react-components/react-headless-components-preview/library/bundle-size/AllComponents.fixture.js b/packages/react-components/react-headless-components-preview/library/bundle-size/AllComponents.fixture.js index 0197c67f0fac34..dece7d02977c84 100644 --- a/packages/react-components/react-headless-components-preview/library/bundle-size/AllComponents.fixture.js +++ b/packages/react-components/react-headless-components-preview/library/bundle-size/AllComponents.fixture.js @@ -37,6 +37,7 @@ import * as Skeleton from '@fluentui/react-headless-components-preview/skeleton' import * as Slider from '@fluentui/react-headless-components-preview/slider'; import * as SpinButton from '@fluentui/react-headless-components-preview/spin-button'; import * as Spinner from '@fluentui/react-headless-components-preview/spinner'; +import * as SplitButton from '@fluentui/react-headless-components-preview/split-button'; import * as SwatchPicker from '@fluentui/react-headless-components-preview/swatch-picker'; import * as Switch from '@fluentui/react-headless-components-preview/switch'; import * as TabList from '@fluentui/react-headless-components-preview/tab-list'; @@ -90,6 +91,7 @@ console.log({ Slider, SpinButton, Spinner, + SplitButton, SwatchPicker, Switch, TabList, diff --git a/packages/react-components/react-headless-components-preview/library/config/tests.js b/packages/react-components/react-headless-components-preview/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-headless-components-preview/library/config/tests.js rename to packages/react-components/react-headless-components-preview/library/config/tests.cjs diff --git a/packages/react-components/react-headless-components-preview/library/eslint.config.js b/packages/react-components/react-headless-components-preview/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-headless-components-preview/library/eslint.config.js rename to packages/react-components/react-headless-components-preview/library/eslint.config.cjs diff --git a/packages/react-components/react-headless-components-preview/library/etc/split-button.api.md b/packages/react-components/react-headless-components-preview/library/etc/split-button.api.md new file mode 100644 index 00000000000000..683a4b156194f8 --- /dev/null +++ b/packages/react-components/react-headless-components-preview/library/etc/split-button.api.md @@ -0,0 +1,41 @@ +## API Report File for "@fluentui/react-headless-components-preview" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { ButtonBaseProps } from '@fluentui/react-button'; +import type { ComponentProps } from '@fluentui/react-utilities'; +import type { ComponentState } from '@fluentui/react-utilities'; +import type { ForwardRefComponent } from '@fluentui/react-utilities'; +import { MenuButtonBaseProps } from '@fluentui/react-button'; +import type * as React_2 from 'react'; +import { renderSplitButton_unstable as renderSplitButton } from '@fluentui/react-button'; +import type { Slot } from '@fluentui/react-utilities'; +import type { SplitButtonBaseProps } from '@fluentui/react-button'; +import type { SplitButtonBaseSlots } from '@fluentui/react-button'; +import type { SplitButtonBaseState } from '@fluentui/react-button'; + +export { renderSplitButton } + +// @public +export const SplitButton: ForwardRefComponent; + +// @public +export type SplitButtonProps = ComponentProps & Pick; + +// @public (undocumented) +export type SplitButtonSlots = Omit & { + menuButton?: Slot; + primaryActionButton?: Slot; +}; + +// @public +export type SplitButtonState = ComponentState & Pick; + +// @public +export const useSplitButton: (props: SplitButtonProps, ref: React_2.Ref) => SplitButtonState; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/react-components/react-headless-components-preview/library/etc/tag-picker.api.md b/packages/react-components/react-headless-components-preview/library/etc/tag-picker.api.md index 82c0d2516706ca..7a4a44360b804e 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/tag-picker.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/tag-picker.api.md @@ -16,7 +16,6 @@ import type { OptionSlots as OptionSlots_2 } from '@fluentui/react-combobox'; import type { OptionState as OptionState_2 } from '@fluentui/react-combobox'; import { PositioningShorthand } from '@fluentui/react-positioning'; import type * as React_2 from 'react'; -import { renderTagPicker_unstable as renderTagPicker } from '@fluentui/react-tag-picker'; import { renderTagPickerButton_unstable as renderTagPickerButton } from '@fluentui/react-tag-picker'; import { renderTagPickerControl_unstable as renderTagPickerControl } from '@fluentui/react-tag-picker'; import { renderTagPickerGroup_unstable as renderTagPickerGroup } from '@fluentui/react-tag-picker'; @@ -50,7 +49,8 @@ import { TagPickerState } from '@fluentui/react-tag-picker'; import { useTagPickerContext_unstable } from '@fluentui/react-tag-picker'; import { useTagPickerContextValues } from '@fluentui/react-tag-picker'; -export { renderTagPicker } +// @public +export const renderTagPicker: (state: TagPickerState, contexts: TagPickerContextValues) => JSXElement; export { renderTagPickerButton } diff --git a/packages/react-components/react-headless-components-preview/library/jest.config.js b/packages/react-components/react-headless-components-preview/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-headless-components-preview/library/jest.config.js rename to packages/react-components/react-headless-components-preview/library/jest.config.cjs index eafebaf8130b29..37c5447140c1d4 100644 --- a/packages/react-components/react-headless-components-preview/library/jest.config.js +++ b/packages/react-components/react-headless-components-preview/library/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/react-headless-components-preview/library/package.json b/packages/react-components/react-headless-components-preview/library/package.json index e6500eb7953594..cef349aea37d98 100644 --- a/packages/react-components/react-headless-components-preview/library/package.json +++ b/packages/react-components/react-headless-components-preview/library/package.json @@ -2,13 +2,14 @@ "name": "@fluentui/react-headless-components-preview", "version": "0.2.4", "description": "Fluent UI React Headless Components", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -79,16 +80,24 @@ }, "exports": { "./accordion": { - "types": "./dist/accordion.d.ts", - "node": "./lib-commonjs/accordion.js", - "import": "./lib/accordion.js", - "require": "./lib-commonjs/accordion.js" + "import": { + "types": "./dist/accordion.d.ts", + "default": "./lib/accordion.js" + }, + "require": { + "types": "./dist/accordion.d.cts", + "default": "./lib-commonjs/accordion.cjs" + } }, "./avatar": { - "types": "./dist/avatar.d.ts", - "node": "./lib-commonjs/avatar.js", - "import": "./lib/avatar.js", - "require": "./lib-commonjs/avatar.js" + "import": { + "types": "./dist/avatar.d.ts", + "default": "./lib/avatar.js" + }, + "require": { + "types": "./dist/avatar.d.cts", + "default": "./lib-commonjs/avatar.cjs" + } }, "./avatar-group": { "types": "./dist/avatar-group.d.ts", @@ -97,34 +106,54 @@ "require": "./lib-commonjs/avatar-group.js" }, "./badge": { - "types": "./dist/badge.d.ts", - "node": "./lib-commonjs/badge.js", - "import": "./lib/badge.js", - "require": "./lib-commonjs/badge.js" + "import": { + "types": "./dist/badge.d.ts", + "default": "./lib/badge.js" + }, + "require": { + "types": "./dist/badge.d.cts", + "default": "./lib-commonjs/badge.cjs" + } }, "./breadcrumb": { - "types": "./dist/breadcrumb.d.ts", - "node": "./lib-commonjs/breadcrumb.js", - "import": "./lib/breadcrumb.js", - "require": "./lib-commonjs/breadcrumb.js" + "import": { + "types": "./dist/breadcrumb.d.ts", + "default": "./lib/breadcrumb.js" + }, + "require": { + "types": "./dist/breadcrumb.d.cts", + "default": "./lib-commonjs/breadcrumb.cjs" + } }, "./button": { - "types": "./dist/button.d.ts", - "node": "./lib-commonjs/button.js", - "import": "./lib/button.js", - "require": "./lib-commonjs/button.js" + "import": { + "types": "./dist/button.d.ts", + "default": "./lib/button.js" + }, + "require": { + "types": "./dist/button.d.cts", + "default": "./lib-commonjs/button.cjs" + } }, "./card": { - "types": "./dist/card.d.ts", - "node": "./lib-commonjs/card.js", - "import": "./lib/card.js", - "require": "./lib-commonjs/card.js" + "import": { + "types": "./dist/card.d.ts", + "default": "./lib/card.js" + }, + "require": { + "types": "./dist/card.d.cts", + "default": "./lib-commonjs/card.cjs" + } }, "./checkbox": { - "types": "./dist/checkbox.d.ts", - "node": "./lib-commonjs/checkbox.js", - "import": "./lib/checkbox.js", - "require": "./lib-commonjs/checkbox.js" + "import": { + "types": "./dist/checkbox.d.ts", + "default": "./lib/checkbox.js" + }, + "require": { + "types": "./dist/checkbox.d.cts", + "default": "./lib-commonjs/checkbox.cjs" + } }, "./color-picker": { "types": "./dist/color-picker.d.ts", @@ -133,10 +162,14 @@ "require": "./lib-commonjs/color-picker.js" }, "./combobox": { - "types": "./dist/combobox.d.ts", - "node": "./lib-commonjs/combobox.js", - "import": "./lib/combobox.js", - "require": "./lib-commonjs/combobox.js" + "import": { + "types": "./dist/combobox.d.ts", + "default": "./lib/combobox.js" + }, + "require": { + "types": "./dist/combobox.d.cts", + "default": "./lib-commonjs/combobox.cjs" + } }, "./compound-button": { "types": "./dist/compound-button.d.ts", @@ -145,76 +178,124 @@ "require": "./lib-commonjs/compound-button.js" }, "./dialog": { - "types": "./dist/dialog.d.ts", - "node": "./lib-commonjs/dialog.js", - "import": "./lib/dialog.js", - "require": "./lib-commonjs/dialog.js" + "import": { + "types": "./dist/dialog.d.ts", + "default": "./lib/dialog.js" + }, + "require": { + "types": "./dist/dialog.d.cts", + "default": "./lib-commonjs/dialog.cjs" + } }, "./divider": { - "types": "./dist/divider.d.ts", - "node": "./lib-commonjs/divider.js", - "import": "./lib/divider.js", - "require": "./lib-commonjs/divider.js" + "import": { + "types": "./dist/divider.d.ts", + "default": "./lib/divider.js" + }, + "require": { + "types": "./dist/divider.d.cts", + "default": "./lib-commonjs/divider.cjs" + } }, "./drawer": { - "types": "./dist/drawer.d.ts", - "node": "./lib-commonjs/drawer.js", - "import": "./lib/drawer.js", - "require": "./lib-commonjs/drawer.js" + "import": { + "types": "./dist/drawer.d.ts", + "default": "./lib/drawer.js" + }, + "require": { + "types": "./dist/drawer.d.cts", + "default": "./lib-commonjs/drawer.cjs" + } }, "./dropdown": { - "types": "./dist/dropdown.d.ts", - "node": "./lib-commonjs/dropdown.js", - "import": "./lib/dropdown.js", - "require": "./lib-commonjs/dropdown.js" + "import": { + "types": "./dist/dropdown.d.ts", + "default": "./lib/dropdown.js" + }, + "require": { + "types": "./dist/dropdown.d.cts", + "default": "./lib-commonjs/dropdown.cjs" + } }, "./field": { - "types": "./dist/field.d.ts", - "node": "./lib-commonjs/field.js", - "import": "./lib/field.js", - "require": "./lib-commonjs/field.js" + "import": { + "types": "./dist/field.d.ts", + "default": "./lib/field.js" + }, + "require": { + "types": "./dist/field.d.cts", + "default": "./lib-commonjs/field.cjs" + } }, "./image": { - "types": "./dist/image.d.ts", - "node": "./lib-commonjs/image.js", - "import": "./lib/image.js", - "require": "./lib-commonjs/image.js" + "import": { + "types": "./dist/image.d.ts", + "default": "./lib/image.js" + }, + "require": { + "types": "./dist/image.d.cts", + "default": "./lib-commonjs/image.cjs" + } }, "./info-label": { - "types": "./dist/info-label.d.ts", - "node": "./lib-commonjs/info-label.js", - "import": "./lib/info-label.js", - "require": "./lib-commonjs/info-label.js" + "import": { + "types": "./dist/info-label.d.ts", + "default": "./lib/info-label.js" + }, + "require": { + "types": "./dist/info-label.d.cts", + "default": "./lib-commonjs/info-label.cjs" + } }, "./input": { - "types": "./dist/input.d.ts", - "node": "./lib-commonjs/input.js", - "import": "./lib/input.js", - "require": "./lib-commonjs/input.js" + "import": { + "types": "./dist/input.d.ts", + "default": "./lib/input.js" + }, + "require": { + "types": "./dist/input.d.cts", + "default": "./lib-commonjs/input.cjs" + } }, "./interaction-tag": { - "types": "./dist/interaction-tag.d.ts", - "node": "./lib-commonjs/interaction-tag.js", - "import": "./lib/interaction-tag.js", - "require": "./lib-commonjs/interaction-tag.js" + "import": { + "types": "./dist/interaction-tag.d.ts", + "default": "./lib/interaction-tag.js" + }, + "require": { + "types": "./dist/interaction-tag.d.cts", + "default": "./lib-commonjs/interaction-tag.cjs" + } }, "./label": { - "types": "./dist/label.d.ts", - "node": "./lib-commonjs/label.js", - "import": "./lib/label.js", - "require": "./lib-commonjs/label.js" + "import": { + "types": "./dist/label.d.ts", + "default": "./lib/label.js" + }, + "require": { + "types": "./dist/label.d.cts", + "default": "./lib-commonjs/label.cjs" + } }, "./link": { - "types": "./dist/link.d.ts", - "node": "./lib-commonjs/link.js", - "import": "./lib/link.js", - "require": "./lib-commonjs/link.js" + "import": { + "types": "./dist/link.d.ts", + "default": "./lib/link.js" + }, + "require": { + "types": "./dist/link.d.cts", + "default": "./lib-commonjs/link.cjs" + } }, "./menu": { - "types": "./dist/menu.d.ts", - "node": "./lib-commonjs/menu.js", - "import": "./lib/menu.js", - "require": "./lib-commonjs/menu.js" + "import": { + "types": "./dist/menu.d.ts", + "default": "./lib/menu.js" + }, + "require": { + "types": "./dist/menu.d.cts", + "default": "./lib-commonjs/menu.cjs" + } }, "./menu-button": { "types": "./dist/menu-button.d.ts", @@ -223,16 +304,24 @@ "require": "./lib-commonjs/menu-button.js" }, "./message-bar": { - "types": "./dist/message-bar.d.ts", - "node": "./lib-commonjs/message-bar.js", - "import": "./lib/message-bar.js", - "require": "./lib-commonjs/message-bar.js" + "import": { + "types": "./dist/message-bar.d.ts", + "default": "./lib/message-bar.js" + }, + "require": { + "types": "./dist/message-bar.d.cts", + "default": "./lib-commonjs/message-bar.cjs" + } }, "./nav": { - "types": "./dist/nav.d.ts", - "node": "./lib-commonjs/nav.js", - "import": "./lib/nav.js", - "require": "./lib-commonjs/nav.js" + "import": { + "types": "./dist/nav.d.ts", + "default": "./lib/nav.js" + }, + "require": { + "types": "./dist/nav.d.cts", + "default": "./lib-commonjs/nav.cjs" + } }, "./overflow": { "types": "./dist/overflow.d.ts", @@ -241,88 +330,150 @@ "require": "./lib-commonjs/overflow.js" }, "./persona": { - "types": "./dist/persona.d.ts", - "node": "./lib-commonjs/persona.js", - "import": "./lib/persona.js", - "require": "./lib-commonjs/persona.js" + "import": { + "types": "./dist/persona.d.ts", + "default": "./lib/persona.js" + }, + "require": { + "types": "./dist/persona.d.cts", + "default": "./lib-commonjs/persona.cjs" + } }, "./popover": { - "types": "./dist/popover.d.ts", - "node": "./lib-commonjs/popover.js", - "import": "./lib/popover.js", - "require": "./lib-commonjs/popover.js" + "import": { + "types": "./dist/popover.d.ts", + "default": "./lib/popover.js" + }, + "require": { + "types": "./dist/popover.d.cts", + "default": "./lib-commonjs/popover.cjs" + } }, "./positioning": { - "types": "./dist/positioning.d.ts", - "node": "./lib-commonjs/positioning.js", - "import": "./lib/positioning.js", - "require": "./lib-commonjs/positioning.js" + "import": { + "types": "./dist/positioning.d.ts", + "default": "./lib/positioning.js" + }, + "require": { + "types": "./dist/positioning.d.cts", + "default": "./lib-commonjs/positioning.cjs" + } }, "./progress-bar": { - "types": "./dist/progress-bar.d.ts", - "node": "./lib-commonjs/progress-bar.js", - "import": "./lib/progress-bar.js", - "require": "./lib-commonjs/progress-bar.js" + "import": { + "types": "./dist/progress-bar.d.ts", + "default": "./lib/progress-bar.js" + }, + "require": { + "types": "./dist/progress-bar.d.cts", + "default": "./lib-commonjs/progress-bar.cjs" + } }, "./provider": { - "types": "./dist/provider.d.ts", - "node": "./lib-commonjs/provider.js", - "import": "./lib/provider.js", - "require": "./lib-commonjs/provider.js" + "import": { + "types": "./dist/provider.d.ts", + "default": "./lib/provider.js" + }, + "require": { + "types": "./dist/provider.d.cts", + "default": "./lib-commonjs/provider.cjs" + } }, "./radio-group": { - "types": "./dist/radio-group.d.ts", - "node": "./lib-commonjs/radio-group.js", - "import": "./lib/radio-group.js", - "require": "./lib-commonjs/radio-group.js" + "import": { + "types": "./dist/radio-group.d.ts", + "default": "./lib/radio-group.js" + }, + "require": { + "types": "./dist/radio-group.d.cts", + "default": "./lib-commonjs/radio-group.cjs" + } }, "./rating": { - "types": "./dist/rating.d.ts", - "node": "./lib-commonjs/rating.js", - "import": "./lib/rating.js", - "require": "./lib-commonjs/rating.js" + "import": { + "types": "./dist/rating.d.ts", + "default": "./lib/rating.js" + }, + "require": { + "types": "./dist/rating.d.cts", + "default": "./lib-commonjs/rating.cjs" + } }, "./rating-display": { - "types": "./dist/rating-display.d.ts", - "node": "./lib-commonjs/rating-display.js", - "import": "./lib/rating-display.js", - "require": "./lib-commonjs/rating-display.js" + "import": { + "types": "./dist/rating-display.d.ts", + "default": "./lib/rating-display.js" + }, + "require": { + "types": "./dist/rating-display.d.cts", + "default": "./lib-commonjs/rating-display.cjs" + } }, "./search-box": { - "types": "./dist/search-box.d.ts", - "node": "./lib-commonjs/search-box.js", - "import": "./lib/search-box.js", - "require": "./lib-commonjs/search-box.js" + "import": { + "types": "./dist/search-box.d.ts", + "default": "./lib/search-box.js" + }, + "require": { + "types": "./dist/search-box.d.cts", + "default": "./lib-commonjs/search-box.cjs" + } }, "./select": { - "types": "./dist/select.d.ts", - "node": "./lib-commonjs/select.js", - "import": "./lib/select.js", - "require": "./lib-commonjs/select.js" + "import": { + "types": "./dist/select.d.ts", + "default": "./lib/select.js" + }, + "require": { + "types": "./dist/select.d.cts", + "default": "./lib-commonjs/select.cjs" + } }, "./skeleton": { - "types": "./dist/skeleton.d.ts", - "node": "./lib-commonjs/skeleton.js", - "import": "./lib/skeleton.js", - "require": "./lib-commonjs/skeleton.js" + "import": { + "types": "./dist/skeleton.d.ts", + "default": "./lib/skeleton.js" + }, + "require": { + "types": "./dist/skeleton.d.cts", + "default": "./lib-commonjs/skeleton.cjs" + } }, "./slider": { - "types": "./dist/slider.d.ts", - "node": "./lib-commonjs/slider.js", - "import": "./lib/slider.js", - "require": "./lib-commonjs/slider.js" + "import": { + "types": "./dist/slider.d.ts", + "default": "./lib/slider.js" + }, + "require": { + "types": "./dist/slider.d.cts", + "default": "./lib-commonjs/slider.cjs" + } }, "./spin-button": { - "types": "./dist/spin-button.d.ts", - "node": "./lib-commonjs/spin-button.js", - "import": "./lib/spin-button.js", - "require": "./lib-commonjs/spin-button.js" + "import": { + "types": "./dist/spin-button.d.ts", + "default": "./lib/spin-button.js" + }, + "require": { + "types": "./dist/spin-button.d.cts", + "default": "./lib-commonjs/spin-button.cjs" + } }, "./spinner": { - "types": "./dist/spinner.d.ts", - "node": "./lib-commonjs/spinner.js", - "import": "./lib/spinner.js", - "require": "./lib-commonjs/spinner.js" + "import": { + "types": "./dist/spinner.d.ts", + "default": "./lib/spinner.js" + }, + "require": { + "types": "./dist/spinner.d.cts", + "default": "./lib-commonjs/spinner.cjs" + } + }, + "./split-button": { + "types": "./dist/split-button.d.ts", + "node": "./lib-commonjs/split-button.js", + "import": "./lib/split-button.js", + "require": "./lib-commonjs/split-button.js" }, "./swatch-picker": { "types": "./dist/swatch-picker.d.ts", @@ -331,28 +482,44 @@ "require": "./lib-commonjs/swatch-picker.js" }, "./switch": { - "types": "./dist/switch.d.ts", - "node": "./lib-commonjs/switch.js", - "import": "./lib/switch.js", - "require": "./lib-commonjs/switch.js" + "import": { + "types": "./dist/switch.d.ts", + "default": "./lib/switch.js" + }, + "require": { + "types": "./dist/switch.d.cts", + "default": "./lib-commonjs/switch.cjs" + } }, "./tab-list": { - "types": "./dist/tab-list.d.ts", - "node": "./lib-commonjs/tab-list.js", - "import": "./lib/tab-list.js", - "require": "./lib-commonjs/tab-list.js" + "import": { + "types": "./dist/tab-list.d.ts", + "default": "./lib/tab-list.js" + }, + "require": { + "types": "./dist/tab-list.d.cts", + "default": "./lib-commonjs/tab-list.cjs" + } }, "./tag": { - "types": "./dist/tag.d.ts", - "node": "./lib-commonjs/tag.js", - "import": "./lib/tag.js", - "require": "./lib-commonjs/tag.js" + "import": { + "types": "./dist/tag.d.ts", + "default": "./lib/tag.js" + }, + "require": { + "types": "./dist/tag.d.cts", + "default": "./lib-commonjs/tag.cjs" + } }, "./tag-group": { - "types": "./dist/tag-group.d.ts", - "node": "./lib-commonjs/tag-group.js", - "import": "./lib/tag-group.js", - "require": "./lib-commonjs/tag-group.js" + "import": { + "types": "./dist/tag-group.d.ts", + "default": "./lib/tag-group.js" + }, + "require": { + "types": "./dist/tag-group.d.cts", + "default": "./lib-commonjs/tag-group.cjs" + } }, "./tag-picker": { "types": "./dist/tag-picker.d.ts", @@ -361,40 +528,64 @@ "require": "./lib-commonjs/tag-picker.js" }, "./teaching-popover": { - "types": "./dist/teaching-popover.d.ts", - "node": "./lib-commonjs/teaching-popover.js", - "import": "./lib/teaching-popover.js", - "require": "./lib-commonjs/teaching-popover.js" + "import": { + "types": "./dist/teaching-popover.d.ts", + "default": "./lib/teaching-popover.js" + }, + "require": { + "types": "./dist/teaching-popover.d.cts", + "default": "./lib-commonjs/teaching-popover.cjs" + } }, "./textarea": { - "types": "./dist/textarea.d.ts", - "node": "./lib-commonjs/textarea.js", - "import": "./lib/textarea.js", - "require": "./lib-commonjs/textarea.js" + "import": { + "types": "./dist/textarea.d.ts", + "default": "./lib/textarea.js" + }, + "require": { + "types": "./dist/textarea.d.cts", + "default": "./lib-commonjs/textarea.cjs" + } }, "./toast": { - "types": "./dist/toast.d.ts", - "node": "./lib-commonjs/toast.js", - "import": "./lib/toast.js", - "require": "./lib-commonjs/toast.js" + "import": { + "types": "./dist/toast.d.ts", + "default": "./lib/toast.js" + }, + "require": { + "types": "./dist/toast.d.cts", + "default": "./lib-commonjs/toast.cjs" + } }, "./toggle-button": { - "types": "./dist/toggle-button.d.ts", - "node": "./lib-commonjs/toggle-button.js", - "import": "./lib/toggle-button.js", - "require": "./lib-commonjs/toggle-button.js" + "import": { + "types": "./dist/toggle-button.d.ts", + "default": "./lib/toggle-button.js" + }, + "require": { + "types": "./dist/toggle-button.d.cts", + "default": "./lib-commonjs/toggle-button.cjs" + } }, "./toolbar": { - "types": "./dist/toolbar.d.ts", - "node": "./lib-commonjs/toolbar.js", - "import": "./lib/toolbar.js", - "require": "./lib-commonjs/toolbar.js" + "import": { + "types": "./dist/toolbar.d.ts", + "default": "./lib/toolbar.js" + }, + "require": { + "types": "./dist/toolbar.d.cts", + "default": "./lib-commonjs/toolbar.cjs" + } }, "./tooltip": { - "types": "./dist/tooltip.d.ts", - "node": "./lib-commonjs/tooltip.js", - "import": "./lib/tooltip.js", - "require": "./lib-commonjs/tooltip.js" + "import": { + "types": "./dist/tooltip.d.ts", + "default": "./lib/tooltip.js" + }, + "require": { + "types": "./dist/tooltip.d.cts", + "default": "./lib-commonjs/tooltip.cjs" + } }, "./package.json": "./package.json" }, @@ -408,5 +599,6 @@ "@fluentui/scripts-cypress": "*", "@fluentui/verify-bundle-isolation": "*", "@oddbird/popover-polyfill": "^0.6.1" - } + }, + "type": "module" } diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Dialog/Dialog.cy.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Dialog/Dialog.cy.tsx index b1a8a183cd68f6..5d39d5b0ad4b4a 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Dialog/Dialog.cy.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Dialog/Dialog.cy.tsx @@ -21,6 +21,7 @@ const dialogSurfaceElementSelector = `dialog`; const dialogTriggerOpenSelector = `#${dialogTriggerOpenId}`; const dialogTriggerCloseSelector = `#${dialogTriggerCloseId}`; const dialogPrimaryButtonSelector = `#${dialogPrimaryButtonId}`; +const tooltipSelector = `[role="tooltip"]`; const mount = (element: JSXElement) => mountBase({element}); @@ -186,7 +187,10 @@ describe('Dialog', () => { cy.get('#open-popover-btn').should('have.focus'); // Open Tooltip, wait for the tooltip to appear and then close it with Escape - cy.get(dialogTriggerCloseSelector).focus().wait(0).realType('{esc}'); + cy.get(dialogTriggerCloseSelector).focus(); + cy.get(tooltipSelector).should('be.visible'); + cy.focused().realType('{esc}'); + cy.get(tooltipSelector).should('not.exist'); cy.get(dialogSurfaceSelector).should('exist'); }); diff --git a/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.test.tsx b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.test.tsx new file mode 100644 index 00000000000000..9c06f59507c8bb --- /dev/null +++ b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.test.tsx @@ -0,0 +1,143 @@ +import * as React from 'react'; +import { render } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { isConformant } from '../../testing/isConformant'; +import { SplitButton } from './SplitButton'; + +describe('SplitButton', () => { + isConformant({ + Component: SplitButton, + displayName: 'SplitButton', + }); + + it('renders both the primary action button and the menu button', () => { + const { getAllByRole } = render(This is a button); + const [primaryActionButton, menuButton] = getAllByRole('button'); + + expect(primaryActionButton).toBeInTheDocument(); + expect(menuButton).toBeInTheDocument(); + }); + + it('ships no default menu icon', () => { + const { getAllByRole } = render(This is a button); + const [, menuButton] = getAllByRole('button'); + + expect(menuButton.querySelector('svg')).not.toBeInTheDocument(); + }); + + it('renders a custom menuIcon slot', () => { + const { getAllByRole } = render( + }>This is a button, + ); + const [, menuButton] = getAllByRole('button'); + + expect(menuButton.querySelector('[data-testid="custom-menu-icon"]')).toBeInTheDocument(); + }); + + it('labels the menu button using the primary action button id by default', () => { + const { getAllByRole } = render(This is a button); + const [primaryActionButton, menuButton] = getAllByRole('button'); + + expect(menuButton).toHaveAttribute('aria-labelledby', primaryActionButton.id); + }); + + it('can trigger a function by clicking the primary action button', () => { + const onClick = jest.fn(); + const { getAllByRole } = render(This is a button); + const [primaryActionButton] = getAllByRole('button'); + + userEvent.click(primaryActionButton); + expect(onClick).toHaveBeenCalled(); + }); + + it('propagates disabled to both child buttons via their own data-disabled attribute', () => { + const { getAllByRole } = render(This is a button); + const [primaryActionButton, menuButton] = getAllByRole('button'); + + expect(primaryActionButton).toHaveAttribute('data-disabled'); + expect(menuButton).toHaveAttribute('data-disabled'); + }); + + it('propagates disabledFocusable to both child buttons via their own data-disabled-focusable attribute', () => { + const { getAllByRole } = render(This is a button); + const [primaryActionButton, menuButton] = getAllByRole('button'); + + expect(primaryActionButton).toHaveAttribute('data-disabled-focusable'); + expect(menuButton).toHaveAttribute('data-disabled-focusable'); + }); + + it('allows an independent primaryActionButton override to win over propagated defaults', () => { + const { getAllByRole } = render( + + This is a button + , + ); + const [primaryActionButton, menuButton] = getAllByRole('button'); + + expect(primaryActionButton).not.toHaveAttribute('disabled'); + expect(menuButton).toHaveAttribute('disabled'); + }); + + it('allows an independent menuButton override to win over propagated defaults', () => { + const { getAllByRole } = render( + + This is a button + , + ); + const [primaryActionButton, menuButton] = getAllByRole('button'); + + expect(primaryActionButton).toHaveAttribute('disabled'); + expect(menuButton).not.toHaveAttribute('disabled'); + }); + + it('does not emit a wrapper-level data-disabled attribute', () => { + const { container } = render(This is a button); + const root = container.firstElementChild as HTMLElement; + + expect(root).not.toHaveAttribute('data-disabled'); + }); + + it('forwards icon to the primary action button', () => { + const { getAllByRole } = render(}>This is a button); + const [primaryActionButton] = getAllByRole('button'); + + expect(primaryActionButton.querySelector('[data-testid="icon"]')).toBeInTheDocument(); + }); + + it('forwards iconPosition to the primary action button', () => { + const { getAllByRole } = render( + } iconPosition="after"> + This is a button + , + ); + const [primaryActionButton] = getAllByRole('button'); + const icon = primaryActionButton.querySelector('[data-testid="icon"]') as HTMLElement; + + expect(icon).toBeInTheDocument(); + expect(primaryActionButton.lastElementChild).toContainElement(icon); + }); + + it('allows a per-slot disabledFocusable override to win for primaryActionButton', () => { + const { getAllByRole } = render( + + This is a button + , + ); + const [primaryActionButton, menuButton] = getAllByRole('button'); + + expect(primaryActionButton).not.toHaveAttribute('data-disabled-focusable'); + expect(menuButton).toHaveAttribute('data-disabled-focusable'); + }); + + it('allows a per-slot disabledFocusable override to win for menuButton', () => { + const { getAllByRole } = render( + + This is a button + , + ); + const [primaryActionButton, menuButton] = getAllByRole('button'); + + expect(primaryActionButton).toHaveAttribute('data-disabled-focusable'); + expect(menuButton).not.toHaveAttribute('data-disabled-focusable'); + }); +}); diff --git a/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.tsx b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.tsx new file mode 100644 index 00000000000000..3c2802b40a1d5f --- /dev/null +++ b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.tsx @@ -0,0 +1,19 @@ +'use client'; + +import * as React from 'react'; +import type { ForwardRefComponent } from '@fluentui/react-utilities'; +import type { SplitButtonProps } from './SplitButton.types'; +import { useSplitButton } from './useSplitButton'; +import { renderSplitButton } from './renderSplitButton'; + +/** + * SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary + * action, while interacting with the second one opens a menu with secondary actions. + */ +export const SplitButton: ForwardRefComponent = React.forwardRef((props, ref) => { + const state = useSplitButton(props, ref); + + return renderSplitButton(state); +}); + +SplitButton.displayName = 'SplitButton'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.types.ts b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.types.ts new file mode 100644 index 00000000000000..8a21b1a63c1db1 --- /dev/null +++ b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/SplitButton.types.ts @@ -0,0 +1,21 @@ +import type { SplitButtonBaseProps, SplitButtonBaseSlots, SplitButtonBaseState } from '@fluentui/react-button'; +import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities'; +import type { Button } from '../Button/Button'; +import type { MenuButton } from '../MenuButton/MenuButton'; + +export type SplitButtonSlots = Omit & { + menuButton?: Slot; + primaryActionButton?: Slot; +}; + +/** + * SplitButton props + */ +export type SplitButtonProps = ComponentProps & + Pick; + +/** + * State used in rendering SplitButton + */ +export type SplitButtonState = ComponentState & + Pick; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/index.ts b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/index.ts new file mode 100644 index 00000000000000..593c4f0f9643dd --- /dev/null +++ b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/index.ts @@ -0,0 +1,4 @@ +export { SplitButton } from './SplitButton'; +export { renderSplitButton } from './renderSplitButton'; +export { useSplitButton } from './useSplitButton'; +export type { SplitButtonSlots, SplitButtonProps, SplitButtonState } from './SplitButton.types'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/renderSplitButton.tsx b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/renderSplitButton.tsx new file mode 100644 index 00000000000000..41a46d0ee532df --- /dev/null +++ b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/renderSplitButton.tsx @@ -0,0 +1 @@ +export { renderSplitButton_unstable as renderSplitButton } from '@fluentui/react-button'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/useSplitButton.ts b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/useSplitButton.ts new file mode 100644 index 00000000000000..7edf76439c875f --- /dev/null +++ b/packages/react-components/react-headless-components-preview/library/src/components/SplitButton/useSplitButton.ts @@ -0,0 +1,45 @@ +'use client'; + +import type * as React from 'react'; +import { slot } from '@fluentui/react-utilities'; +import { useSplitButtonBase_unstable } from '@fluentui/react-button'; +import { Button } from '../Button/Button'; +import { MenuButton } from '../MenuButton/MenuButton'; +import type { SplitButtonProps, SplitButtonState } from './SplitButton.types'; + +/** + * Returns the state for a SplitButton component, given its props and ref. + * + * Composes base behavior with headless Button and MenuButton slots without adding + * SplitButton-level styling or state attributes. + */ +export const useSplitButton = (props: SplitButtonProps, ref: React.Ref): SplitButtonState => { + const baseState = useSplitButtonBase_unstable(props, ref); + + const menuButtonShorthand = slot.optional(props.menuButton, { + defaultProps: { + ...baseState.menuButton, + disabledFocusable: baseState.disabledFocusable, + menuIcon: props.menuIcon, + }, + renderByDefault: true, + elementType: MenuButton, + }); + const primaryActionButtonShorthand = slot.optional(props.primaryActionButton, { + defaultProps: { + ...baseState.primaryActionButton, + disabledFocusable: baseState.disabledFocusable, + icon: props.icon, + iconPosition: baseState.iconPosition, + }, + renderByDefault: true, + elementType: Button, + }); + + return { + ...baseState, + components: { root: 'div', menuButton: MenuButton, primaryActionButton: Button }, + menuButton: menuButtonShorthand, + primaryActionButton: primaryActionButtonShorthand, + }; +}; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/TagPicker/renderTagPicker.tsx b/packages/react-components/react-headless-components-preview/library/src/components/TagPicker/renderTagPicker.tsx index 93bdfe09d6e749..ccd339fc98ac12 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/TagPicker/renderTagPicker.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/TagPicker/renderTagPicker.tsx @@ -1 +1,25 @@ -export { renderTagPicker_unstable as renderTagPicker } from '@fluentui/react-tag-picker'; +import * as React from 'react'; +import { ActiveDescendantContextProvider } from '@fluentui/react-aria'; +import { ListboxProvider } from '@fluentui/react-combobox'; +import { TagPickerContextProvider } from '@fluentui/react-tag-picker'; +import { assertSlots } from '@fluentui/react-utilities'; +import type { JSXElement } from '@fluentui/react-utilities'; + +import type { TagPickerState, TagPickerContextValues, TagPickerSlots } from './TagPicker.types'; + +/** + * Render the final JSX of TagPicker + */ +export const renderTagPicker = (state: TagPickerState, contexts: TagPickerContextValues): JSXElement => { + assertSlots(state); + return ( + + + + {state.trigger} + {state.popover} + + + + ); +}; diff --git a/packages/react-components/react-headless-components-preview/library/src/split-button.ts b/packages/react-components/react-headless-components-preview/library/src/split-button.ts new file mode 100644 index 00000000000000..ed91036a64bf27 --- /dev/null +++ b/packages/react-components/react-headless-components-preview/library/src/split-button.ts @@ -0,0 +1,2 @@ +export { SplitButton, renderSplitButton, useSplitButton } from './components/SplitButton'; +export type { SplitButtonSlots, SplitButtonProps, SplitButtonState } from './components/SplitButton'; diff --git a/packages/react-components/react-headless-components-preview/stories/src/SplitButton/SplitButtonDefault.stories.tsx b/packages/react-components/react-headless-components-preview/stories/src/SplitButton/SplitButtonDefault.stories.tsx new file mode 100644 index 00000000000000..aa3ba8deed20a8 --- /dev/null +++ b/packages/react-components/react-headless-components-preview/stories/src/SplitButton/SplitButtonDefault.stories.tsx @@ -0,0 +1,32 @@ +import * as React from 'react'; +import { Menu, MenuTrigger, MenuPopover, MenuList, MenuItem } from '@fluentui/react-headless-components-preview/menu'; +import { SplitButton } from '@fluentui/react-headless-components-preview/split-button'; +import type { MenuButtonProps } from '@fluentui/react-headless-components-preview/menu-button'; +import { ChevronDownRegular } from '@fluentui/react-icons'; + +import styles from './split-button.module.css'; + +const onPrimaryActionClick = () => alert('Primary action clicked.'); + +export const Default = (): React.ReactNode => ( + + + {(triggerProps: MenuButtonProps) => ( + } + > + Send + + )} + + + + Send now + Schedule send + + + +); diff --git a/packages/react-components/react-headless-components-preview/stories/src/SplitButton/SplitButtonDescription.md b/packages/react-components/react-headless-components-preview/stories/src/SplitButton/SplitButtonDescription.md new file mode 100644 index 00000000000000..e66cda6db30edb --- /dev/null +++ b/packages/react-components/react-headless-components-preview/stories/src/SplitButton/SplitButtonDescription.md @@ -0,0 +1,10 @@ +A split button combines a primary action with a menu trigger for related actions. + +The headless `SplitButton` has no default menu icon. Provide one through the `menuIcon` slot when +needed. + +To compose with `Menu`, use `MenuTrigger`'s render prop to forward its generated trigger props to +the `menuButton` slot. + +When no accessible name is provided for the menu trigger, `SplitButton` generates an +`aria-labelledby` fallback that references the primary action. diff --git a/packages/react-components/react-headless-components-preview/stories/src/SplitButton/index.stories.tsx b/packages/react-components/react-headless-components-preview/stories/src/SplitButton/index.stories.tsx new file mode 100644 index 00000000000000..57e072d24917f0 --- /dev/null +++ b/packages/react-components/react-headless-components-preview/stories/src/SplitButton/index.stories.tsx @@ -0,0 +1,17 @@ +import { SplitButton } from '@fluentui/react-headless-components-preview/split-button'; + +import descriptionMd from './SplitButtonDescription.md'; + +export { Default } from './SplitButtonDefault.stories'; + +export default { + title: 'Components/SplitButton', + component: SplitButton, + parameters: { + docs: { + description: { + component: descriptionMd, + }, + }, + }, +}; diff --git a/packages/react-components/react-headless-components-preview/stories/src/SplitButton/split-button.module.css b/packages/react-components/react-headless-components-preview/stories/src/SplitButton/split-button.module.css new file mode 100644 index 00000000000000..cd4bc3383d3ae0 --- /dev/null +++ b/packages/react-components/react-headless-components-preview/stories/src/SplitButton/split-button.module.css @@ -0,0 +1,110 @@ +.wrapper { + display: inline-flex; + align-items: stretch; +} + +.primaryButton, +.menuButton { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 6px; + height: 32px; + border: var(--stroke-thin) solid transparent; + background: var(--accent); + color: var(--accent-contrast); + font-size: 13px; + font-weight: 500; + cursor: pointer; + user-select: none; + transition: background-color var(--duration-fast) var(--ease-standard), + color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard); +} + +.primaryButton { + padding-inline: var(--space-3); + border-start-start-radius: var(--radius-md); + border-end-start-radius: var(--radius-md); + border-inline-end: var(--stroke-thin) solid var(--accent-strong); +} + +.menuButton { + padding-inline: var(--space-2); + border-start-end-radius: var(--radius-md); + border-end-end-radius: var(--radius-md); +} + +.primaryButton:hover, +.menuButton:hover, +.menuButton[aria-expanded='true'], +.menuButton[data-open] { + background: var(--accent-strong); +} + +.primaryButton:focus-visible, +.menuButton:focus-visible { + outline: none; + box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--accent); +} + +.primaryButton[data-disabled], +.primaryButton[data-disabled-focusable], +.menuButton[data-disabled], +.menuButton[data-disabled-focusable] { + opacity: 0.4; + cursor: not-allowed; +} + +.primaryButton[data-disabled]:hover, +.primaryButton[data-disabled-focusable]:hover, +.menuButton[data-disabled]:hover, +.menuButton[data-disabled-focusable]:hover { + background: var(--accent); +} + +.menuButton svg { + display: block; + width: 16px; + height: 16px; + flex-shrink: 0; +} + +.surface { + background: var(--bg-elev); + border-radius: var(--radius-md); + border: var(--stroke-thin) solid var(--border); + box-shadow: var(--shadow-3); + padding: var(--space-1) 0; + min-width: 180px; +} + +.list { + display: flex; + flex-direction: column; + outline: none; +} + +.item { + display: flex; + align-items: center; + gap: var(--space-2); + width: 100%; + padding: 6px var(--space-3); + border: 0; + background: transparent; + color: var(--text); + font-size: 13.5px; + line-height: 1.4; + text-align: left; + cursor: pointer; + outline: none; +} + +.item:hover, +.item:focus-visible { + background: var(--surface-muted); +} + +.item:focus-visible { + box-shadow: inset 0 0 0 2px var(--accent); +} diff --git a/packages/react-components/react-icons-compat/library/.swcrc b/packages/react-components/react-icons-compat/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-icons-compat/library/.swcrc +++ b/packages/react-components/react-icons-compat/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-icons-compat/library/config/tests.js b/packages/react-components/react-icons-compat/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-icons-compat/library/config/tests.js rename to packages/react-components/react-icons-compat/library/config/tests.cjs diff --git a/packages/react-components/react-icons-compat/library/eslint.config.js b/packages/react-components/react-icons-compat/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-icons-compat/library/eslint.config.js rename to packages/react-components/react-icons-compat/library/eslint.config.cjs diff --git a/packages/react-components/react-icons-compat/library/jest.config.js b/packages/react-components/react-icons-compat/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-icons-compat/library/jest.config.js rename to packages/react-components/react-icons-compat/library/jest.config.cjs index a2f259c7b7791b..eca792969af665 100644 --- a/packages/react-components/react-icons-compat/library/jest.config.js +++ b/packages/react-components/react-icons-compat/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-icons-compat/library/package.json b/packages/react-components/react-icons-compat/library/package.json index 8f938ddf25cc8f..51588776a6cbb6 100644 --- a/packages/react-components/react-icons-compat/library/package.json +++ b/packages/react-components/react-icons-compat/library/package.json @@ -2,13 +2,14 @@ "name": "@fluentui/react-icons-compat", "version": "0.2.21", "description": "Package for icon utility methods used by font and svg icons.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -33,10 +34,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -45,5 +50,6 @@ "major", "prerelease" ] - } + }, + "type": "module" } diff --git a/packages/react-components/react-image/library/.swcrc b/packages/react-components/react-image/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-image/library/.swcrc +++ b/packages/react-components/react-image/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-image/library/config/tests.js b/packages/react-components/react-image/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-image/library/config/tests.js rename to packages/react-components/react-image/library/config/tests.cjs diff --git a/packages/react-components/react-image/library/eslint.config.js b/packages/react-components/react-image/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-image/library/eslint.config.js rename to packages/react-components/react-image/library/eslint.config.cjs diff --git a/packages/react-components/react-image/library/jest.config.js b/packages/react-components/react-image/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-image/library/jest.config.js rename to packages/react-components/react-image/library/jest.config.cjs index 1228d0798c7e23..e728a28fab8df5 100644 --- a/packages/react-components/react-image/library/jest.config.js +++ b/packages/react-components/react-image/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-image/library/package.json b/packages/react-components/react-image/library/package.json index b6bb46fbec5298..50951ca4ac654b 100644 --- a/packages/react-components/react-image/library/package.json +++ b/packages/react-components/react-image/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-image", "version": "9.4.3", "description": "Fluent UI React Image component.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -33,17 +33,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-infolabel/library/.swcrc b/packages/react-components/react-infolabel/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-infolabel/library/.swcrc +++ b/packages/react-components/react-infolabel/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-infolabel/library/config/tests.js b/packages/react-components/react-infolabel/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-infolabel/library/config/tests.js rename to packages/react-components/react-infolabel/library/config/tests.cjs diff --git a/packages/react-components/react-infolabel/library/eslint.config.js b/packages/react-components/react-infolabel/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-infolabel/library/eslint.config.js rename to packages/react-components/react-infolabel/library/eslint.config.cjs diff --git a/packages/react-components/react-infolabel/library/jest.config.js b/packages/react-components/react-infolabel/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-infolabel/library/jest.config.js rename to packages/react-components/react-infolabel/library/jest.config.cjs index c871bda7ac9f7c..3bc4feac803afd 100644 --- a/packages/react-components/react-infolabel/library/jest.config.js +++ b/packages/react-components/react-infolabel/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-infolabel/library/package.json b/packages/react-components/react-infolabel/library/package.json index 919b4649c8b437..8a84fed88db200 100644 --- a/packages/react-components/react-infolabel/library/package.json +++ b/packages/react-components/react-infolabel/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-infolabel", "version": "9.4.23", "description": "InfoLabel component for Fluent UI v9", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -31,10 +31,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -47,7 +51,9 @@ "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-input/library/.swcrc b/packages/react-components/react-input/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-input/library/.swcrc +++ b/packages/react-components/react-input/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-input/library/config/tests.js b/packages/react-components/react-input/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-input/library/config/tests.js rename to packages/react-components/react-input/library/config/tests.cjs diff --git a/packages/react-components/react-input/library/eslint.config.js b/packages/react-components/react-input/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-input/library/eslint.config.js rename to packages/react-components/react-input/library/eslint.config.cjs diff --git a/packages/react-components/react-input/library/jest.config.js b/packages/react-components/react-input/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-input/library/jest.config.js rename to packages/react-components/react-input/library/jest.config.cjs index 699e1f6ec8e8db..977db72a53f836 100644 --- a/packages/react-components/react-input/library/jest.config.js +++ b/packages/react-components/react-input/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-input/library/package.json b/packages/react-components/react-input/library/package.json index 5a6a7fce074c08..f35eb6295c2103 100644 --- a/packages/react-components/react-input/library/package.json +++ b/packages/react-components/react-input/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-input", "version": "9.8.5", "description": "Fluent UI React Input component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -34,17 +34,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-jsx-runtime/.swcrc b/packages/react-components/react-jsx-runtime/.swcrc index 7c60535c03e245..a2c577cb1f91ea 100644 --- a/packages/react-components/react-jsx-runtime/.swcrc +++ b/packages/react-components/react-jsx-runtime/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "experimental": { "plugins": [["swc-plugin-de-indent-template-literal", {}]] }, diff --git a/packages/react-components/react-jsx-runtime/config/tests.js b/packages/react-components/react-jsx-runtime/config/tests.cjs similarity index 100% rename from packages/react-components/react-jsx-runtime/config/tests.js rename to packages/react-components/react-jsx-runtime/config/tests.cjs diff --git a/packages/react-components/react-jsx-runtime/eslint.config.js b/packages/react-components/react-jsx-runtime/eslint.config.cjs similarity index 100% rename from packages/react-components/react-jsx-runtime/eslint.config.js rename to packages/react-components/react-jsx-runtime/eslint.config.cjs diff --git a/packages/react-components/react-jsx-runtime/jest.config.js b/packages/react-components/react-jsx-runtime/jest.config.cjs similarity index 96% rename from packages/react-components/react-jsx-runtime/jest.config.js rename to packages/react-components/react-jsx-runtime/jest.config.cjs index f5ec29eee00d72..eb472121804260 100644 --- a/packages/react-components/react-jsx-runtime/jest.config.js +++ b/packages/react-components/react-jsx-runtime/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/react-jsx-runtime/package.json b/packages/react-components/react-jsx-runtime/package.json index 149757f751f654..68448b78bdb0ce 100644 --- a/packages/react-components/react-jsx-runtime/package.json +++ b/packages/react-components/react-jsx-runtime/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-jsx-runtime", "version": "9.4.4", "description": "Custom JSX runtime for @fluentui/react-components", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -27,31 +27,45 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./jsx-dev-runtime": { - "types": "./dist/jsx-dev-runtime.d.ts", - "node": "./lib-commonjs/jsx-dev-runtime.js", - "import": "./lib/jsx-dev-runtime.js", - "require": "./lib-commonjs/jsx-dev-runtime.js" + "import": { + "types": "./dist/jsx-dev-runtime.d.ts", + "default": "./lib/jsx-dev-runtime.js" + }, + "require": { + "types": "./dist/jsx-dev-runtime.d.cts", + "default": "./lib-commonjs/jsx-dev-runtime.cjs" + } }, "./jsx-runtime": { - "types": "./dist/jsx-runtime.d.ts", - "node": "./lib-commonjs/jsx-runtime.js", - "import": "./lib/jsx-runtime.js", - "require": "./lib-commonjs/jsx-runtime.js" + "import": { + "types": "./dist/jsx-runtime.d.ts", + "default": "./lib/jsx-runtime.js" + }, + "require": { + "types": "./dist/jsx-runtime.d.cts", + "default": "./lib-commonjs/jsx-runtime.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "jsx-dev-runtime", "jsx-runtime", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-label/library/.swcrc b/packages/react-components/react-label/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-label/library/.swcrc +++ b/packages/react-components/react-label/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-label/library/config/tests.js b/packages/react-components/react-label/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-label/library/config/tests.js rename to packages/react-components/react-label/library/config/tests.cjs diff --git a/packages/react-components/react-label/library/eslint.config.js b/packages/react-components/react-label/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-label/library/eslint.config.js rename to packages/react-components/react-label/library/eslint.config.cjs diff --git a/packages/react-components/react-label/library/jest.config.js b/packages/react-components/react-label/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-label/library/jest.config.js rename to packages/react-components/react-label/library/jest.config.cjs index 53f7c7b70ea8b7..ad0283886a8679 100644 --- a/packages/react-components/react-label/library/jest.config.js +++ b/packages/react-components/react-label/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-label/library/package.json b/packages/react-components/react-label/library/package.json index 9f99ec69cf97a5..0e7c0a01641ca6 100644 --- a/packages/react-components/react-label/library/package.json +++ b/packages/react-components/react-label/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-label", "version": "9.4.3", "description": "Fluent UI React Label component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -33,17 +33,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-link/library/.swcrc b/packages/react-components/react-link/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-link/library/.swcrc +++ b/packages/react-components/react-link/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-link/library/config/tests.js b/packages/react-components/react-link/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-link/library/config/tests.js rename to packages/react-components/react-link/library/config/tests.cjs diff --git a/packages/react-components/react-link/library/eslint.config.js b/packages/react-components/react-link/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-link/library/eslint.config.js rename to packages/react-components/react-link/library/eslint.config.cjs diff --git a/packages/react-components/react-link/library/jest.config.js b/packages/react-components/react-link/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-link/library/jest.config.js rename to packages/react-components/react-link/library/jest.config.cjs index fba3cb18a026f8..a0f47e8a31374f 100644 --- a/packages/react-components/react-link/library/jest.config.js +++ b/packages/react-components/react-link/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-link/library/package.json b/packages/react-components/react-link/library/package.json index e50771192c228b..78cebcb75e170c 100644 --- a/packages/react-components/react-link/library/package.json +++ b/packages/react-components/react-link/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-link", "version": "9.8.3", "description": "Fluent UI React Link component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -35,17 +35,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-list/library/.swcrc b/packages/react-components/react-list/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-list/library/.swcrc +++ b/packages/react-components/react-list/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-list/library/config/tests.js b/packages/react-components/react-list/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-list/library/config/tests.js rename to packages/react-components/react-list/library/config/tests.cjs diff --git a/packages/react-components/react-list/library/eslint.config.js b/packages/react-components/react-list/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-list/library/eslint.config.js rename to packages/react-components/react-list/library/eslint.config.cjs diff --git a/packages/react-components/react-list/library/jest.config.js b/packages/react-components/react-list/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-list/library/jest.config.js rename to packages/react-components/react-list/library/jest.config.cjs index b8b9f61ddfbf82..ba131e2fb6e90b 100644 --- a/packages/react-components/react-list/library/jest.config.js +++ b/packages/react-components/react-list/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-list/library/package.json b/packages/react-components/react-list/library/package.json index bec83450cd9d45..6267ef6723ae07 100644 --- a/packages/react-components/react-list/library/package.json +++ b/packages/react-components/react-list/library/package.json @@ -2,13 +2,14 @@ "name": "@fluentui/react-list", "version": "9.6.16", "description": "React List v9", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -37,10 +38,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -49,5 +54,6 @@ "major", "prerelease" ] - } + }, + "type": "module" } diff --git a/packages/react-components/react-menu-grid-preview/library/.swcrc b/packages/react-components/react-menu-grid-preview/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-menu-grid-preview/library/.swcrc +++ b/packages/react-components/react-menu-grid-preview/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-menu-grid-preview/library/config/tests.js b/packages/react-components/react-menu-grid-preview/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-menu-grid-preview/library/config/tests.js rename to packages/react-components/react-menu-grid-preview/library/config/tests.cjs diff --git a/packages/react-components/react-menu-grid-preview/library/eslint.config.js b/packages/react-components/react-menu-grid-preview/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-menu-grid-preview/library/eslint.config.js rename to packages/react-components/react-menu-grid-preview/library/eslint.config.cjs diff --git a/packages/react-components/react-menu-grid-preview/library/jest.config.js b/packages/react-components/react-menu-grid-preview/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-menu-grid-preview/library/jest.config.js rename to packages/react-components/react-menu-grid-preview/library/jest.config.cjs index 29443c89f9fdbd..4fa045248a02d5 100644 --- a/packages/react-components/react-menu-grid-preview/library/jest.config.js +++ b/packages/react-components/react-menu-grid-preview/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-menu-grid-preview/library/package.json b/packages/react-components/react-menu-grid-preview/library/package.json index 1f1257e4300997..78eb93ef8d9e5b 100644 --- a/packages/react-components/react-menu-grid-preview/library/package.json +++ b/packages/react-components/react-menu-grid-preview/library/package.json @@ -2,13 +2,14 @@ "name": "@fluentui/react-menu-grid-preview", "version": "0.5.4", "description": "New fluentui react package", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -38,10 +39,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -50,5 +55,6 @@ "major", "prerelease" ] - } + }, + "type": "module" } diff --git a/packages/react-components/react-menu/library/.swcrc b/packages/react-components/react-menu/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-menu/library/.swcrc +++ b/packages/react-components/react-menu/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-menu/library/config/tests.js b/packages/react-components/react-menu/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-menu/library/config/tests.js rename to packages/react-components/react-menu/library/config/tests.cjs diff --git a/packages/react-components/react-menu/library/eslint.config.js b/packages/react-components/react-menu/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-menu/library/eslint.config.js rename to packages/react-components/react-menu/library/eslint.config.cjs diff --git a/packages/react-components/react-menu/library/jest.config.js b/packages/react-components/react-menu/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-menu/library/jest.config.js rename to packages/react-components/react-menu/library/jest.config.cjs index 9bc6e63b6603ef..7242b562f98c90 100644 --- a/packages/react-components/react-menu/library/jest.config.js +++ b/packages/react-components/react-menu/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-menu/library/package.json b/packages/react-components/react-menu/library/package.json index f9201421e76cd0..9771376a1fba07 100644 --- a/packages/react-components/react-menu/library/package.json +++ b/packages/react-components/react-menu/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-menu", "version": "9.25.2", "description": "Fluent UI menu component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -42,17 +42,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-message-bar/library/.swcrc b/packages/react-components/react-message-bar/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-message-bar/library/.swcrc +++ b/packages/react-components/react-message-bar/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-message-bar/library/config/tests.js b/packages/react-components/react-message-bar/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-message-bar/library/config/tests.js rename to packages/react-components/react-message-bar/library/config/tests.cjs diff --git a/packages/react-components/react-message-bar/library/eslint.config.js b/packages/react-components/react-message-bar/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-message-bar/library/eslint.config.js rename to packages/react-components/react-message-bar/library/eslint.config.cjs diff --git a/packages/react-components/react-message-bar/library/jest.config.js b/packages/react-components/react-message-bar/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-message-bar/library/jest.config.js rename to packages/react-components/react-message-bar/library/jest.config.cjs index 2669112fea23b8..c060b2660bb090 100644 --- a/packages/react-components/react-message-bar/library/jest.config.js +++ b/packages/react-components/react-message-bar/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-message-bar/library/package.json b/packages/react-components/react-message-bar/library/package.json index 570b6a05b0ee21..113e059f3f93e4 100644 --- a/packages/react-components/react-message-bar/library/package.json +++ b/packages/react-components/react-message-bar/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-message-bar", "version": "9.7.4", "description": "Fluent UI MessageBar component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -32,10 +32,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -48,7 +52,9 @@ "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-migration-v0-v9/library/.swcrc b/packages/react-components/react-migration-v0-v9/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-migration-v0-v9/library/.swcrc +++ b/packages/react-components/react-migration-v0-v9/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-migration-v0-v9/library/config/tests.js b/packages/react-components/react-migration-v0-v9/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-migration-v0-v9/library/config/tests.js rename to packages/react-components/react-migration-v0-v9/library/config/tests.cjs diff --git a/packages/react-components/react-migration-v0-v9/library/eslint.config.js b/packages/react-components/react-migration-v0-v9/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-migration-v0-v9/library/eslint.config.js rename to packages/react-components/react-migration-v0-v9/library/eslint.config.cjs diff --git a/packages/react-components/react-migration-v0-v9/library/jest.config.js b/packages/react-components/react-migration-v0-v9/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-migration-v0-v9/library/jest.config.js rename to packages/react-components/react-migration-v0-v9/library/jest.config.cjs index 3a6e9af089f374..b3a9ec4841d35f 100644 --- a/packages/react-components/react-migration-v0-v9/library/jest.config.js +++ b/packages/react-components/react-migration-v0-v9/library/jest.config.cjs @@ -32,6 +32,6 @@ module.exports = { // https://stackoverflow.com/a/75857711 workerIdleMemoryLimit: '1024MB', coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-migration-v0-v9/library/package.json b/packages/react-components/react-migration-v0-v9/library/package.json index 9d3599b73d0470..236e383551af3e 100644 --- a/packages/react-components/react-migration-v0-v9/library/package.json +++ b/packages/react-components/react-migration-v0-v9/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-migration-v0-v9", "version": "9.6.34", "description": "Migration shim components and methods for hybrid v0/v9 applications building on Fluent UI React.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -39,17 +39,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-migration-v8-v9/library/.swcrc b/packages/react-components/react-migration-v8-v9/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-migration-v8-v9/library/.swcrc +++ b/packages/react-components/react-migration-v8-v9/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-migration-v8-v9/library/config/tests.js b/packages/react-components/react-migration-v8-v9/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-migration-v8-v9/library/config/tests.js rename to packages/react-components/react-migration-v8-v9/library/config/tests.cjs diff --git a/packages/react-components/react-migration-v8-v9/library/eslint.config.js b/packages/react-components/react-migration-v8-v9/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-migration-v8-v9/library/eslint.config.js rename to packages/react-components/react-migration-v8-v9/library/eslint.config.cjs diff --git a/packages/react-components/react-migration-v8-v9/library/jest.config.js b/packages/react-components/react-migration-v8-v9/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-migration-v8-v9/library/jest.config.js rename to packages/react-components/react-migration-v8-v9/library/jest.config.cjs index 8f4369d2c78a4c..be3de1876d952e 100644 --- a/packages/react-components/react-migration-v8-v9/library/jest.config.js +++ b/packages/react-components/react-migration-v8-v9/library/jest.config.cjs @@ -32,6 +32,6 @@ module.exports = { // https://stackoverflow.com/a/75857711 workerIdleMemoryLimit: '1024MB', coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-migration-v8-v9/library/package.json b/packages/react-components/react-migration-v8-v9/library/package.json index dd54ac2bca286a..2b06dc5a31af61 100644 --- a/packages/react-components/react-migration-v8-v9/library/package.json +++ b/packages/react-components/react-migration-v8-v9/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-migration-v8-v9", "version": "9.10.16", "description": "Migration shim components and methods for hybrid v8/v9 applications building on Fluent UI React.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -34,17 +34,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-motion-components-preview/library/.swcrc b/packages/react-components/react-motion-components-preview/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-motion-components-preview/library/.swcrc +++ b/packages/react-components/react-motion-components-preview/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-motion-components-preview/library/config/tests.js b/packages/react-components/react-motion-components-preview/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-motion-components-preview/library/config/tests.js rename to packages/react-components/react-motion-components-preview/library/config/tests.cjs diff --git a/packages/react-components/react-motion-components-preview/library/eslint.config.js b/packages/react-components/react-motion-components-preview/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-motion-components-preview/library/eslint.config.js rename to packages/react-components/react-motion-components-preview/library/eslint.config.cjs diff --git a/packages/react-components/react-motion-components-preview/library/jest.config.js b/packages/react-components/react-motion-components-preview/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-motion-components-preview/library/jest.config.js rename to packages/react-components/react-motion-components-preview/library/jest.config.cjs index 4b0d5f8d848f16..8122b136dd6eb8 100644 --- a/packages/react-components/react-motion-components-preview/library/jest.config.js +++ b/packages/react-components/react-motion-components-preview/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-motion-components-preview/library/package.json b/packages/react-components/react-motion-components-preview/library/package.json index c006c30ce39c6c..292a7d11de1953 100644 --- a/packages/react-components/react-motion-components-preview/library/package.json +++ b/packages/react-components/react-motion-components-preview/library/package.json @@ -2,13 +2,14 @@ "name": "@fluentui/react-motion-components-preview", "version": "0.15.6", "description": "A preview package for Fluent UI motion components, providing a collection of components", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -30,10 +31,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -42,5 +47,6 @@ "major", "prerelease" ] - } + }, + "type": "module" } diff --git a/packages/react-components/react-motion/library/.swcrc b/packages/react-components/react-motion/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-motion/library/.swcrc +++ b/packages/react-components/react-motion/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-motion/library/config/tests.js b/packages/react-components/react-motion/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-motion/library/config/tests.js rename to packages/react-components/react-motion/library/config/tests.cjs diff --git a/packages/react-components/react-motion/library/eslint.config.js b/packages/react-components/react-motion/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-motion/library/eslint.config.js rename to packages/react-components/react-motion/library/eslint.config.cjs diff --git a/packages/react-components/react-motion/library/jest.config.js b/packages/react-components/react-motion/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-motion/library/jest.config.js rename to packages/react-components/react-motion/library/jest.config.cjs index 5a71c159afce69..27caaa5a4da0e8 100644 --- a/packages/react-components/react-motion/library/jest.config.js +++ b/packages/react-components/react-motion/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-motion/library/package.json b/packages/react-components/react-motion/library/package.json index 5eaafab59d2362..1dafc07f9440bd 100644 --- a/packages/react-components/react-motion/library/package.json +++ b/packages/react-components/react-motion/library/package.json @@ -2,13 +2,14 @@ "name": "@fluentui/react-motion", "version": "9.16.1", "description": "A package with utilities & motion definitions using Web Animations API", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" ], @@ -30,10 +31,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -42,5 +47,6 @@ "major", "prerelease" ] - } + }, + "type": "module" } diff --git a/packages/react-components/react-nav/library/.swcrc b/packages/react-components/react-nav/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-nav/library/.swcrc +++ b/packages/react-components/react-nav/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-nav/library/config/tests.js b/packages/react-components/react-nav/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-nav/library/config/tests.js rename to packages/react-components/react-nav/library/config/tests.cjs diff --git a/packages/react-components/react-nav/library/eslint.config.js b/packages/react-components/react-nav/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-nav/library/eslint.config.js rename to packages/react-components/react-nav/library/eslint.config.cjs diff --git a/packages/react-components/react-nav/library/jest.config.js b/packages/react-components/react-nav/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-nav/library/jest.config.js rename to packages/react-components/react-nav/library/jest.config.cjs index 2732be85a0c0e9..2b038e7bf6b4ab 100644 --- a/packages/react-components/react-nav/library/jest.config.js +++ b/packages/react-components/react-nav/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-nav/library/package.json b/packages/react-components/react-nav/library/package.json index 7fff819dcd1661..b3cca4d54384a6 100644 --- a/packages/react-components/react-nav/library/package.json +++ b/packages/react-components/react-nav/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-nav", "version": "9.4.3", "description": "New fluentui react package", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -37,10 +37,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -53,7 +57,9 @@ "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-overflow/library/.swcrc b/packages/react-components/react-overflow/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-overflow/library/.swcrc +++ b/packages/react-components/react-overflow/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-overflow/library/config/tests.js b/packages/react-components/react-overflow/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-overflow/library/config/tests.js rename to packages/react-components/react-overflow/library/config/tests.cjs diff --git a/packages/react-components/react-overflow/library/eslint.config.js b/packages/react-components/react-overflow/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-overflow/library/eslint.config.js rename to packages/react-components/react-overflow/library/eslint.config.cjs diff --git a/packages/react-components/react-overflow/library/jest.config.js b/packages/react-components/react-overflow/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-overflow/library/jest.config.js rename to packages/react-components/react-overflow/library/jest.config.cjs index 2993091e84b413..050be1e7aae9bf 100644 --- a/packages/react-components/react-overflow/library/jest.config.js +++ b/packages/react-components/react-overflow/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-overflow/library/package.json b/packages/react-components/react-overflow/library/package.json index 1073d0b00bab4f..075c31aea5f96d 100644 --- a/packages/react-components/react-overflow/library/package.json +++ b/packages/react-components/react-overflow/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-overflow", "version": "9.9.1", "description": "React bindings for @fluentui/priority-overflow", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -33,17 +33,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-persona/library/.swcrc b/packages/react-components/react-persona/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-persona/library/.swcrc +++ b/packages/react-components/react-persona/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-persona/library/config/tests.js b/packages/react-components/react-persona/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-persona/library/config/tests.js rename to packages/react-components/react-persona/library/config/tests.cjs diff --git a/packages/react-components/react-persona/library/eslint.config.js b/packages/react-components/react-persona/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-persona/library/eslint.config.js rename to packages/react-components/react-persona/library/eslint.config.cjs diff --git a/packages/react-components/react-persona/library/jest.config.js b/packages/react-components/react-persona/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-persona/library/jest.config.js rename to packages/react-components/react-persona/library/jest.config.cjs index bad8ac27c7cbe4..914c9ca780c18f 100644 --- a/packages/react-components/react-persona/library/jest.config.js +++ b/packages/react-components/react-persona/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-persona/library/package.json b/packages/react-components/react-persona/library/package.json index e38f9e614d5eb9..dc1569542a7612 100644 --- a/packages/react-components/react-persona/library/package.json +++ b/packages/react-components/react-persona/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-persona", "version": "9.7.6", "description": "React components for building web experiences", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -35,17 +35,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-popover/library/.swcrc b/packages/react-components/react-popover/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-popover/library/.swcrc +++ b/packages/react-components/react-popover/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-popover/library/config/tests.js b/packages/react-components/react-popover/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-popover/library/config/tests.js rename to packages/react-components/react-popover/library/config/tests.cjs diff --git a/packages/react-components/react-popover/library/eslint.config.js b/packages/react-components/react-popover/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-popover/library/eslint.config.js rename to packages/react-components/react-popover/library/eslint.config.cjs diff --git a/packages/react-components/react-popover/library/jest.config.js b/packages/react-components/react-popover/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-popover/library/jest.config.js rename to packages/react-components/react-popover/library/jest.config.cjs index ae5ce8aeee59a9..c8f3e7daa8e75c 100644 --- a/packages/react-components/react-popover/library/jest.config.js +++ b/packages/react-components/react-popover/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-popover/library/package.json b/packages/react-components/react-popover/library/package.json index 2de6206c0fe30c..94e9d9fe5c6c86 100644 --- a/packages/react-components/react-popover/library/package.json +++ b/packages/react-components/react-popover/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-popover", "version": "9.14.5", "description": "Popover component for Fluent UI", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -41,17 +41,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-portal-compat-context/.swcrc b/packages/react-components/react-portal-compat-context/.swcrc index d63668e8c987ee..6fc76ab5e07eb0 100644 --- a/packages/react-components/react-portal-compat-context/.swcrc +++ b/packages/react-components/react-portal-compat-context/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-portal-compat-context/config/tests.js b/packages/react-components/react-portal-compat-context/config/tests.cjs similarity index 100% rename from packages/react-components/react-portal-compat-context/config/tests.js rename to packages/react-components/react-portal-compat-context/config/tests.cjs diff --git a/packages/react-components/react-portal-compat-context/eslint.config.js b/packages/react-components/react-portal-compat-context/eslint.config.cjs similarity index 100% rename from packages/react-components/react-portal-compat-context/eslint.config.js rename to packages/react-components/react-portal-compat-context/eslint.config.cjs diff --git a/packages/react-components/react-portal-compat-context/jest.config.js b/packages/react-components/react-portal-compat-context/jest.config.cjs similarity index 96% rename from packages/react-components/react-portal-compat-context/jest.config.js rename to packages/react-components/react-portal-compat-context/jest.config.cjs index 51ee0af9b27e68..de5b8f2114d5a8 100644 --- a/packages/react-components/react-portal-compat-context/jest.config.js +++ b/packages/react-components/react-portal-compat-context/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/react-portal-compat-context/package.json b/packages/react-components/react-portal-compat-context/package.json index b7304856560378..1c5d8de54f9ebc 100644 --- a/packages/react-components/react-portal-compat-context/package.json +++ b/packages/react-components/react-portal-compat-context/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-portal-compat-context", "version": "9.0.15", "description": "A package that holds React context for compatibility of React Contexts", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -26,18 +26,24 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-amd", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-portal-compat/.swcrc b/packages/react-components/react-portal-compat/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-portal-compat/.swcrc +++ b/packages/react-components/react-portal-compat/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-portal-compat/config/tests.js b/packages/react-components/react-portal-compat/config/tests.cjs similarity index 100% rename from packages/react-components/react-portal-compat/config/tests.js rename to packages/react-components/react-portal-compat/config/tests.cjs diff --git a/packages/react-components/react-portal-compat/eslint.config.js b/packages/react-components/react-portal-compat/eslint.config.cjs similarity index 100% rename from packages/react-components/react-portal-compat/eslint.config.js rename to packages/react-components/react-portal-compat/eslint.config.cjs diff --git a/packages/react-components/react-portal-compat/jest.config.js b/packages/react-components/react-portal-compat/jest.config.cjs similarity index 96% rename from packages/react-components/react-portal-compat/jest.config.js rename to packages/react-components/react-portal-compat/jest.config.cjs index c609a27cf8344a..8c4f6839c63612 100644 --- a/packages/react-components/react-portal-compat/jest.config.js +++ b/packages/react-components/react-portal-compat/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/react-portal-compat/package.json b/packages/react-components/react-portal-compat/package.json index 958404463a7124..99c3d4036cdb44 100644 --- a/packages/react-components/react-portal-compat/package.json +++ b/packages/react-components/react-portal-compat/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-portal-compat", "version": "9.2.44", "description": "A package that contains compatibility layer for React Portals", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -29,18 +29,24 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-amd", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-portal/library/.swcrc b/packages/react-components/react-portal/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-portal/library/.swcrc +++ b/packages/react-components/react-portal/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-portal/library/config/tests.js b/packages/react-components/react-portal/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-portal/library/config/tests.js rename to packages/react-components/react-portal/library/config/tests.cjs diff --git a/packages/react-components/react-portal/library/eslint.config.js b/packages/react-components/react-portal/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-portal/library/eslint.config.js rename to packages/react-components/react-portal/library/eslint.config.cjs diff --git a/packages/react-components/react-portal/library/jest.config.js b/packages/react-components/react-portal/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-portal/library/jest.config.js rename to packages/react-components/react-portal/library/jest.config.cjs index 955789b7724bb0..08a95b38ab1f03 100644 --- a/packages/react-components/react-portal/library/jest.config.js +++ b/packages/react-components/react-portal/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-portal/library/package.json b/packages/react-components/react-portal/library/package.json index 570f76580f8c84..7ca09da25446b8 100644 --- a/packages/react-components/react-portal/library/package.json +++ b/packages/react-components/react-portal/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-portal", "version": "9.8.14", "description": "A utility component that creates portals compatible with Fluent UI", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -32,17 +32,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-positioning/library/.swcrc b/packages/react-components/react-positioning/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-positioning/library/.swcrc +++ b/packages/react-components/react-positioning/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-positioning/library/config/tests.js b/packages/react-components/react-positioning/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-positioning/library/config/tests.js rename to packages/react-components/react-positioning/library/config/tests.cjs diff --git a/packages/react-components/react-positioning/library/eslint.config.js b/packages/react-components/react-positioning/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-positioning/library/eslint.config.js rename to packages/react-components/react-positioning/library/eslint.config.cjs diff --git a/packages/react-components/react-positioning/library/jest.config.js b/packages/react-components/react-positioning/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-positioning/library/jest.config.js rename to packages/react-components/react-positioning/library/jest.config.cjs index 049161bc2b8dd5..3d2835110af22f 100644 --- a/packages/react-components/react-positioning/library/jest.config.js +++ b/packages/react-components/react-positioning/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-positioning/library/package.json b/packages/react-components/react-positioning/library/package.json index 4081a7b6c09a55..68c6f12bbbaf5c 100644 --- a/packages/react-components/react-positioning/library/package.json +++ b/packages/react-components/react-positioning/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-positioning", "version": "9.23.0", "description": "A react wrapper around Popper.js for Fluent UI", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -34,17 +34,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-progress/library/.swcrc b/packages/react-components/react-progress/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-progress/library/.swcrc +++ b/packages/react-components/react-progress/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-progress/library/config/tests.js b/packages/react-components/react-progress/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-progress/library/config/tests.js rename to packages/react-components/react-progress/library/config/tests.cjs diff --git a/packages/react-components/react-progress/library/eslint.config.js b/packages/react-components/react-progress/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-progress/library/eslint.config.js rename to packages/react-components/react-progress/library/eslint.config.cjs diff --git a/packages/react-components/react-progress/library/jest.config.js b/packages/react-components/react-progress/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-progress/library/jest.config.js rename to packages/react-components/react-progress/library/jest.config.cjs index a64b452928202e..09c17c55d69acd 100644 --- a/packages/react-components/react-progress/library/jest.config.js +++ b/packages/react-components/react-progress/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-progress/library/package.json b/packages/react-components/react-progress/library/package.json index b97f6c5460fad1..7d3a2f675ec964 100644 --- a/packages/react-components/react-progress/library/package.json +++ b/packages/react-components/react-progress/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-progress", "version": "9.5.3", "description": "Progress component for FluentUI v9", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -35,17 +35,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-provider/library/.swcrc b/packages/react-components/react-provider/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-provider/library/.swcrc +++ b/packages/react-components/react-provider/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-provider/library/config/tests.js b/packages/react-components/react-provider/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-provider/library/config/tests.js rename to packages/react-components/react-provider/library/config/tests.cjs diff --git a/packages/react-components/react-provider/library/eslint.config.js b/packages/react-components/react-provider/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-provider/library/eslint.config.js rename to packages/react-components/react-provider/library/eslint.config.cjs diff --git a/packages/react-components/react-provider/library/jest.config.js b/packages/react-components/react-provider/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-provider/library/jest.config.js rename to packages/react-components/react-provider/library/jest.config.cjs index d087946492e97d..fbb3a82ea5d683 100644 --- a/packages/react-components/react-provider/library/jest.config.js +++ b/packages/react-components/react-provider/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-provider/library/package.json b/packages/react-components/react-provider/library/package.json index 5f69f348d2ce58..179292bc331f38 100644 --- a/packages/react-components/react-provider/library/package.json +++ b/packages/react-components/react-provider/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-provider", "version": "9.22.19", "description": "Fluent UI React provider component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -36,17 +36,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-provider/library/rit.config.js b/packages/react-components/react-provider/library/rit.config.cjs similarity index 100% rename from packages/react-components/react-provider/library/rit.config.js rename to packages/react-components/react-provider/library/rit.config.cjs diff --git a/packages/react-components/react-radio/library/.swcrc b/packages/react-components/react-radio/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-radio/library/.swcrc +++ b/packages/react-components/react-radio/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-radio/library/config/tests.js b/packages/react-components/react-radio/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-radio/library/config/tests.js rename to packages/react-components/react-radio/library/config/tests.cjs diff --git a/packages/react-components/react-radio/library/eslint.config.js b/packages/react-components/react-radio/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-radio/library/eslint.config.js rename to packages/react-components/react-radio/library/eslint.config.cjs diff --git a/packages/react-components/react-radio/library/jest.config.js b/packages/react-components/react-radio/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-radio/library/jest.config.js rename to packages/react-components/react-radio/library/jest.config.cjs index 83a890baad907e..05f7f74c73f78c 100644 --- a/packages/react-components/react-radio/library/jest.config.js +++ b/packages/react-components/react-radio/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-radio/library/package.json b/packages/react-components/react-radio/library/package.json index 6fe758af51b453..2daa49969e3d5b 100644 --- a/packages/react-components/react-radio/library/package.json +++ b/packages/react-components/react-radio/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-radio", "version": "9.6.4", "description": "Fluent UI Radio component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -36,17 +36,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-rating/library/.swcrc b/packages/react-components/react-rating/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-rating/library/.swcrc +++ b/packages/react-components/react-rating/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-rating/library/config/tests.js b/packages/react-components/react-rating/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-rating/library/config/tests.js rename to packages/react-components/react-rating/library/config/tests.cjs diff --git a/packages/react-components/react-rating/library/eslint.config.js b/packages/react-components/react-rating/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-rating/library/eslint.config.js rename to packages/react-components/react-rating/library/eslint.config.cjs diff --git a/packages/react-components/react-rating/library/jest.config.js b/packages/react-components/react-rating/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-rating/library/jest.config.js rename to packages/react-components/react-rating/library/jest.config.cjs index 15bd961b60bd06..96284a46d192c3 100644 --- a/packages/react-components/react-rating/library/jest.config.js +++ b/packages/react-components/react-rating/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-rating/library/package.json b/packages/react-components/react-rating/library/package.json index f3c507154d78da..fe92a328e8d66b 100644 --- a/packages/react-components/react-rating/library/package.json +++ b/packages/react-components/react-rating/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-rating", "version": "9.4.3", "description": "Rating component for building web experiences", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -29,10 +29,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -45,7 +49,9 @@ "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-search/library/.swcrc b/packages/react-components/react-search/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-search/library/.swcrc +++ b/packages/react-components/react-search/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-search/library/config/tests.js b/packages/react-components/react-search/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-search/library/config/tests.js rename to packages/react-components/react-search/library/config/tests.cjs diff --git a/packages/react-components/react-search/library/eslint.config.js b/packages/react-components/react-search/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-search/library/eslint.config.js rename to packages/react-components/react-search/library/eslint.config.cjs diff --git a/packages/react-components/react-search/library/jest.config.js b/packages/react-components/react-search/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-search/library/jest.config.js rename to packages/react-components/react-search/library/jest.config.cjs index 2a7c6ccd16fbca..6ab0b28da4c42c 100644 --- a/packages/react-components/react-search/library/jest.config.js +++ b/packages/react-components/react-search/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-search/library/package.json b/packages/react-components/react-search/library/package.json index b5ce543833db44..44730eb8c37684 100644 --- a/packages/react-components/react-search/library/package.json +++ b/packages/react-components/react-search/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-search", "version": "9.4.5", "description": "Search input for Fluent UI v9", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -35,17 +35,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-select/library/.swcrc b/packages/react-components/react-select/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-select/library/.swcrc +++ b/packages/react-components/react-select/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-select/library/config/tests.js b/packages/react-components/react-select/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-select/library/config/tests.js rename to packages/react-components/react-select/library/config/tests.cjs diff --git a/packages/react-components/react-select/library/eslint.config.js b/packages/react-components/react-select/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-select/library/eslint.config.js rename to packages/react-components/react-select/library/eslint.config.cjs diff --git a/packages/react-components/react-select/library/jest.config.js b/packages/react-components/react-select/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-select/library/jest.config.js rename to packages/react-components/react-select/library/jest.config.cjs index 33e62cbe01e3a2..ac0992306c1206 100644 --- a/packages/react-components/react-select/library/jest.config.js +++ b/packages/react-components/react-select/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-select/library/package.json b/packages/react-components/react-select/library/package.json index ae383d26df1002..ef45fed53b360f 100644 --- a/packages/react-components/react-select/library/package.json +++ b/packages/react-components/react-select/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-select", "version": "9.5.4", "description": "Fluent UI React Select component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -35,17 +35,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-shared-contexts/library/.swcrc b/packages/react-components/react-shared-contexts/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-shared-contexts/library/.swcrc +++ b/packages/react-components/react-shared-contexts/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-shared-contexts/library/config/tests.js b/packages/react-components/react-shared-contexts/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-shared-contexts/library/config/tests.js rename to packages/react-components/react-shared-contexts/library/config/tests.cjs diff --git a/packages/react-components/react-shared-contexts/library/eslint.config.js b/packages/react-components/react-shared-contexts/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-shared-contexts/library/eslint.config.js rename to packages/react-components/react-shared-contexts/library/eslint.config.cjs diff --git a/packages/react-components/react-shared-contexts/library/jest.config.js b/packages/react-components/react-shared-contexts/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-shared-contexts/library/jest.config.js rename to packages/react-components/react-shared-contexts/library/jest.config.cjs index 62d67b6efdbd6d..7243f54db4b316 100644 --- a/packages/react-components/react-shared-contexts/library/jest.config.js +++ b/packages/react-components/react-shared-contexts/library/jest.config.cjs @@ -29,5 +29,5 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], }; diff --git a/packages/react-components/react-shared-contexts/library/package.json b/packages/react-components/react-shared-contexts/library/package.json index 818576247a6411..88c8c9026d522a 100644 --- a/packages/react-components/react-shared-contexts/library/package.json +++ b/packages/react-components/react-shared-contexts/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-shared-contexts", "version": "9.26.2", "description": "Fluent UI React Contexts shared by multiple components.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -27,17 +27,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-skeleton/library/.swcrc b/packages/react-components/react-skeleton/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-skeleton/library/.swcrc +++ b/packages/react-components/react-skeleton/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-skeleton/library/config/tests.js b/packages/react-components/react-skeleton/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-skeleton/library/config/tests.js rename to packages/react-components/react-skeleton/library/config/tests.cjs diff --git a/packages/react-components/react-skeleton/library/eslint.config.js b/packages/react-components/react-skeleton/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-skeleton/library/eslint.config.js rename to packages/react-components/react-skeleton/library/eslint.config.cjs diff --git a/packages/react-components/react-skeleton/library/jest.config.js b/packages/react-components/react-skeleton/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-skeleton/library/jest.config.js rename to packages/react-components/react-skeleton/library/jest.config.cjs index a97165fc65d46d..1548e89ec55fe5 100644 --- a/packages/react-components/react-skeleton/library/jest.config.js +++ b/packages/react-components/react-skeleton/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-skeleton/library/package.json b/packages/react-components/react-skeleton/library/package.json index 3e7c1218f37e72..b9e20d84b26c89 100644 --- a/packages/react-components/react-skeleton/library/package.json +++ b/packages/react-components/react-skeleton/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-skeleton", "version": "9.7.4", "description": "Converged v9 Skeleton Component", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -34,17 +34,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-slider/library/.swcrc b/packages/react-components/react-slider/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-slider/library/.swcrc +++ b/packages/react-components/react-slider/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-slider/library/config/tests.js b/packages/react-components/react-slider/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-slider/library/config/tests.js rename to packages/react-components/react-slider/library/config/tests.cjs diff --git a/packages/react-components/react-slider/library/eslint.config.js b/packages/react-components/react-slider/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-slider/library/eslint.config.js rename to packages/react-components/react-slider/library/eslint.config.cjs diff --git a/packages/react-components/react-slider/library/jest.config.js b/packages/react-components/react-slider/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-slider/library/jest.config.js rename to packages/react-components/react-slider/library/jest.config.cjs index c33f57566a1f50..e1162996ee7662 100644 --- a/packages/react-components/react-slider/library/jest.config.js +++ b/packages/react-components/react-slider/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-slider/library/package.json b/packages/react-components/react-slider/library/package.json index 6b72017d87e924..48fd35280d1799 100644 --- a/packages/react-components/react-slider/library/package.json +++ b/packages/react-components/react-slider/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-slider", "version": "9.6.4", "description": "Fluent UI React Slider component.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -35,17 +35,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-spinbutton/library/.swcrc b/packages/react-components/react-spinbutton/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-spinbutton/library/.swcrc +++ b/packages/react-components/react-spinbutton/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-spinbutton/library/config/tests.js b/packages/react-components/react-spinbutton/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-spinbutton/library/config/tests.js rename to packages/react-components/react-spinbutton/library/config/tests.cjs diff --git a/packages/react-components/react-spinbutton/library/eslint.config.js b/packages/react-components/react-spinbutton/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-spinbutton/library/eslint.config.js rename to packages/react-components/react-spinbutton/library/eslint.config.cjs diff --git a/packages/react-components/react-spinbutton/library/jest.config.js b/packages/react-components/react-spinbutton/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-spinbutton/library/jest.config.js rename to packages/react-components/react-spinbutton/library/jest.config.cjs index 3e6c92c01b8e6d..b97bfe6cd5d907 100644 --- a/packages/react-components/react-spinbutton/library/jest.config.js +++ b/packages/react-components/react-spinbutton/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-spinbutton/library/package.json b/packages/react-components/react-spinbutton/library/package.json index d43b6d7471e3e6..650603ac82979a 100644 --- a/packages/react-components/react-spinbutton/library/package.json +++ b/packages/react-components/react-spinbutton/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-spinbutton", "version": "9.6.4", "description": "Fluent UI React SpinButton component.", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -36,17 +36,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-spinner/library/.swcrc b/packages/react-components/react-spinner/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-spinner/library/.swcrc +++ b/packages/react-components/react-spinner/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-spinner/library/config/tests.js b/packages/react-components/react-spinner/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-spinner/library/config/tests.js rename to packages/react-components/react-spinner/library/config/tests.cjs diff --git a/packages/react-components/react-spinner/library/eslint.config.js b/packages/react-components/react-spinner/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-spinner/library/eslint.config.js rename to packages/react-components/react-spinner/library/eslint.config.cjs diff --git a/packages/react-components/react-spinner/library/jest.config.js b/packages/react-components/react-spinner/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-spinner/library/jest.config.js rename to packages/react-components/react-spinner/library/jest.config.cjs index 0f871616c785f6..fd2cc64741c824 100644 --- a/packages/react-components/react-spinner/library/jest.config.js +++ b/packages/react-components/react-spinner/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-spinner/library/package.json b/packages/react-components/react-spinner/library/package.json index ad49038f5c2737..e1dd9f34def42e 100644 --- a/packages/react-components/react-spinner/library/package.json +++ b/packages/react-components/react-spinner/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-spinner", "version": "9.8.4", "description": "Spinner component for Fluent UI React", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -34,17 +34,23 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-storybook-addon-export-to-sandbox/.swcrc b/packages/react-components/react-storybook-addon-export-to-sandbox/.swcrc index 60a8beae823005..ec92c5ba665f63 100644 --- a/packages/react-components/react-storybook-addon-export-to-sandbox/.swcrc +++ b/packages/react-components/react-storybook-addon-export-to-sandbox/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-storybook-addon-export-to-sandbox/package.json b/packages/react-components/react-storybook-addon-export-to-sandbox/package.json index c1f3626cf7a9e1..a718d22c9989e5 100644 --- a/packages/react-components/react-storybook-addon-export-to-sandbox/package.json +++ b/packages/react-components/react-storybook-addon-export-to-sandbox/package.json @@ -29,8 +29,11 @@ "exports": { ".": { "types": "./dist/index.d.ts", + "node": { + "module": "./lib/index.js", + "default": "./lib-commonjs/index.js" + }, "import": "./lib/index.js", - "node": "./lib-commonjs/index.js", "require": "./lib-commonjs/index.js" }, "./preset": "./preset.js", diff --git a/packages/react-components/react-storybook-addon/.swcrc b/packages/react-components/react-storybook-addon/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-storybook-addon/.swcrc +++ b/packages/react-components/react-storybook-addon/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-storybook-addon/package.json b/packages/react-components/react-storybook-addon/package.json index baf28d78b1f488..23c5a33f30fc32 100644 --- a/packages/react-components/react-storybook-addon/package.json +++ b/packages/react-components/react-storybook-addon/package.json @@ -47,7 +47,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", + "node": { + "module": "./lib/index.js", + "default": "./lib-commonjs/index.js" + }, "import": "./lib/index.js", "require": "./lib-commonjs/index.js" }, diff --git a/packages/react-components/react-swatch-picker/library/.swcrc b/packages/react-components/react-swatch-picker/library/.swcrc index b4ffa86dee3067..a5d9d62d2f9c8f 100644 --- a/packages/react-components/react-swatch-picker/library/.swcrc +++ b/packages/react-components/react-swatch-picker/library/.swcrc @@ -10,6 +10,7 @@ "/**/*.test.tsx" ], "jsc": { + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/react-components/react-swatch-picker/library/config/tests.js b/packages/react-components/react-swatch-picker/library/config/tests.cjs similarity index 100% rename from packages/react-components/react-swatch-picker/library/config/tests.js rename to packages/react-components/react-swatch-picker/library/config/tests.cjs diff --git a/packages/react-components/react-swatch-picker/library/eslint.config.js b/packages/react-components/react-swatch-picker/library/eslint.config.cjs similarity index 100% rename from packages/react-components/react-swatch-picker/library/eslint.config.js rename to packages/react-components/react-swatch-picker/library/eslint.config.cjs diff --git a/packages/react-components/react-swatch-picker/library/jest.config.js b/packages/react-components/react-swatch-picker/library/jest.config.cjs similarity index 96% rename from packages/react-components/react-swatch-picker/library/jest.config.js rename to packages/react-components/react-swatch-picker/library/jest.config.cjs index 0e90729c7be2e4..b354fe864dfea9 100644 --- a/packages/react-components/react-swatch-picker/library/jest.config.js +++ b/packages/react-components/react-swatch-picker/library/jest.config.cjs @@ -29,6 +29,6 @@ module.exports = { '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], }, coverageDirectory: './coverage', - setupFilesAfterEnv: ['./config/tests.js'], + setupFilesAfterEnv: ['./config/tests.cjs'], snapshotSerializers: ['@griffel/jest-serializer'], }; diff --git a/packages/react-components/react-swatch-picker/library/package.json b/packages/react-components/react-swatch-picker/library/package.json index 56ff4a06819a43..260b7beb56bbef 100644 --- a/packages/react-components/react-swatch-picker/library/package.json +++ b/packages/react-components/react-swatch-picker/library/package.json @@ -2,7 +2,7 @@ "name": "@fluentui/react-swatch-picker", "version": "9.5.4", "description": "New fluentui react package", - "main": "lib-commonjs/index.js", + "main": "lib-commonjs/index.cjs", "module": "lib/index.js", "typings": "./dist/index.d.ts", "sideEffects": false, @@ -31,10 +31,14 @@ }, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./lib-commonjs/index.js", - "import": "./lib/index.js", - "require": "./lib-commonjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./lib-commonjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -47,7 +51,9 @@ "files": [ "*.md", "dist/*.d.ts", + "dist/*.d.cts", "lib", "lib-commonjs" - ] + ], + "type": "module" } diff --git a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/ColorSwatch.constants.ts b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/ColorSwatch.constants.ts new file mode 100644 index 00000000000000..5e335a0e6c74c3 --- /dev/null +++ b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/ColorSwatch.constants.ts @@ -0,0 +1,4 @@ +export const swatchCSSVars = { + color: `--fui-SwatchPicker--color`, + borderColor: `--fui-SwatchPicker--borderColor`, +}; diff --git a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/ColorSwatch.test.tsx b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/ColorSwatch.test.tsx index 9fea02586d0d71..c3a9ec1981579c 100644 --- a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/ColorSwatch.test.tsx +++ b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/ColorSwatch.test.tsx @@ -29,7 +29,7 @@ describe('ColorSwatch', () => { aria-checked="false" class="fui-ColorSwatch" role="radio" - style="--fui-SwatchPicker--color: #f09; --fui-SwatchPicker--borderColor: var(--colorTransparentStroke);" + style="--fui-SwatchPicker--color: #f09;" type="button" />
diff --git a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/index.ts b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/index.ts index a9a4b2398b42d0..edf43dc0d582f3 100644 --- a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/index.ts +++ b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/index.ts @@ -8,4 +8,5 @@ export type { } from './ColorSwatch.types'; export { renderColorSwatch_unstable } from './renderColorSwatch'; export { useColorSwatch_unstable, useColorSwatchBase_unstable } from './useColorSwatch'; -export { colorSwatchClassNames, swatchCSSVars, useColorSwatchStyles_unstable } from './useColorSwatchStyles.styles'; +export { colorSwatchClassNames, useColorSwatchStyles_unstable } from './useColorSwatchStyles.styles'; +export { swatchCSSVars } from './ColorSwatch.constants'; diff --git a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/useColorSwatch.tsx b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/useColorSwatch.tsx index 1eb0a19b74b55c..e849e245279e7d 100644 --- a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/useColorSwatch.tsx +++ b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/useColorSwatch.tsx @@ -9,9 +9,8 @@ import type { ColorSwatchState, } from './ColorSwatch.types'; import { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker'; -import { swatchCSSVars } from './useColorSwatchStyles.styles'; import { ProhibitedFilled } from '@fluentui/react-icons'; -import { tokens } from '@fluentui/react-theme'; +import { swatchCSSVars } from './ColorSwatch.constants'; /** * Create the basee state required to render unstyled ColorSwatch. @@ -42,7 +41,7 @@ export const useColorSwatchBase_unstable = ( const rootVariables = { [swatchCSSVars.color]: color, - [swatchCSSVars.borderColor]: borderColor ?? tokens.colorTransparentStroke, + [swatchCSSVars.borderColor]: borderColor, }; const role = isGrid ? 'gridcell' : 'radio'; diff --git a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/useColorSwatchStyles.styles.ts b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/useColorSwatchStyles.styles.ts index ec52e49fa49840..b8ba205296fd67 100644 --- a/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/useColorSwatchStyles.styles.ts +++ b/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/useColorSwatchStyles.styles.ts @@ -5,6 +5,7 @@ import type { SlotClassNames } from '@fluentui/react-utilities'; import type { ColorSwatchSlots, ColorSwatchState } from './ColorSwatch.types'; import { tokens } from '@fluentui/react-theme'; import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster'; +import { swatchCSSVars } from './ColorSwatch.constants'; export const colorSwatchClassNames: SlotClassNames = { root: 'fui-ColorSwatch', @@ -12,11 +13,6 @@ export const colorSwatchClassNames: SlotClassNames = { disabledIcon: 'fui-ColorSwatch__disabledIcon', }; -export const swatchCSSVars = { - color: `--fui-SwatchPicker--color`, - borderColor: `--fui-SwatchPicker--borderColor`, -}; - const { color, borderColor } = swatchCSSVars; /** @@ -28,7 +24,7 @@ const useResetStyles = makeResetStyles({ alignItems: 'center', justifyContent: 'center', boxSizing: 'border-box', - border: `1px solid var(${borderColor})`, + border: `1px solid var(${borderColor}, ${tokens.colorTransparentStroke})`, background: `var(${color})`, overflow: 'hidden', padding: '0', diff --git a/packages/react-components/react-swatch-picker/library/src/components/SwatchPicker/SwatchPicker.test.tsx b/packages/react-components/react-swatch-picker/library/src/components/SwatchPicker/SwatchPicker.test.tsx index 7885c0573c9d7c..eeb7684c162156 100644 --- a/packages/react-components/react-swatch-picker/library/src/components/SwatchPicker/SwatchPicker.test.tsx +++ b/packages/react-components/react-swatch-picker/library/src/components/SwatchPicker/SwatchPicker.test.tsx @@ -32,7 +32,7 @@ describe('SwatchPicker', () => { aria-checked="false" class="fui-ColorSwatch" role="radio" - style="--fui-SwatchPicker--color: #f09; --fui-SwatchPicker--borderColor: var(--colorTransparentStroke);" + style="--fui-SwatchPicker--color: #f09;" type="button" />
@@ -46,7 +46,7 @@ exports[`Render utils of SwatchPicker renders custom row 1`] = ` aria-selected="false" class="fui-ColorSwatch" role="gridcell" - style="--fui-SwatchPicker--color: #00B053; --fui-SwatchPicker--borderColor: var(--colorTransparentStroke);" + style="--fui-SwatchPicker--color: #00B053;" type="button" />
@@ -113,7 +113,7 @@ exports[`Render utils of SwatchPicker renders custom swatch 1`] = ` aria-selected="false" class="fui-ColorSwatch custom-swatch" role="gridcell" - style="--fui-SwatchPicker--color: #FF1921; --fui-SwatchPicker--borderColor: var(--colorTransparentStroke);" + style="--fui-SwatchPicker--color: #FF1921;" type="button" />