Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

801
node_modules/@fluentui/react-rating/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,801 @@
# Change Log - @fluentui/react-rating
This log was last generated on Thu, 26 Mar 2026 08:10:41 GMT and should not be manually modified.
<!-- Start content -->
## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.4.0)
Thu, 26 Mar 2026 08:10:41 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.15..@fluentui/react-rating_v9.4.0)
### Minor changes
- feat: add base hooks for Rating ([PR #35823](https://github.com/microsoft/fluentui/pull/35823) by dmytrokirpa@microsoft.com)
## [9.3.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.15)
Wed, 25 Feb 2026 13:32:28 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.14..@fluentui/react-rating_v9.3.15)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.4.1 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
- Bump @fluentui/react-shared-contexts to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
- Bump @fluentui/react-tabster to v9.26.13 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
- Bump @fluentui/react-utilities to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
## [9.3.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.14)
Thu, 12 Feb 2026 10:46:15 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.13..@fluentui/react-rating_v9.3.14)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.4.0 ([PR #35743](https://github.com/microsoft/fluentui/pull/35743) by beachball)
## [9.3.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.13)
Thu, 22 Jan 2026 17:06:38 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.12..@fluentui/react-rating_v9.3.13)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.3.5 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
- Bump @fluentui/react-shared-contexts to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
- Bump @fluentui/react-theme to v9.2.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
- Bump @fluentui/react-tabster to v9.26.12 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
- Bump @fluentui/react-utilities to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
## [9.3.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.12)
Wed, 17 Dec 2025 18:10:11 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.11..@fluentui/react-rating_v9.3.12)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.3.4 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
- Bump @fluentui/react-tabster to v9.26.11 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
- Bump @fluentui/react-utilities to v9.26.0 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
## [9.3.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.11)
Tue, 11 Nov 2025 19:18:07 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.10..@fluentui/react-rating_v9.3.11)
### Patches
- chore: Bump @griffel/react package. ([PR #35469](https://github.com/microsoft/fluentui/pull/35469) by estebanmu@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.3.3 ([PR #35462](https://github.com/microsoft/fluentui/pull/35462) by beachball)
- Bump @fluentui/react-shared-contexts to v9.26.0 ([PR #35462](https://github.com/microsoft/fluentui/pull/35462) by beachball)
- Bump @fluentui/react-tabster to v9.26.10 ([PR #35462](https://github.com/microsoft/fluentui/pull/35462) by beachball)
- Bump @fluentui/react-utilities to v9.25.4 ([PR #35462](https://github.com/microsoft/fluentui/pull/35462) by beachball)
## [9.3.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.10)
Thu, 06 Nov 2025 15:01:25 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.9..@fluentui/react-rating_v9.3.10)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.3.2 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
- Bump @fluentui/react-tabster to v9.26.9 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
- Bump @fluentui/react-utilities to v9.25.3 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
## [9.3.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.9)
Fri, 31 Oct 2025 16:22:06 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.8..@fluentui/react-rating_v9.3.9)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.3.1 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
- Bump @fluentui/react-tabster to v9.26.8 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
- Bump @fluentui/react-utilities to v9.25.2 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
## [9.3.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.8)
Tue, 21 Oct 2025 14:16:59 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.7..@fluentui/react-rating_v9.3.8)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.3.0 ([PR #35343](https://github.com/microsoft/fluentui/pull/35343) by beachball)
## [9.3.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.7)
Wed, 08 Oct 2025 12:04:53 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.6..@fluentui/react-rating_v9.3.7)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.2.2 ([PR #35294](https://github.com/microsoft/fluentui/pull/35294) by beachball)
- Bump @fluentui/react-tabster to v9.26.7 ([PR #35294](https://github.com/microsoft/fluentui/pull/35294) by beachball)
- Bump @fluentui/react-utilities to v9.25.1 ([PR #35294](https://github.com/microsoft/fluentui/pull/35294) by beachball)
## [9.3.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.6)
Thu, 02 Oct 2025 15:12:32 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.5..@fluentui/react-rating_v9.3.6)
### Patches
- feat: enforce usage of use client directive for files with client-only features ([PR #35173](https://github.com/microsoft/fluentui/pull/35173) by dmytrokirpa@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.2.1 ([PR #35133](https://github.com/microsoft/fluentui/pull/35133) by beachball)
- Bump @fluentui/react-shared-contexts to v9.25.2 ([PR #35133](https://github.com/microsoft/fluentui/pull/35133) by beachball)
- Bump @fluentui/react-tabster to v9.26.6 ([PR #35133](https://github.com/microsoft/fluentui/pull/35133) by beachball)
- Bump @fluentui/react-utilities to v9.25.0 ([PR #35133](https://github.com/microsoft/fluentui/pull/35133) by beachball)
## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.5)
Mon, 08 Sep 2025 12:51:20 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.4..@fluentui/react-rating_v9.3.5)
### Patches
- chore: enforce explicit module boundary types ([PR #35080](https://github.com/microsoft/fluentui/pull/35080) by dmytrokirpa@microsoft.com)
- chore: extend peer dependencies versions to support React 19 ([PR #35145](https://github.com/microsoft/fluentui/pull/35145) by dmytrokirpa@microsoft.com)
- fix: react 19 type issues ([PR #34864](https://github.com/microsoft/fluentui/pull/34864) by dmytrokirpa@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.2.0 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
- Bump @fluentui/react-shared-contexts to v9.25.1 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
- Bump @fluentui/react-tabster to v9.26.5 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
- Bump @fluentui/react-utilities to v9.24.1 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
## [9.3.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.4)
Thu, 21 Aug 2025 12:25:17 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.3..@fluentui/react-rating_v9.3.4)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.1.6 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
- Bump @fluentui/react-shared-contexts to v9.25.0 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
- Bump @fluentui/react-tabster to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
- Bump @fluentui/react-utilities to v9.24.0 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
## [9.3.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.3)
Thu, 07 Aug 2025 10:03:33 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.2..@fluentui/react-rating_v9.3.3)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.1.5 ([PR #34980](https://github.com/microsoft/fluentui/pull/34980) by beachball)
- Bump @fluentui/react-tabster to v9.26.3 ([PR #34980](https://github.com/microsoft/fluentui/pull/34980) by beachball)
- Bump @fluentui/react-utilities to v9.23.2 ([PR #34980](https://github.com/microsoft/fluentui/pull/34980) by beachball)
## [9.3.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.2)
Wed, 30 Jul 2025 13:10:57 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.1..@fluentui/react-rating_v9.3.2)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.1.4 ([PR #34881](https://github.com/microsoft/fluentui/pull/34881) by beachball)
- Bump @fluentui/react-shared-contexts to v9.24.1 ([PR #34881](https://github.com/microsoft/fluentui/pull/34881) by beachball)
- Bump @fluentui/react-theme to v9.2.0 ([PR #34881](https://github.com/microsoft/fluentui/pull/34881) by beachball)
- Bump @fluentui/react-tabster to v9.26.2 ([PR #34881](https://github.com/microsoft/fluentui/pull/34881) by beachball)
- Bump @fluentui/react-utilities to v9.23.1 ([PR #34881](https://github.com/microsoft/fluentui/pull/34881) by beachball)
## [9.3.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.1)
Mon, 28 Jul 2025 18:48:21 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.0..@fluentui/react-rating_v9.3.1)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.1.3 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
- Bump @fluentui/react-tabster to v9.26.1 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
- Bump @fluentui/react-utilities to v9.23.0 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
## [9.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.3.0)
Thu, 17 Jul 2025 13:49:45 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.2.3..@fluentui/react-rating_v9.3.0)
### Minor changes
- feat: enable griffel raw styles ([PR #34853](https://github.com/microsoft/fluentui/pull/34853) by martinhochel@microsoft.com)
- Bump @fluentui/react-tabster to v9.26.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
## [9.2.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.2.3)
Fri, 27 Jun 2025 13:39:41 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.2.2..@fluentui/react-rating_v9.2.3)
### Patches
- Bump @fluentui/react-tabster to v9.25.3 ([PR #34734](https://github.com/microsoft/fluentui/pull/34734) by beachball)
## [9.2.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.2.2)
Thu, 26 Jun 2025 14:11:55 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.2.1..@fluentui/react-rating_v9.2.2)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.1.2 ([PR #34529](https://github.com/microsoft/fluentui/pull/34529) by beachball)
- Bump @fluentui/react-tabster to v9.25.2 ([PR #34529](https://github.com/microsoft/fluentui/pull/34529) by beachball)
- Bump @fluentui/react-utilities to v9.22.0 ([PR #34529](https://github.com/microsoft/fluentui/pull/34529) by beachball)
## [9.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.2.1)
Wed, 18 Jun 2025 17:34:00 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.2.0..@fluentui/react-rating_v9.2.1)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.1.1 ([PR #34675](https://github.com/microsoft/fluentui/pull/34675) by beachball)
- Bump @fluentui/react-shared-contexts to v9.24.0 ([PR #34675](https://github.com/microsoft/fluentui/pull/34675) by beachball)
- Bump @fluentui/react-tabster to v9.25.1 ([PR #34675](https://github.com/microsoft/fluentui/pull/34675) by beachball)
- Bump @fluentui/react-utilities to v9.21.1 ([PR #34675](https://github.com/microsoft/fluentui/pull/34675) by beachball)
## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.2.0)
Thu, 12 Jun 2025 09:43:33 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.8..@fluentui/react-rating_v9.2.0)
### Minor changes
- Bump @fluentui/react-jsx-runtime to v9.1.0 ([PR #34456](https://github.com/microsoft/fluentui/pull/34456) by beachball)
- Bump @fluentui/react-tabster to v9.25.0 ([PR #34456](https://github.com/microsoft/fluentui/pull/34456) by beachball)
- Bump @fluentui/react-utilities to v9.21.0 ([PR #34456](https://github.com/microsoft/fluentui/pull/34456) by beachball)
## [9.1.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.8)
Fri, 06 Jun 2025 13:15:17 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.7..@fluentui/react-rating_v9.1.8)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.55 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
- Bump @fluentui/react-tabster to v9.24.8 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
- Bump @fluentui/react-utilities to v9.20.0 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
## [9.1.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.7)
Wed, 14 May 2025 18:49:20 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.6..@fluentui/react-rating_v9.1.7)
### Patches
- Bump @fluentui/react-tabster to v9.24.7 ([PR #34438](https://github.com/microsoft/fluentui/pull/34438) by beachball)
## [9.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.6)
Thu, 24 Apr 2025 09:59:45 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.5..@fluentui/react-rating_v9.1.6)
### Patches
- Bump @fluentui/react-tabster to v9.24.6 ([PR #34315](https://github.com/microsoft/fluentui/pull/34315) by beachball)
## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.5)
Wed, 16 Apr 2025 19:42:18 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.4..@fluentui/react-rating_v9.1.5)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.54 ([PR #34166](https://github.com/microsoft/fluentui/pull/34166) by beachball)
- Bump @fluentui/react-tabster to v9.24.5 ([PR #34166](https://github.com/microsoft/fluentui/pull/34166) by beachball)
- Bump @fluentui/react-utilities to v9.19.0 ([PR #34166](https://github.com/microsoft/fluentui/pull/34166) by beachball)
## [9.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.4)
Tue, 01 Apr 2025 15:08:02 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.3..@fluentui/react-rating_v9.1.4)
### Patches
- Bump @fluentui/react-tabster to v9.24.4 ([PR #33909](https://github.com/microsoft/fluentui/pull/33909) by beachball)
## [9.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.3)
Thu, 27 Mar 2025 21:12:49 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.2..@fluentui/react-rating_v9.1.3)
### Patches
- feat: add customStyleHook ([PR #34034](https://github.com/microsoft/fluentui/pull/34034) by dmytrokirpa@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.53 ([PR #34034](https://github.com/microsoft/fluentui/pull/34034) by beachball)
- Bump @fluentui/react-shared-contexts to v9.23.1 ([PR #34034](https://github.com/microsoft/fluentui/pull/34034) by beachball)
- Bump @fluentui/react-tabster to v9.24.3 ([PR #34034](https://github.com/microsoft/fluentui/pull/34034) by beachball)
- Bump @fluentui/react-utilities to v9.18.23 ([PR #34034](https://github.com/microsoft/fluentui/pull/34034) by beachball)
## [9.1.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.2)
Wed, 19 Mar 2025 15:40:43 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.1..@fluentui/react-rating_v9.1.2)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.52 ([PR #34032](https://github.com/microsoft/fluentui/pull/34032) by beachball)
- Bump @fluentui/react-tabster to v9.24.2 ([PR #34032](https://github.com/microsoft/fluentui/pull/34032) by beachball)
- Bump @fluentui/react-utilities to v9.18.22 ([PR #34032](https://github.com/microsoft/fluentui/pull/34032) by beachball)
## [9.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.1)
Tue, 11 Mar 2025 18:58:54 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.1.0..@fluentui/react-rating_v9.1.1)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.51 ([PR #33927](https://github.com/microsoft/fluentui/pull/33927) by beachball)
- Bump @fluentui/react-tabster to v9.24.1 ([PR #33927](https://github.com/microsoft/fluentui/pull/33927) by beachball)
- Bump @fluentui/react-utilities to v9.18.21 ([PR #33927](https://github.com/microsoft/fluentui/pull/33927) by beachball)
## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.1.0)
Fri, 21 Feb 2025 14:34:05 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.28..@fluentui/react-rating_v9.1.0)
### Minor changes
- Bump @fluentui/react-tabster to v9.24.0 ([PR #33876](https://github.com/microsoft/fluentui/pull/33876) by beachball)
## [9.0.28](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.28)
Wed, 22 Jan 2025 14:00:21 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.27..@fluentui/react-rating_v9.0.28)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.50 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
- Bump @fluentui/react-tabster to v9.23.3 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
- Bump @fluentui/react-utilities to v9.18.20 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
## [9.0.27](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.27)
Wed, 08 Jan 2025 18:33:36 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.26..@fluentui/react-rating_v9.0.27)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.49 ([PR #33550](https://github.com/microsoft/fluentui/pull/33550) by beachball)
## [9.0.26](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.26)
Wed, 18 Dec 2024 10:59:37 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.25..@fluentui/react-rating_v9.0.26)
### Patches
- fix: Pass missing Rating's itemLabel prop to its state so RatingItem consumes it from context. ([PR #33361](https://github.com/microsoft/fluentui/pull/33361) by derdem@microsoft.com)
## [9.0.25](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.25)
Mon, 16 Dec 2024 16:26:49 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.24..@fluentui/react-rating_v9.0.25)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.48 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
- Bump @fluentui/react-theme to v9.1.24 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
- Bump @fluentui/react-tabster to v9.23.2 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
- Bump @fluentui/react-utilities to v9.18.19 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
## [9.0.24](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.24)
Mon, 09 Dec 2024 17:38:15 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.23..@fluentui/react-rating_v9.0.24)
### Patches
- chore: remove usage of "export *" ([PR #33384](https://github.com/microsoft/fluentui/pull/33384) by olfedias@microsoft.com)
## [9.0.23](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.23)
Fri, 06 Dec 2024 12:53:46 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.22..@fluentui/react-rating_v9.0.23)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.47 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
- Bump @fluentui/react-theme to v9.1.23 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
- Bump @fluentui/react-tabster to v9.23.1 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
- Bump @fluentui/react-utilities to v9.18.18 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
## [9.0.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.22)
Mon, 11 Nov 2024 10:00:53 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.21..@fluentui/react-rating_v9.0.22)
### Patches
- chore: replace npm-scripts and just-scrtips with nx inferred tasks ([PR #33074](https://github.com/microsoft/fluentui/pull/33074) by martinhochel@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.46 ([PR #33238](https://github.com/microsoft/fluentui/pull/33238) by beachball)
- Bump @fluentui/react-theme to v9.1.22 ([PR #33238](https://github.com/microsoft/fluentui/pull/33238) by beachball)
- Bump @fluentui/react-tabster to v9.23.0 ([PR #33238](https://github.com/microsoft/fluentui/pull/33238) by beachball)
- Bump @fluentui/react-utilities to v9.18.17 ([PR #33238](https://github.com/microsoft/fluentui/pull/33238) by beachball)
## [9.0.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.21)
Tue, 15 Oct 2024 17:17:53 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.20..@fluentui/react-rating_v9.0.21)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.45 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
- Bump @fluentui/react-theme to v9.1.21 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
- Bump @fluentui/react-tabster to v9.22.9 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
- Bump @fluentui/react-utilities to v9.18.16 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
## [9.0.20](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.20)
Tue, 08 Oct 2024 22:05:59 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.19..@fluentui/react-rating_v9.0.20)
### Patches
- Bump @fluentui/react-tabster to v9.22.8 ([PR #33007](https://github.com/microsoft/fluentui/pull/33007) by beachball)
## [9.0.19](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.19)
Mon, 23 Sep 2024 12:40:17 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.18..@fluentui/react-rating_v9.0.19)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.44 ([PR #32840](https://github.com/microsoft/fluentui/pull/32840) by beachball)
- Bump @fluentui/react-theme to v9.1.20 ([PR #32840](https://github.com/microsoft/fluentui/pull/32840) by beachball)
- Bump @fluentui/react-tabster to v9.22.7 ([PR #32840](https://github.com/microsoft/fluentui/pull/32840) by beachball)
- Bump @fluentui/react-utilities to v9.18.15 ([PR #32840](https://github.com/microsoft/fluentui/pull/32840) by beachball)
## [9.0.18](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.18)
Tue, 10 Sep 2024 10:19:12 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.17..@fluentui/react-rating_v9.0.18)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.43 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
- Bump @fluentui/react-tabster to v9.22.6 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
- Bump @fluentui/react-utilities to v9.18.14 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
## [9.0.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.17)
Thu, 15 Aug 2024 13:49:46 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.16..@fluentui/react-rating_v9.0.17)
### Patches
- Bump @fluentui/react-tabster to v9.22.5 ([PR #32313](https://github.com/microsoft/fluentui/pull/32313) by beachball)
## [9.0.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.16)
Thu, 15 Aug 2024 08:22:17 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.15..@fluentui/react-rating_v9.0.16)
### Patches
- Bump @fluentui/react-tabster to v9.22.4 ([PR #31885](https://github.com/microsoft/fluentui/pull/31885) by beachball)
## [9.0.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.15)
Tue, 23 Jul 2024 20:13:14 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.14..@fluentui/react-rating_v9.0.15)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.42 ([PR #32067](https://github.com/microsoft/fluentui/pull/32067) by beachball)
- Bump @fluentui/react-tabster to v9.22.3 ([PR #32067](https://github.com/microsoft/fluentui/pull/32067) by beachball)
- Bump @fluentui/react-utilities to v9.18.13 ([PR #32067](https://github.com/microsoft/fluentui/pull/32067) by beachball)
## [9.0.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.14)
Mon, 15 Jul 2024 17:25:44 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.13..@fluentui/react-rating_v9.0.14)
### Patches
- fix: revert incorectly set npm versions in all packages ([PR #31937](https://github.com/microsoft/fluentui/pull/31937) by martinhochel@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.41 ([PR #31998](https://github.com/microsoft/fluentui/pull/31998) by beachball)
- Bump @fluentui/react-tabster to v9.22.2 ([PR #31998](https://github.com/microsoft/fluentui/pull/31998) by beachball)
- Bump @fluentui/react-utilities to v9.18.12 ([PR #31998](https://github.com/microsoft/fluentui/pull/31998) by beachball)
## [9.0.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.13)
Mon, 01 Jul 2024 20:30:28 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.12..@fluentui/react-rating_v9.0.13)
### Patches
- chore: Update react-icons package to ^2.0.245 ([PR #31802](https://github.com/microsoft/fluentui/pull/31802) by ololubek@microsoft.com)
- chore: add eslint react-compiler ([PR #31457](https://github.com/microsoft/fluentui/pull/31457) by seanmonahan@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.40 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
- Bump @fluentui/react-tabster to v9.22.1 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
- Bump @fluentui/react-utilities to v9.18.11 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
## [9.0.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.12)
Mon, 17 Jun 2024 07:34:17 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.11..@fluentui/react-rating_v9.0.12)
### Patches
- Bump @fluentui/react-tabster to v9.22.0 ([commit](https://github.com/microsoft/fluentui/commit/9ae683c22f2e65d94422a571ad5d3f97d0a77234) by beachball)
## [9.0.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.11)
Thu, 06 Jun 2024 15:26:45 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.10..@fluentui/react-rating_v9.0.11)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.39 ([PR #31586](https://github.com/microsoft/fluentui/pull/31586) by beachball)
- Bump @fluentui/react-tabster to v9.21.5 ([PR #31586](https://github.com/microsoft/fluentui/pull/31586) by beachball)
- Bump @fluentui/react-utilities to v9.18.10 ([PR #31586](https://github.com/microsoft/fluentui/pull/31586) by beachball)
## [9.0.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.10)
Thu, 23 May 2024 08:02:47 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.9..@fluentui/react-rating_v9.0.10)
### Patches
- chore: replace usage of .shorthands() in styles ([PR #31449](https://github.com/microsoft/fluentui/pull/31449) by olfedias@microsoft.com)
- Bump @fluentui/react-tabster to v9.21.4 ([commit](https://github.com/microsoft/fluentui/commit/03599d609e8310b08c57d1f871cffbf717d79207) by beachball)
## [9.0.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.9)
Mon, 20 May 2024 12:45:02 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.8..@fluentui/react-rating_v9.0.9)
### Patches
- chore: bump @griffel/react ([PR #31258](https://github.com/microsoft/fluentui/pull/31258) by olfedias@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.38 ([PR #26682](https://github.com/microsoft/fluentui/pull/26682) by beachball)
- Bump @fluentui/react-tabster to v9.21.3 ([PR #26682](https://github.com/microsoft/fluentui/pull/26682) by beachball)
- Bump @fluentui/react-utilities to v9.18.9 ([PR #26682](https://github.com/microsoft/fluentui/pull/26682) by beachball)
## [9.0.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.8)
Thu, 16 May 2024 09:25:17 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.7..@fluentui/react-rating_v9.0.8)
### Patches
- chore: Upgrade react-icons version to 2.0.239 to pick up provider export map fix. ([PR #31287](https://github.com/microsoft/fluentui/pull/31287) by ololubek@microsoft.com)
## [9.0.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.7)
Thu, 09 May 2024 19:35:12 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.6..@fluentui/react-rating_v9.0.7)
### Patches
- Bump @fluentui/react-tabster to v9.21.2 ([PR #31321](https://github.com/microsoft/fluentui/pull/31321) by beachball)
## [9.0.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.6)
Mon, 06 May 2024 12:55:02 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.5..@fluentui/react-rating_v9.0.6)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.37 ([PR #31271](https://github.com/microsoft/fluentui/pull/31271) by beachball)
- Bump @fluentui/react-tabster to v9.21.1 ([PR #31271](https://github.com/microsoft/fluentui/pull/31271) by beachball)
- Bump @fluentui/react-utilities to v9.18.8 ([PR #31271](https://github.com/microsoft/fluentui/pull/31271) by beachball)
## [9.0.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.5)
Thu, 02 May 2024 11:36:36 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.4..@fluentui/react-rating_v9.0.5)
### Patches
- chore: upgrade @fluentui/react-icons to 2.0.237. ([PR #31139](https://github.com/microsoft/fluentui/pull/31139) by ololubek@microsoft.com)
- Bump @fluentui/react-tabster to v9.21.0 ([PR #31231](https://github.com/microsoft/fluentui/pull/31231) by beachball)
## [9.0.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.4)
Tue, 23 Apr 2024 08:17:49 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.3..@fluentui/react-rating_v9.0.4)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.36 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
- Bump @fluentui/react-tabster to v9.20.1 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
- Bump @fluentui/react-utilities to v9.18.7 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
## [9.0.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.3)
Wed, 17 Apr 2024 21:53:56 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.2..@fluentui/react-rating_v9.0.3)
### Patches
- chore: Update RatingDisplay value margin-left tokens. ([PR #31034](https://github.com/microsoft/fluentui/pull/31034) by ololubek@microsoft.com)
- chore: Update react-icons to 2.0.235 ([PR #31011](https://github.com/microsoft/fluentui/pull/31011) by ololubek@microsoft.com)
- Bump @fluentui/react-tabster to v9.20.0 ([PR #31100](https://github.com/microsoft/fluentui/pull/31100) by beachball)
## [9.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.2)
Tue, 02 Apr 2024 09:48:01 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.1..@fluentui/react-rating_v9.0.2)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.35 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
- Bump @fluentui/react-tabster to v9.19.6 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
- Bump @fluentui/react-utilities to v9.18.6 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.1)
Mon, 18 Mar 2024 19:50:46 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.0.0..@fluentui/react-rating_v9.0.1)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.34 ([PR #30600](https://github.com/microsoft/fluentui/pull/30600) by beachball)
- Bump @fluentui/react-theme to v9.1.19 ([PR #30600](https://github.com/microsoft/fluentui/pull/30600) by beachball)
- Bump @fluentui/react-tabster to v9.19.5 ([PR #30600](https://github.com/microsoft/fluentui/pull/30600) by beachball)
- Bump @fluentui/react-utilities to v9.18.5 ([PR #30600](https://github.com/microsoft/fluentui/pull/30600) by beachball)
## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.0.0)
Fri, 15 Mar 2024 21:43:49 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.4.0..@fluentui/react-rating_v9.0.0)
### Minor changes
- 'feat: Release Rating to stable. ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by ololubek@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.33 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
- Bump @fluentui/react-theme to v9.1.18 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
- Bump @fluentui/react-tabster to v9.19.4 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
- Bump @fluentui/react-utilities to v9.18.4 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
## [0.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.4.0)
Thu, 07 Mar 2024 19:33:24 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.3.2..@fluentui/react-rating-preview_v0.4.0)
### Minor changes
- breaking: Update icon api type to ElementType ([PR #30666](https://github.com/microsoft/fluentui/pull/30666) by ololubek@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.32 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
- Bump @fluentui/react-theme to v9.1.17 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
- Bump @fluentui/react-tabster to v9.19.3 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
- Bump @fluentui/react-utilities to v9.18.3 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
### Patches
- chore: Update jsdocs and stories in Rating ([PR #30653](https://github.com/microsoft/fluentui/pull/30653) by ololubek@microsoft.com)
## [0.3.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.3.2)
Wed, 28 Feb 2024 02:34:18 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.3.1..@fluentui/react-rating-preview_v0.3.2)
### Patches
- fix: Add focus border styling to Rating ([PR #30581](https://github.com/microsoft/fluentui/pull/30581) by ololubek@microsoft.com)
- fix: update RatingItem styling to use flex to align all items properly ([PR #30638](https://github.com/microsoft/fluentui/pull/30638) by ololubek@microsoft.com)
- fix: Add flex wrap to Rating and RatingDisplay ([PR #30639](https://github.com/microsoft/fluentui/pull/30639) by ololubek@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.31 ([PR #30639](https://github.com/microsoft/fluentui/pull/30639) by beachball)
- Bump @fluentui/react-tabster to v9.19.2 ([PR #30639](https://github.com/microsoft/fluentui/pull/30639) by beachball)
- Bump @fluentui/react-utilities to v9.18.2 ([PR #30639](https://github.com/microsoft/fluentui/pull/30639) by beachball)
## [0.3.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.3.1)
Tue, 20 Feb 2024 14:22:24 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.3.0..@fluentui/react-rating-preview_v0.3.1)
### Patches
- fix: remove component assignment from prop destructuring ([PR #30520](https://github.com/microsoft/fluentui/pull/30520) by seanmonahan@microsoft.com)
- fix: update vertical styling for RatingDisplay to fix vertical alignment ([PR #30465](https://github.com/microsoft/fluentui/pull/30465) by ololubek@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.30 ([PR #30543](https://github.com/microsoft/fluentui/pull/30543) by beachball)
- Bump @fluentui/react-tabster to v9.19.1 ([PR #30543](https://github.com/microsoft/fluentui/pull/30543) by beachball)
- Bump @fluentui/react-utilities to v9.18.1 ([PR #30543](https://github.com/microsoft/fluentui/pull/30543) by beachball)
## [0.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.3.0)
Tue, 06 Feb 2024 17:55:19 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.2.1..@fluentui/react-rating-preview_v0.3.0)
### Minor changes
- chore: Simplify high contrast visuals for RatingItem, and remove iconOutline from RatingDisplay ([PR #30457](https://github.com/microsoft/fluentui/pull/30457) by behowell@microsoft.com)
- Bump @fluentui/react-tabster to v9.19.0 ([PR #30392](https://github.com/microsoft/fluentui/pull/30392) by beachball)
### Patches
- chore: add accesibility props to Rating and RatingDisplay ([PR #30414](https://github.com/microsoft/fluentui/pull/30414) by ololubek@microsoft.com)
- chore: add accessibility props to Rating and RatingDisplay ([PR #30421](https://github.com/microsoft/fluentui/pull/30421) by ololubek@microsoft.com)
## [0.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.2.1)
Tue, 30 Jan 2024 23:16:54 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.2.0..@fluentui/react-rating-preview_v0.2.1)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.29 ([PR #29983](https://github.com/microsoft/fluentui/pull/29983) by beachball)
- Bump @fluentui/react-tabster to v9.18.0 ([PR #29983](https://github.com/microsoft/fluentui/pull/29983) by beachball)
- Bump @fluentui/react-utilities to v9.18.0 ([PR #29983](https://github.com/microsoft/fluentui/pull/29983) by beachball)
## [0.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.2.0)
Fri, 26 Jan 2024 10:40:21 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.1.6..@fluentui/react-rating-preview_v0.2.0)
### Minor changes
- feat: Add RatingDisplay component ([PR #30323](https://github.com/microsoft/fluentui/pull/30323) by ololubek@microsoft.com)
## [0.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.1.6)
Tue, 23 Jan 2024 15:11:00 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.1.5..@fluentui/react-rating-preview_v0.1.6)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.28 ([PR #30359](https://github.com/microsoft/fluentui/pull/30359) by beachball)
- Bump @fluentui/react-tabster to v9.17.4 ([PR #30359](https://github.com/microsoft/fluentui/pull/30359) by beachball)
- Bump @fluentui/react-utilities to v9.17.0 ([PR #30359](https://github.com/microsoft/fluentui/pull/30359) by beachball)
## [0.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.1.5)
Thu, 18 Jan 2024 14:25:03 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.1.4..@fluentui/react-rating-preview_v0.1.5)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.27 ([PR #30046](https://github.com/microsoft/fluentui/pull/30046) by beachball)
- Bump @fluentui/react-tabster to v9.17.3 ([PR #30046](https://github.com/microsoft/fluentui/pull/30046) by beachball)
- Bump @fluentui/react-utilities to v9.16.1 ([PR #30046](https://github.com/microsoft/fluentui/pull/30046) by beachball)
## [0.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.1.4)
Wed, 17 Jan 2024 16:18:50 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.1.3..@fluentui/react-rating-preview_v0.1.4)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.26 ([PR #30339](https://github.com/microsoft/fluentui/pull/30339) by beachball)
- Bump @fluentui/react-tabster to v9.17.2 ([PR #30339](https://github.com/microsoft/fluentui/pull/30339) by beachball)
- Bump @fluentui/react-utilities to v9.16.0 ([PR #30339](https://github.com/microsoft/fluentui/pull/30339) by beachball)
## [0.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.1.3)
Tue, 16 Jan 2024 13:14:23 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.1.2..@fluentui/react-rating-preview_v0.1.3)
### Patches
- Scaffold RatingDisplay ([PR #30283](https://github.com/microsoft/fluentui/pull/30283) by ololubek@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.25 ([PR #30299](https://github.com/microsoft/fluentui/pull/30299) by beachball)
- Bump @fluentui/react-tabster to v9.17.1 ([PR #30299](https://github.com/microsoft/fluentui/pull/30299) by beachball)
## [0.1.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.1.2)
Thu, 11 Jan 2024 09:04:29 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.1.1..@fluentui/react-rating-preview_v0.1.2)
### Patches
- chore: Updating doc stories and API. ([PR #30092](https://github.com/microsoft/fluentui/pull/30092) by ololubek@microsoft.com)
## [0.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.1.1)
Mon, 08 Jan 2024 16:24:24 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating-preview_v0.1.0..@fluentui/react-rating-preview_v0.1.1)
### Patches
- Bump @fluentui/react-jsx-runtime to v9.0.24 ([PR #30179](https://github.com/microsoft/fluentui/pull/30179) by beachball)
- Bump @fluentui/react-tabster to v9.17.0 ([PR #30179](https://github.com/microsoft/fluentui/pull/30179) by beachball)
- Bump @fluentui/react-utilities to v9.15.6 ([PR #30179](https://github.com/microsoft/fluentui/pull/30179) by beachball)
## [0.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating-preview_v0.1.0)
Wed, 03 Jan 2024 09:26:43 GMT
### Minor changes
- 'feat: release rating to preview ([PR #30153](https://github.com/microsoft/fluentui/pull/30153) by ololubek@microsoft.com)
- Bump @fluentui/react-jsx-runtime to v9.0.23 ([PR #30163](https://github.com/microsoft/fluentui/pull/30163) by beachball)
- Bump @fluentui/react-tabster to v9.16.1 ([PR #30163](https://github.com/microsoft/fluentui/pull/30163) by beachball)
- Bump @fluentui/react-utilities to v9.15.5 ([PR #30163](https://github.com/microsoft/fluentui/pull/30163) by beachball)

15
node_modules/@fluentui/react-rating/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
@fluentui/react-rating-preview
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license

38
node_modules/@fluentui/react-rating/README.md generated vendored Normal file
View File

@@ -0,0 +1,38 @@
# @fluentui/react-rating
**React Rating components for [Fluent UI React](https://react.fluentui.dev)**
A `Rating` component allows users to provide a rating for a particular item.
This component displays a set of stars or other symbols that represent the rating value. Users can interact with the component to select a rating by clicking on the stars or using touch gestures.
### Usage
Import `Rating` or `RatingDisplay`:
```js
// From @fluentui/react-components
import { Rating, RatingDisplay } from '@fluentui/react-components';
// Directly from @fluentui/react-rating
import { Rating, RatingDisplay } from '@fluentui/react-rating';
```
#### Examples
```jsx
<Rating />
<RatingDisplay />
```
See [Fluent UI Storybook](https://react.fluentui.dev/) for more detailed usage examples.
Alternatively, run Storybook locally with:
1. `yarn start`
2. Select `react-rating` from the list.
### Specification
See [Spec.md](./docs/Spec.md).

340
node_modules/@fluentui/react-rating/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,340 @@
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { EventData } from '@fluentui/react-utilities';
import type { EventHandler } from '@fluentui/react-utilities';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import type { JSXElement } from '@fluentui/react-utilities';
import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';
/**
* Rating is a wrapper for one or more rating items that will be used to set a rating value.
*/
export declare const Rating: ForwardRefComponent<RatingProps>;
/**
* Rating base props — excludes design props (color, size).
*/
export declare type RatingBaseProps = Omit<RatingProps, 'color' | 'size'>;
/**
* Rating base state — excludes design props (color, size).
*/
export declare type RatingBaseState = Omit<RatingState, 'color' | 'size'>;
export declare const ratingClassNames: SlotClassNames<RatingSlots>;
export declare type RatingContextValues = {
ratingItem: RatingItemContextValue;
};
/**
* RatingDisplay is a wrapper for one or more rating items that will be used to display a rating value
* as well as the label for the rating.
*/
export declare const RatingDisplay: ForwardRefComponent<RatingDisplayProps>;
/**
* RatingDisplay base props — excludes design props (color, size).
*/
export declare type RatingDisplayBaseProps = Omit<RatingDisplayProps, 'color' | 'size'>;
/**
* RatingDisplay base state — excludes design props (color, size).
*/
export declare type RatingDisplayBaseState = Omit<RatingDisplayState, 'color' | 'size' | 'icon'> & Pick<RatingDisplayProps, 'icon'>;
export declare const ratingDisplayClassNames: SlotClassNames<RatingDisplaySlots>;
export declare type RatingDisplayContextValues = {
ratingItem: RatingItemContextValue;
};
/**
* RatingDisplay Props
*/
export declare type RatingDisplayProps = ComponentProps<RatingDisplaySlots> & {
/**
* Color of the rating items (stars).
* @default neutral
*/
color?: 'brand' | 'marigold' | 'neutral';
/**
* Renders a single filled star, with the value written next to it.
* @default false
*/
compact?: boolean;
/**
* The number of ratings represented by the rating value.
* This will be formatted with a thousands separator (if applicable) and displayed next to the value.
*/
count?: number;
/**
* The icon used for rating items.
* @default StarFilled
*/
icon?: React_2.ElementType;
/**
* The max value of the rating. This controls the number of rating items displayed.
* Must be a whole number greater than 1.
* @default 5
*/
max?: number;
/**
* Sets the size of the RatingDisplay items.
* @default medium
*/
size?: 'small' | 'medium' | 'large' | 'extra-large';
/**
* The value of the rating
*/
value?: number;
};
export declare type RatingDisplaySlots = {
root: NonNullable<Slot<'div'>>;
valueText?: Slot<'span'>;
countText?: Slot<'span'>;
};
/**
* State used in rendering RatingDisplay
*/
export declare type RatingDisplayState = ComponentState<RatingDisplaySlots> & Required<Pick<RatingDisplayProps, 'color' | 'compact' | 'icon' | 'max' | 'size'>> & Pick<RatingDisplayProps, 'value'>;
/**
* RatingItem is an item that will be used to set or display a rating value.
*/
export declare const RatingItem: ForwardRefComponent<RatingItemProps>;
/**
* RatingItem base props — same as RatingItemProps (no design-only props at this level).
*/
export declare type RatingItemBaseProps = RatingItemProps;
/**
* RatingItem base state — excludes design props (color, size) from context.
*/
export declare type RatingItemBaseState = Omit<RatingItemState, 'color' | 'size'>;
export declare const ratingItemClassNames: SlotClassNames<RatingItemSlots>;
declare type RatingItemContextValue = Partial<Pick<RatingState, 'name' | 'hoveredValue' | 'value'>> & Pick<RatingState, 'color' | 'iconFilled' | 'iconOutline' | 'itemLabel' | 'step' | 'size'> & Partial<Pick<RatingDisplayState, 'compact'>> & {
interactive?: boolean;
};
/**
* RatingItem Props
*/
export declare type RatingItemProps = ComponentProps<Partial<RatingItemSlots>> & {
/**
* The positive whole number value that is displayed by this RatingItem
*/
value?: number;
};
export declare const RatingItemProvider: React_2.Provider<RatingItemContextValue | undefined>;
export declare type RatingItemSlots = {
/**
* The root slot of the RatingItem.
* Default html element is span
*/
root: NonNullable<Slot<'span'>>;
/**
* Icon displayed when the rating value is greater than or equal to the item's value.
*/
selectedIcon?: NonNullable<Slot<'div'>>;
/**
* Icon displayed when the rating value is less than the item's value.
*/
unselectedIcon?: NonNullable<Slot<'div'>>;
/**
* Radio input slot used for half star precision
*/
halfValueInput?: NonNullable<Slot<'input'>>;
/**
* Radio input slot used for full star precision
*/
fullValueInput?: NonNullable<Slot<'input'>>;
};
/**
* State used in rendering RatingItem
*/
export declare type RatingItemState = ComponentState<RatingItemSlots> & Required<Pick<RatingItemProps, 'value'>> & Pick<RatingState, 'color' | 'step' | 'size'> & {
iconFillWidth: number;
appearance: 'outline' | 'filled';
};
/**
* Data for the onChange event for Rating.
*/
export declare type RatingOnChangeEventData = EventData<'change', React_2.FormEvent<HTMLDivElement>> & {
/**
* The new value of the rating.
*/
value: number;
};
/**
* Rating Props
*/
export declare type RatingProps = Omit<ComponentProps<Partial<RatingSlots>>, 'onChange'> & {
/**
* Controls the color of the Rating.
* @default neutral
*/
color?: 'brand' | 'marigold' | 'neutral';
/**
* Default value of the Rating
*/
defaultValue?: number;
/**
* The icon to display when the rating value is greater than or equal to the item's value.
*/
iconFilled?: React_2.ElementType;
/**
* The icon to display when the rating value is less than the item's value.
*/
iconOutline?: React_2.ElementType;
/**
* Prop to generate the aria-label for the rating inputs.
* @default (rating) =\> `${rating}`
*/
itemLabel?: (rating: number) => string;
/**
* The max value of the rating. This controls the number of rating items displayed.
* Must be a whole number greater than 1.
* @default 5
*/
max?: number;
/**
* Name for the Radio inputs. If not provided, one will be automatically generated
*/
name?: string;
/**
* Callback when the rating value is changed by the user.
*/
onChange?: EventHandler<RatingOnChangeEventData>;
/**
* Sets the precision to allow half-filled shapes in Rating
* @default 1
*/
step?: 0.5 | 1;
/**
* Sets the size of the Rating items.
* @default extra-large
*/
size?: 'small' | 'medium' | 'large' | 'extra-large';
/**
* The value of the rating
*/
value?: number;
};
export declare type RatingSlots = {
root: NonNullable<Slot<'div'>>;
};
/**
* State used in rendering Rating
*/
export declare type RatingState = ComponentState<RatingSlots> & Required<Pick<RatingProps, 'color' | 'iconFilled' | 'iconOutline' | 'name' | 'step' | 'size' | 'value'>> & Pick<RatingProps, 'itemLabel'> & {
hoveredValue?: number | undefined;
};
/**
* Render the final JSX of Rating
*/
export declare const renderRating_unstable: (state: RatingBaseState, contextValues: RatingContextValues) => JSXElement;
/**
* Render the final JSX of RatingDisplay
*/
export declare const renderRatingDisplay_unstable: (state: RatingDisplayBaseState, contextValues: RatingDisplayContextValues) => JSXElement;
/**
* Render the final JSX of RatingItem
*/
export declare const renderRatingItem_unstable: (state: RatingItemBaseState) => JSXElement;
/**
* Create the state required to render Rating.
*
* The returned state can be modified with hooks such as useRatingStyles_unstable,
* before being passed to renderRating_unstable.
*
* @param props - props from this instance of Rating
* @param ref - reference to root HTMLElement of Rating
*/
export declare const useRating_unstable: (props: RatingProps, ref: React_2.Ref<HTMLDivElement>) => RatingState;
/**
* Base hook for Rating component. Manages state related to controlled/uncontrolled
* rating value, hover state, radiogroup ARIA role, and keyboard/mouse interaction —
* without design props (color, size).
*
* @param props - props from this instance of Rating (without color, size)
* @param ref - reference to root HTMLElement of Rating
*/
export declare const useRatingBase_unstable: (props: RatingBaseProps, ref: React_2.Ref<HTMLDivElement>) => RatingBaseState;
export declare const useRatingContextValues: (ratingState: RatingState) => RatingContextValues;
/**
* Create the state required to render RatingDisplay.
*
* The returned state can be modified with hooks such as useRatingDisplayStyles_unstable,
* before being passed to renderRatingDisplay_unstable.
*
* @param props - props from this instance of RatingDisplay
* @param ref - reference to root HTMLDivElement of RatingDisplay
*/
export declare const useRatingDisplay_unstable: (props: RatingDisplayProps, ref: React_2.Ref<HTMLDivElement>) => RatingDisplayState;
/**
* Base hook for RatingDisplay component. Manages state related to ARIA img role,
* aria-labelledby composition from valueText/countText IDs, slot structure, and
* compact/full display modes — without design props (color, size).
*
* @param props - props from this instance of RatingDisplay (without color, size)
* @param ref - reference to root HTMLDivElement of RatingDisplay
*/
export declare const useRatingDisplayBase_unstable: (props: RatingDisplayBaseProps, ref: React_2.Ref<HTMLDivElement>) => RatingDisplayBaseState;
export declare const useRatingDisplayContextValues: (state: RatingDisplayState) => RatingDisplayContextValues;
/**
* Apply styling to the RatingDisplay slots based on the state
*/
export declare const useRatingDisplayStyles_unstable: (state: RatingDisplayState) => RatingDisplayState;
/**
* Create the state required to render RatingItem.
*
* The returned state can be modified with hooks such as useRatingItemStyles_unstable,
* before being passed to renderRatingItem_unstable.
*
* @param props - props from this instance of RatingItem
* @param ref - reference to root HTMLElement of RatingItem
*/
export declare const useRatingItem_unstable: (props: RatingItemProps, ref: React_2.Ref<HTMLSpanElement>) => RatingItemState;
/**
* Get the value of the RatingContext.
*/
export declare const useRatingItemContextValue_unstable: () => RatingItemContextValue;
/**
* Apply styling to the RatingItem slots based on the state
*/
export declare const useRatingItemStyles_unstable: (state: RatingItemState) => RatingItemState;
/**
* Apply styling to the Rating slots based on the state
*/
export declare const useRatingStyles_unstable: (state: RatingState) => RatingState;
export { }

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Rating: function() {
return _index.Rating;
},
ratingClassNames: function() {
return _index.ratingClassNames;
},
renderRating_unstable: function() {
return _index.renderRating_unstable;
},
useRatingBase_unstable: function() {
return _index.useRatingBase_unstable;
},
useRatingContextValues: function() {
return _index.useRatingContextValues;
},
useRatingStyles_unstable: function() {
return _index.useRatingStyles_unstable;
},
useRating_unstable: function() {
return _index.useRating_unstable;
}
});
const _index = require("./components/Rating/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/Rating.ts"],"sourcesContent":["export type {\n RatingContextValues,\n RatingOnChangeEventData,\n RatingProps,\n RatingBaseProps,\n RatingSlots,\n RatingState,\n RatingBaseState,\n} from './components/Rating/index';\nexport {\n Rating,\n ratingClassNames,\n renderRating_unstable,\n useRatingContextValues,\n useRatingStyles_unstable,\n useRating_unstable,\n useRatingBase_unstable,\n} from './components/Rating/index';\n"],"names":["Rating","ratingClassNames","renderRating_unstable","useRatingContextValues","useRatingStyles_unstable","useRating_unstable","useRatingBase_unstable"],"mappings":";;;;;;;;;;;;eAUEA,aAAM;;;eACNC,uBAAgB;;;eAChBC,4BAAqB;;;eAIrBI,6BAAsB;;;eAHtBH,6BAAsB;;;eACtBC,+BAAwB;;;eACxBC,yBAAkB;;;uBAEb,4BAA4B"}

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
RatingDisplay: function() {
return _index.RatingDisplay;
},
ratingDisplayClassNames: function() {
return _index.ratingDisplayClassNames;
},
renderRatingDisplay_unstable: function() {
return _index.renderRatingDisplay_unstable;
},
useRatingDisplayBase_unstable: function() {
return _index.useRatingDisplayBase_unstable;
},
useRatingDisplayContextValues: function() {
return _index.useRatingDisplayContextValues;
},
useRatingDisplayStyles_unstable: function() {
return _index.useRatingDisplayStyles_unstable;
},
useRatingDisplay_unstable: function() {
return _index.useRatingDisplay_unstable;
}
});
const _index = require("./components/RatingDisplay/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/RatingDisplay.ts"],"sourcesContent":["export type {\n RatingDisplayContextValues,\n RatingDisplayProps,\n RatingDisplayBaseProps,\n RatingDisplaySlots,\n RatingDisplayState,\n RatingDisplayBaseState,\n} from './components/RatingDisplay/index';\nexport {\n RatingDisplay,\n ratingDisplayClassNames,\n renderRatingDisplay_unstable,\n useRatingDisplayContextValues,\n useRatingDisplayStyles_unstable,\n useRatingDisplay_unstable,\n useRatingDisplayBase_unstable,\n} from './components/RatingDisplay/index';\n"],"names":["RatingDisplay","ratingDisplayClassNames","renderRatingDisplay_unstable","useRatingDisplayContextValues","useRatingDisplayStyles_unstable","useRatingDisplay_unstable","useRatingDisplayBase_unstable"],"mappings":";;;;;;;;;;;;eASEA,oBAAa;;;eACbC,8BAAuB;;;eACvBC,mCAA4B;;;eAI5BI,oCAA6B;;;eAH7BH,oCAA6B;;;eAC7BC,sCAA+B;;;eAC/BC,gCAAyB;;;uBAEpB,mCAAmC"}

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
RatingItem: function() {
return _index.RatingItem;
},
ratingItemClassNames: function() {
return _index.ratingItemClassNames;
},
renderRatingItem_unstable: function() {
return _index.renderRatingItem_unstable;
},
useRatingItemBase_unstable: function() {
return _index.useRatingItemBase_unstable;
},
useRatingItemStyles_unstable: function() {
return _index.useRatingItemStyles_unstable;
},
useRatingItem_unstable: function() {
return _index.useRatingItem_unstable;
}
});
const _index = require("./components/RatingItem/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/RatingItem.ts"],"sourcesContent":["export type {\n RatingItemContextValue,\n RatingItemProps,\n RatingItemBaseProps,\n RatingItemSlots,\n RatingItemState,\n RatingItemBaseState,\n} from './components/RatingItem/index';\nexport {\n RatingItem,\n ratingItemClassNames,\n renderRatingItem_unstable,\n useRatingItemStyles_unstable,\n useRatingItem_unstable,\n useRatingItemBase_unstable,\n} from './components/RatingItem/index';\n"],"names":["RatingItem","ratingItemClassNames","renderRatingItem_unstable","useRatingItemStyles_unstable","useRatingItem_unstable","useRatingItemBase_unstable"],"mappings":";;;;;;;;;;;;eASEA,iBAAU;;;eACVC,2BAAoB;;;eACpBC,gCAAyB;;;eAGzBG,iCAA0B;;;eAF1BF,mCAA4B;;;eAC5BC,6BAAsB;;;uBAEjB,gCAAgC"}

View File

@@ -0,0 +1,26 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Rating", {
enumerable: true,
get: function() {
return Rating;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useRating = require("./useRating");
const _renderRating = require("./renderRating");
const _useRatingStylesstyles = require("./useRatingStyles.styles");
const _useRatingContextValues = require("./useRatingContextValues");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const Rating = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useRating.useRating_unstable)(props, ref);
const contextValues = (0, _useRatingContextValues.useRatingContextValues)(state);
(0, _useRatingStylesstyles.useRatingStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useRatingStyles_unstable')(state);
return (0, _renderRating.renderRating_unstable)(state, contextValues);
});
Rating.displayName = 'Rating';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/Rating.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useRating_unstable } from './useRating';\nimport { renderRating_unstable } from './renderRating';\nimport { useRatingStyles_unstable } from './useRatingStyles.styles';\nimport type { RatingProps } from './Rating.types';\nimport { useRatingContextValues } from './useRatingContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Rating is a wrapper for one or more rating items that will be used to set a rating value.\n */\nexport const Rating: ForwardRefComponent<RatingProps> = React.forwardRef((props, ref) => {\n const state = useRating_unstable(props, ref);\n const contextValues = useRatingContextValues(state);\n\n useRatingStyles_unstable(state);\n useCustomStyleHook_unstable('useRatingStyles_unstable')(state);\n return renderRating_unstable(state, contextValues);\n});\n\nRating.displayName = 'Rating';\n"],"names":["React","useRating_unstable","renderRating_unstable","useRatingStyles_unstable","useRatingContextValues","useCustomStyleHook_unstable","Rating","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;2BAEI,cAAc;8BACX,iBAAiB;uCACd,2BAA2B;wCAE7B,2BAA2B;qCACtB,kCAAkC;AAKvE,MAAMM,SAAAA,WAAAA,GAA2CN,OAAMO,UAAU,CAAC,CAACC,OAAOC;IAC/E,MAAMC,YAAQT,6BAAAA,EAAmBO,OAAOC;IACxC,MAAME,oBAAgBP,8CAAAA,EAAuBM;QAE7CP,+CAAAA,EAAyBO;QACzBL,gDAAAA,EAA4B,4BAA4BK;IACxD,WAAOR,mCAAAA,EAAsBQ,OAAOC;AACtC,GAAG;AAEHL,OAAOM,WAAW,GAAG"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/Rating.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport type RatingSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Rating Props\n */\nexport type RatingProps = Omit<ComponentProps<Partial<RatingSlots>>, 'onChange'> & {\n /**\n * Controls the color of the Rating.\n * @default neutral\n */\n color?: 'brand' | 'marigold' | 'neutral';\n /**\n * Default value of the Rating\n */\n defaultValue?: number;\n /**\n * The icon to display when the rating value is greater than or equal to the item's value.\n */\n iconFilled?: React.ElementType;\n /**\n * The icon to display when the rating value is less than the item's value.\n */\n iconOutline?: React.ElementType;\n /**\n * Prop to generate the aria-label for the rating inputs.\n * @default (rating) =\\> `${rating}`\n */\n itemLabel?: (rating: number) => string;\n /**\n * The max value of the rating. This controls the number of rating items displayed.\n * Must be a whole number greater than 1.\n * @default 5\n */\n max?: number;\n /**\n * Name for the Radio inputs. If not provided, one will be automatically generated\n */\n name?: string;\n /**\n * Callback when the rating value is changed by the user.\n */\n onChange?: EventHandler<RatingOnChangeEventData>;\n /**\n * Sets the precision to allow half-filled shapes in Rating\n * @default 1\n */\n step?: 0.5 | 1;\n /**\n * Sets the size of the Rating items.\n * @default extra-large\n */\n size?: 'small' | 'medium' | 'large' | 'extra-large';\n /**\n * The value of the rating\n */\n value?: number;\n};\n\n/**\n * Data for the onChange event for Rating.\n */\nexport type RatingOnChangeEventData = EventData<'change', React.FormEvent<HTMLDivElement>> & {\n /**\n * The new value of the rating.\n */\n value: number;\n};\n\n/**\n * Rating base props — excludes design props (color, size).\n */\nexport type RatingBaseProps = Omit<RatingProps, 'color' | 'size'>;\n\n/**\n * State used in rendering Rating\n */\nexport type RatingState = ComponentState<RatingSlots> &\n Required<Pick<RatingProps, 'color' | 'iconFilled' | 'iconOutline' | 'name' | 'step' | 'size' | 'value'>> &\n Pick<RatingProps, 'itemLabel'> & {\n hoveredValue?: number | undefined;\n };\n\n/**\n * Rating base state — excludes design props (color, size).\n */\nexport type RatingBaseState = Omit<RatingState, 'color' | 'size'>;\n\nexport type RatingContextValues = {\n ratingItem: RatingItemContextValue;\n};\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}

View File

@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Rating: function() {
return _Rating.Rating;
},
ratingClassNames: function() {
return _useRatingStylesstyles.ratingClassNames;
},
renderRating_unstable: function() {
return _renderRating.renderRating_unstable;
},
useRatingBase_unstable: function() {
return _useRating.useRatingBase_unstable;
},
useRatingContextValues: function() {
return _useRatingContextValues.useRatingContextValues;
},
useRatingStyles_unstable: function() {
return _useRatingStylesstyles.useRatingStyles_unstable;
},
useRating_unstable: function() {
return _useRating.useRating_unstable;
}
});
const _Rating = require("./Rating");
const _renderRating = require("./renderRating");
const _useRating = require("./useRating");
const _useRatingStylesstyles = require("./useRatingStyles.styles");
const _useRatingContextValues = require("./useRatingContextValues");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/index.ts"],"sourcesContent":["export { Rating } from './Rating';\nexport type {\n RatingContextValues,\n RatingOnChangeEventData,\n RatingProps,\n RatingBaseProps,\n RatingSlots,\n RatingState,\n RatingBaseState,\n} from './Rating.types';\nexport { renderRating_unstable } from './renderRating';\nexport { useRating_unstable, useRatingBase_unstable } from './useRating';\nexport { ratingClassNames, useRatingStyles_unstable } from './useRatingStyles.styles';\nexport { useRatingContextValues } from './useRatingContextValues';\n"],"names":["Rating","renderRating_unstable","useRating_unstable","useRatingBase_unstable","ratingClassNames","useRatingStyles_unstable","useRatingContextValues"],"mappings":";;;;;;;;;;;IAASA;6BAAM;;IAYNI;sDAAgB;;;eAFhBH,mCAAqB;;;eACDE,iCAAsB;;;eAE1CG,8CAAsB;;;eADJD,+CAAwB;;;eAD1CH,6BAAkB;;;wBAXJ,WAAW;8BAUI,iBAAiB;2BACI,cAAc;uCACd,2BAA2B;wCAC/C,2BAA2B"}

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderRating_unstable", {
enumerable: true,
get: function() {
return renderRating_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const _RatingItemContext = require("../../contexts/RatingItemContext");
const renderRating_unstable = (state, contextValues)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_RatingItemContext.RatingItemProvider, {
value: contextValues.ratingItem,
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/renderRating.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { RatingBaseState, RatingSlots, RatingContextValues } from './Rating.types';\nimport { RatingItemProvider } from '../../contexts/RatingItemContext';\n\n/**\n * Render the final JSX of Rating\n */\nexport const renderRating_unstable = (state: RatingBaseState, contextValues: RatingContextValues): JSXElement => {\n assertSlots<RatingSlots>(state);\n\n return (\n <RatingItemProvider value={contextValues.ratingItem}>\n <state.root />\n </RatingItemProvider>\n );\n};\n"],"names":["assertSlots","RatingItemProvider","renderRating_unstable","state","contextValues","value","ratingItem","root"],"mappings":";;;;+BAWaE;;;;;;4BAVb,gDAAiD;gCAErB,4BAA4B;mCAGrB,mCAAmC;AAK/D,8BAA8B,CAACC,OAAwBC;QAC5DJ,2BAAAA,EAAyBG;IAEzB,OAAA,WAAA,OACE,eAAA,EAACF,qCAAAA,EAAAA;QAAmBI,OAAOD,cAAcE,UAAU;kBACjD,WAAA,OAAA,eAAA,EAACH,MAAMI,IAAI,EAAA,CAAA;;AAGjB,EAAE"}

View File

@@ -0,0 +1,106 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
useRatingBase_unstable: function() {
return useRatingBase_unstable;
},
useRating_unstable: function() {
return useRating_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _RatingItem = require("../../RatingItem");
const _reacticons = require("@fluentui/react-icons");
const useRating_unstable = (props, ref)=>{
const { color = 'neutral', size = 'extra-large', iconFilled = _reacticons.StarFilled, iconOutline = _reacticons.StarRegular, ...baseProps } = props;
const state = useRatingBase_unstable({
iconFilled,
iconOutline,
...baseProps
}, ref);
return {
...state,
color,
size
};
};
const useRatingBase_unstable = (props, ref)=>{
const generatedName = (0, _reactutilities.useId)('rating-');
const { iconFilled = 'span', iconOutline = 'span', max = 5, name = generatedName, onChange, step = 1, itemLabel } = props;
const [value, setValue] = (0, _reactutilities.useControllableState)({
state: props.value,
defaultState: props.defaultValue,
initialState: 0
});
const isRatingRadioItem = (target)=>(0, _reactutilities.isHTMLElement)(target, {
constructorName: 'HTMLInputElement'
}) && target.type === 'radio' && target.name === name;
const [hoveredValue, setHoveredValue] = _react.useState(undefined);
// Generate the child RatingItems and memoize them to prevent unnecessary re-rendering
const rootChildren = _react.useMemo(()=>{
return Array.from(Array(max), (_, i)=>/*#__PURE__*/ _react.createElement(_RatingItem.RatingItem, {
value: i + 1,
key: i + 1
}));
}, [
max
]);
const state = {
iconFilled,
iconOutline,
name,
step,
itemLabel,
value,
hoveredValue,
components: {
root: 'div'
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
ref,
children: rootChildren,
role: 'radiogroup',
...props
}, [
'onChange'
]), {
elementType: 'div'
})
};
state.root.onChange = (ev)=>{
if (isRatingRadioItem(ev.target)) {
const newValue = parseFloat(ev.target.value);
if (!isNaN(newValue)) {
setValue(newValue);
onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
type: 'change',
event: ev,
value: newValue
});
}
}
};
state.root.onMouseOver = (0, _reactutilities.mergeCallbacks)(props.onMouseOver, (ev)=>{
if (isRatingRadioItem(ev.target)) {
const newValue = parseFloat(ev.target.value);
if (!isNaN(newValue)) {
setHoveredValue(newValue);
}
}
});
state.root.onMouseLeave = (0, _reactutilities.mergeCallbacks)(props.onMouseLeave, (ev)=>{
setHoveredValue(undefined);
});
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,41 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useRatingContextValues", {
enumerable: true,
get: function() {
return useRatingContextValues;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const useRatingContextValues = (ratingState)=>{
const { color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value } = ratingState;
const ratingItem = _react.useMemo(()=>({
color,
hoveredValue,
iconFilled,
iconOutline,
interactive: true,
itemLabel,
name,
step,
size,
value
}), [
color,
hoveredValue,
iconFilled,
iconOutline,
itemLabel,
name,
step,
size,
value
]);
return {
ratingItem
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/useRatingContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { RatingContextValues, RatingState } from './Rating.types';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport const useRatingContextValues = (ratingState: RatingState): RatingContextValues => {\n const { color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value } = ratingState;\n\n const ratingItem = React.useMemo<RatingItemContextValue>(\n () => ({\n color,\n hoveredValue,\n iconFilled,\n iconOutline,\n interactive: true,\n itemLabel,\n name,\n step,\n size,\n value,\n }),\n [color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value],\n );\n\n return { ratingItem };\n};\n"],"names":["React","useRatingContextValues","ratingState","color","hoveredValue","iconFilled","iconOutline","itemLabel","name","step","size","value","ratingItem","useMemo","interactive"],"mappings":"AAAA;;;;;+BAMaC;;;;;;;iEAJU,QAAQ;AAIxB,+BAA+B,CAACC;IACrC,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAEC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGT;IAE7F,MAAMU,aAAaZ,OAAMa,OAAO,CAC9B,IAAO,CAAA;YACLV;YACAC;YACAC;YACAC;YACAQ,aAAa;YACbP;YACAC;YACAC;YACAC;YACAC;SACF,CAAA,EACA;QAACR;QAAOC;QAAcC;QAAYC;QAAaC;QAAWC;QAAMC;QAAMC;QAAMC;KAAM;IAGpF,OAAO;QAAEC;IAAW;AACtB,EAAE"}

View File

@@ -0,0 +1,34 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ratingClassNames: function() {
return ratingClassNames;
},
useRatingStyles_unstable: function() {
return useRatingStyles_unstable;
}
});
const _react = require("@griffel/react");
const ratingClassNames = {
root: 'fui-Rating'
};
/**
* Styles for the root slot
*/ const useRootClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r2imjyh", null, [
".r2imjyh{display:flex;flex-wrap:wrap;}"
]);
const useRatingStyles_unstable = (state)=>{
'use no memo';
const rootClassName = useRootClassName();
state.root.className = (0, _react.mergeClasses)(ratingClassNames.root, rootClassName, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["useRatingStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nexport const ratingClassNames = {\n root: 'fui-Rating'\n};\n/**\n * Styles for the root slot\n */ const useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap'\n});\n/**\n * Apply styling to the Rating slots based on the state\n */ export const useRatingStyles_unstable = (state)=>{\n 'use no memo';\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);\n return state;\n};\n"],"names":["__resetStyles","mergeClasses","ratingClassNames","root","useRootClassName","useRatingStyles_unstable","state","rootClassName","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;oBAEiB;;;4BAWY;;;;uBAZK,gBAAgB;AACvD,MAAME,mBAAmB;IAC5BC,IAAI,EAAE;AACV,CAAC;AACD;;CAEA,GAAI,MAAMC,gBAAgB,GAAA,WAAA,OAAGJ,oBAAA,EAAA,WAAA,MAAA;IAAA;CAG5B,CAAC;AAGS,MAAMK,4BAA4BC,KAAK,IAAG;IACjD,aAAa;IACb,MAAMC,aAAa,GAAGH,gBAAgB,CAAC,CAAC;IACxCE,KAAK,CAACH,IAAI,CAACK,SAAS,OAAGP,mBAAY,EAACC,gBAAgB,CAACC,IAAI,EAAEI,aAAa,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;IAC/F,OAAOF,KAAK;AAChB,CAAC"}

View File

@@ -0,0 +1,35 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ratingClassNames: function() {
return ratingClassNames;
},
useRatingStyles_unstable: function() {
return useRatingStyles_unstable;
}
});
const _react = require("@griffel/react");
const ratingClassNames = {
root: 'fui-Rating'
};
/**
* Styles for the root slot
*/ const useRootClassName = (0, _react.makeResetStyles)({
display: 'flex',
flexWrap: 'wrap'
});
const useRatingStyles_unstable = (state)=>{
'use no memo';
const rootClassName = useRootClassName();
state.root.className = (0, _react.mergeClasses)(ratingClassNames.root, rootClassName, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/useRatingStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingSlots, RatingState } from './Rating.types';\n\nexport const ratingClassNames: SlotClassNames<RatingSlots> = {\n root: 'fui-Rating',\n};\n\n/**\n * Styles for the root slot\n */\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\n/**\n * Apply styling to the Rating slots based on the state\n */\nexport const useRatingStyles_unstable = (state: RatingState): RatingState => {\n 'use no memo';\n\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","ratingClassNames","root","useRootClassName","display","flexWrap","useRatingStyles_unstable","state","rootClassName","className"],"mappings":"AAAA;;;;;;;;;;;;oBAMaE;;;IAgBAK,wBAAAA;;;;uBApBiC,iBAAiB;AAIxD,MAAML,mBAAgD;IAC3DC,MAAM;AACR,EAAE;AAEF;;CAEC,GAED,MAAMC,uBAAmBJ,sBAAAA,EAAgB;IACvCK,SAAS;IACTC,UAAU;AACZ;AAKO,iCAAiC,CAACE;IACvC;IAEA,MAAMC,gBAAgBL;IACtBI,MAAML,IAAI,CAACO,SAAS,OAAGT,mBAAAA,EAAaC,iBAAiBC,IAAI,EAAEM,eAAeD,MAAML,IAAI,CAACO,SAAS;IAC9F,OAAOF;AACT,EAAE"}

View File

@@ -0,0 +1,26 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "RatingDisplay", {
enumerable: true,
get: function() {
return RatingDisplay;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useRatingDisplay = require("./useRatingDisplay");
const _renderRatingDisplay = require("./renderRatingDisplay");
const _useRatingDisplayStylesstyles = require("./useRatingDisplayStyles.styles");
const _useRatingDisplayContextValues = require("./useRatingDisplayContextValues");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const RatingDisplay = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useRatingDisplay.useRatingDisplay_unstable)(props, ref);
const contextValues = (0, _useRatingDisplayContextValues.useRatingDisplayContextValues)(state);
(0, _useRatingDisplayStylesstyles.useRatingDisplayStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useRatingDisplayStyles_unstable')(state);
return (0, _renderRatingDisplay.renderRatingDisplay_unstable)(state, contextValues);
});
RatingDisplay.displayName = 'RatingDisplay';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/RatingDisplay.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useRatingDisplay_unstable } from './useRatingDisplay';\nimport { renderRatingDisplay_unstable } from './renderRatingDisplay';\nimport { useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';\nimport type { RatingDisplayProps } from './RatingDisplay.types';\nimport { useRatingDisplayContextValues } from './useRatingDisplayContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * RatingDisplay is a wrapper for one or more rating items that will be used to display a rating value\n * as well as the label for the rating.\n */\nexport const RatingDisplay: ForwardRefComponent<RatingDisplayProps> = React.forwardRef((props, ref) => {\n const state = useRatingDisplay_unstable(props, ref);\n const contextValues = useRatingDisplayContextValues(state);\n\n useRatingDisplayStyles_unstable(state);\n useCustomStyleHook_unstable('useRatingDisplayStyles_unstable')(state);\n\n return renderRatingDisplay_unstable(state, contextValues);\n});\n\nRatingDisplay.displayName = 'RatingDisplay';\n"],"names":["React","useRatingDisplay_unstable","renderRatingDisplay_unstable","useRatingDisplayStyles_unstable","useRatingDisplayContextValues","useCustomStyleHook_unstable","RatingDisplay","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;kCAEW,qBAAqB;qCAClB,wBAAwB;8CACrB,kCAAkC;+CAEpC,kCAAkC;qCACpC,kCAAkC;AAMvE,MAAMM,gBAAAA,WAAAA,GAAyDN,OAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,YAAQT,2CAAAA,EAA0BO,OAAOC;IAC/C,MAAME,oBAAgBP,4DAAAA,EAA8BM;QAEpDP,6DAAAA,EAAgCO;QAChCL,gDAAAA,EAA4B,mCAAmCK;IAE/D,WAAOR,iDAAAA,EAA6BQ,OAAOC;AAC7C,GAAG;AAEHL,cAAcM,WAAW,GAAG"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/RatingDisplay.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport type RatingDisplaySlots = {\n root: NonNullable<Slot<'div'>>;\n valueText?: Slot<'span'>;\n countText?: Slot<'span'>;\n};\n\n/**\n * RatingDisplay Props\n */\nexport type RatingDisplayProps = ComponentProps<RatingDisplaySlots> & {\n /**\n * Color of the rating items (stars).\n * @default neutral\n */\n color?: 'brand' | 'marigold' | 'neutral';\n /**\n * Renders a single filled star, with the value written next to it.\n * @default false\n */\n compact?: boolean;\n /**\n * The number of ratings represented by the rating value.\n * This will be formatted with a thousands separator (if applicable) and displayed next to the value.\n */\n count?: number;\n /**\n * The icon used for rating items.\n * @default StarFilled\n */\n icon?: React.ElementType;\n /**\n * The max value of the rating. This controls the number of rating items displayed.\n * Must be a whole number greater than 1.\n * @default 5\n */\n max?: number;\n /**\n * Sets the size of the RatingDisplay items.\n * @default medium\n */\n size?: 'small' | 'medium' | 'large' | 'extra-large';\n /**\n * The value of the rating\n */\n value?: number;\n};\n\n/**\n * RatingDisplay base props — excludes design props (color, size).\n */\nexport type RatingDisplayBaseProps = Omit<RatingDisplayProps, 'color' | 'size'>;\n\n/**\n * State used in rendering RatingDisplay\n */\nexport type RatingDisplayState = ComponentState<RatingDisplaySlots> &\n Required<Pick<RatingDisplayProps, 'color' | 'compact' | 'icon' | 'max' | 'size'>> &\n Pick<RatingDisplayProps, 'value'>;\n\n/**\n * RatingDisplay base state — excludes design props (color, size).\n */\nexport type RatingDisplayBaseState = Omit<RatingDisplayState, 'color' | 'size' | 'icon'> &\n Pick<RatingDisplayProps, 'icon'>;\n\nexport type RatingDisplayContextValues = { ratingItem: RatingItemContextValue };\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}

View File

@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
RatingDisplay: function() {
return _RatingDisplay.RatingDisplay;
},
ratingDisplayClassNames: function() {
return _useRatingDisplayStylesstyles.ratingDisplayClassNames;
},
renderRatingDisplay_unstable: function() {
return _renderRatingDisplay.renderRatingDisplay_unstable;
},
useRatingDisplayBase_unstable: function() {
return _useRatingDisplay.useRatingDisplayBase_unstable;
},
useRatingDisplayContextValues: function() {
return _useRatingDisplayContextValues.useRatingDisplayContextValues;
},
useRatingDisplayStyles_unstable: function() {
return _useRatingDisplayStylesstyles.useRatingDisplayStyles_unstable;
},
useRatingDisplay_unstable: function() {
return _useRatingDisplay.useRatingDisplay_unstable;
}
});
const _RatingDisplay = require("./RatingDisplay");
const _renderRatingDisplay = require("./renderRatingDisplay");
const _useRatingDisplay = require("./useRatingDisplay");
const _useRatingDisplayStylesstyles = require("./useRatingDisplayStyles.styles");
const _useRatingDisplayContextValues = require("./useRatingDisplayContextValues");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/index.ts"],"sourcesContent":["export { RatingDisplay } from './RatingDisplay';\nexport type {\n RatingDisplayContextValues,\n RatingDisplayProps,\n RatingDisplayBaseProps,\n RatingDisplaySlots,\n RatingDisplayState,\n RatingDisplayBaseState,\n} from './RatingDisplay.types';\nexport { renderRatingDisplay_unstable } from './renderRatingDisplay';\nexport { useRatingDisplay_unstable, useRatingDisplayBase_unstable } from './useRatingDisplay';\nexport { ratingDisplayClassNames, useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';\nexport { useRatingDisplayContextValues } from './useRatingDisplayContextValues';\n"],"names":["RatingDisplay","renderRatingDisplay_unstable","useRatingDisplay_unstable","useRatingDisplayBase_unstable","ratingDisplayClassNames","useRatingDisplayStyles_unstable","useRatingDisplayContextValues"],"mappings":";;;;;;;;;;;IAASA;2CAAa;;IAWbI;oEAAuB;;;eAFvBH,iDAA4B;;;eACDE,+CAA6B;;;eAExDG,4DAA6B;;;eADJD,6DAA+B;;;eADxDH,2CAAyB;;;+BAVJ,kBAAkB;qCASH,wBAAwB;kCACI,qBAAqB;8CACrB,kCAAkC;+CAC7D,kCAAkC"}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderRatingDisplay_unstable", {
enumerable: true,
get: function() {
return renderRatingDisplay_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const _RatingItemContext = require("../../contexts/RatingItemContext");
const renderRatingDisplay_unstable = (state, contextValues)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_RatingItemContext.RatingItemProvider, {
value: contextValues.ratingItem,
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
state.root.children,
state.valueText && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.valueText, {}),
state.countText && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.countText, {})
]
})
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/renderRatingDisplay.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { RatingDisplayBaseState, RatingDisplaySlots, RatingDisplayContextValues } from './RatingDisplay.types';\nimport { RatingItemProvider } from '../../contexts/RatingItemContext';\n\n/**\n * Render the final JSX of RatingDisplay\n */\nexport const renderRatingDisplay_unstable = (\n state: RatingDisplayBaseState,\n contextValues: RatingDisplayContextValues,\n): JSXElement => {\n assertSlots<RatingDisplaySlots>(state);\n\n return (\n <RatingItemProvider value={contextValues.ratingItem}>\n <state.root>\n {state.root.children}\n {state.valueText && <state.valueText />}\n {state.countText && <state.countText />}\n </state.root>\n </RatingItemProvider>\n );\n};\n"],"names":["assertSlots","RatingItemProvider","renderRatingDisplay_unstable","state","contextValues","value","ratingItem","root","children","valueText","countText"],"mappings":";;;;+BAWaE;;;;;;4BAVb,iCAAiD;gCAErB,4BAA4B;mCAGrB,mCAAmC;AAK/D,qCAAqC,CAC1CC,OACAC;QAEAJ,2BAAAA,EAAgCG;IAEhC,OAAA,WAAA,OACE,eAAA,EAACF,qCAAAA,EAAAA;QAAmBI,OAAOD,cAAcE,UAAU;kBACjD,WAAA,OAAA,gBAAA,EAACH,MAAMI,IAAI,EAAA;;gBACRJ,MAAMI,IAAI,CAACC,QAAQ;gBACnBL,MAAMM,SAAS,IAAA,WAAA,OAAI,eAAA,EAACN,MAAMM,SAAS,EAAA,CAAA;gBACnCN,MAAMO,SAAS,IAAA,WAAA,OAAI,eAAA,EAACP,MAAMO,SAAS,EAAA,CAAA;;;;AAI5C,EAAE"}

View File

@@ -0,0 +1,102 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
useRatingDisplayBase_unstable: function() {
return useRatingDisplayBase_unstable;
},
useRatingDisplay_unstable: function() {
return useRatingDisplay_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _reacticons = require("@fluentui/react-icons");
const _RatingItem = require("../RatingItem/RatingItem");
const useRatingDisplay_unstable = (props, ref)=>{
const { color = 'neutral', size = 'medium', icon = _reacticons.StarFilled, ...baseProps } = props;
const state = useRatingDisplayBase_unstable({
icon,
...baseProps
}, ref);
return {
...state,
icon,
color,
size
};
};
const useRatingDisplayBase_unstable = (props, ref)=>{
const { count, compact = false, icon, max = 5, value } = props;
const valueTextId = (0, _reactutilities.useId)('rating-value-');
const countTextId = (0, _reactutilities.useId)('rating-count-');
// Generate the child RatingItems and memoize them to prevent unnecessary re-rendering
const rootChildren = _react.useMemo(()=>{
return compact ? /*#__PURE__*/ _react.createElement(_RatingItem.RatingItem, {
value: 1,
key: 1,
"aria-hidden": true
}) : Array.from(Array(max), (_, i)=>/*#__PURE__*/ _react.createElement(_RatingItem.RatingItem, {
value: i + 1,
key: i + 1,
"aria-hidden": true
}));
}, [
compact,
max
]);
const state = {
compact,
icon,
max,
value,
components: {
root: 'div',
valueText: 'span',
countText: 'span'
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
ref,
children: rootChildren,
role: 'img',
...props
}), {
elementType: 'div'
}),
valueText: _reactutilities.slot.optional(props.valueText, {
renderByDefault: value !== undefined,
defaultProps: {
children: value,
id: valueTextId,
'aria-hidden': true
},
elementType: 'span'
}),
countText: _reactutilities.slot.optional(props.countText, {
renderByDefault: count !== undefined,
defaultProps: {
children: count === null || count === void 0 ? void 0 : count.toLocaleString(),
id: countTextId,
'aria-hidden': true
},
elementType: 'span'
})
};
if (!state.root['aria-label'] && !state.root['aria-labelledby']) {
var _state_valueText, _state_countText;
state.root['aria-labelledby'] = [
(_state_valueText = state.valueText) === null || _state_valueText === void 0 ? void 0 : _state_valueText.id,
(_state_countText = state.countText) === null || _state_countText === void 0 ? void 0 : _state_countText.id
].filter(Boolean).join(' ');
}
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,35 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useRatingDisplayContextValues", {
enumerable: true,
get: function() {
return useRatingDisplayContextValues;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const useRatingDisplayContextValues = (state)=>{
const { color, compact, icon, size, value } = state;
const ratingItem = _react.useMemo(()=>({
color,
compact,
iconFilled: icon,
iconOutline: icon,
interactive: false,
step: 0.5,
size,
value
}), [
color,
compact,
icon,
size,
value
]);
return {
ratingItem
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { RatingDisplayContextValues, RatingDisplayState } from './RatingDisplay.types';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport const useRatingDisplayContextValues = (state: RatingDisplayState): RatingDisplayContextValues => {\n const { color, compact, icon, size, value } = state;\n\n const ratingItem = React.useMemo<RatingItemContextValue>(\n () => ({\n color,\n compact,\n iconFilled: icon,\n iconOutline: icon,\n interactive: false,\n step: 0.5,\n size,\n value,\n }),\n [color, compact, icon, size, value],\n );\n\n return { ratingItem };\n};\n"],"names":["React","useRatingDisplayContextValues","state","color","compact","icon","size","value","ratingItem","useMemo","iconFilled","iconOutline","interactive","step"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;AAIxB,MAAMC,gCAAgC,CAACC;IAC5C,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGL;IAE9C,MAAMM,aAAaR,OAAMS,OAAO,CAC9B,IAAO,CAAA;YACLN;YACAC;YACAM,YAAYL;YACZM,aAAaN;YACbO,aAAa;YACbC,MAAM;YACNP;YACAC;SACF,CAAA,EACA;QAACJ;QAAOC;QAASC;QAAMC;QAAMC;KAAM;IAGrC,OAAO;QAAEC;IAAW;AACtB,EAAE"}

View File

@@ -0,0 +1,86 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ratingDisplayClassNames: function() {
return ratingDisplayClassNames;
},
useRatingDisplayStyles_unstable: function() {
return useRatingDisplayStyles_unstable;
}
});
const _react = require("@griffel/react");
const ratingDisplayClassNames = {
root: 'fui-RatingDisplay',
valueText: 'fui-RatingDisplay__valueText',
countText: 'fui-RatingDisplay__countText'
};
/**
* Styles for the root slot
*/ const useRootClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rxxdqwu", null, [
".rxxdqwu{display:flex;flex-wrap:wrap;align-items:center;}"
]);
const useLabelClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rkwnos5", "rwei36a", [
".rkwnos5{color:var(--colorNeutralForeground1);margin-left:var(--spacingHorizontalXS);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}",
".rwei36a{color:var(--colorNeutralForeground1);margin-right:var(--spacingHorizontalXS);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"
]);
const useLabelStyles = /*#__PURE__*/ (0, _react.__styles)({
large: {
Be2twd7: "fkhj508",
Bg96gwp: "f1i3iumi",
Frg6f3: [
"f1t5qyk5",
"f1ikr372"
]
},
extraLarge: {
Be2twd7: "fod5ikn",
Bg96gwp: "faaz57k",
Frg6f3: [
"foyynoy",
"f1vcna3q"
]
},
strong: {
Bhrd7zp: "fl43uef"
},
divider: {
Ftih45: "f169p45e"
}
}, {
d: [
".fkhj508{font-size:var(--fontSizeBase300);}",
".f1i3iumi{line-height:var(--lineHeightBase300);}",
".f1t5qyk5{margin-left:var(--spacingHorizontalSNudge);}",
".f1ikr372{margin-right:var(--spacingHorizontalSNudge);}",
".fod5ikn{font-size:var(--fontSizeBase400);}",
".faaz57k{line-height:var(--lineHeightBase400);}",
".foyynoy{margin-left:var(--spacingHorizontalS);}",
".f1vcna3q{margin-right:var(--spacingHorizontalS);}",
".fl43uef{font-weight:var(--fontWeightSemibold);}",
".f169p45e::before{content:\"\xB7 \";}"
]
});
const useRatingDisplayStyles_unstable = (state)=>{
'use no memo';
const { size } = state;
const rootClassName = useRootClassName();
state.root.className = (0, _react.mergeClasses)(ratingDisplayClassNames.root, rootClassName, state.root.className);
const labelClassName = useLabelClassName();
const labelStyles = useLabelStyles();
if (state.valueText) {
state.valueText.className = (0, _react.mergeClasses)(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);
}
if (state.countText) {
state.countText.className = (0, _react.mergeClasses)(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["useRatingDisplayStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const ratingDisplayClassNames = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText'\n};\n/**\n * Styles for the root slot\n */ const useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center'\n});\nconst useLabelClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n marginLeft: tokens.spacingHorizontalXS,\n ...typographyStyles.caption1\n});\nconst useLabelStyles = makeStyles({\n large: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n marginLeft: tokens.spacingHorizontalSNudge\n },\n extraLarge: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n marginLeft: tokens.spacingHorizontalS\n },\n strong: {\n fontWeight: tokens.fontWeightSemibold\n },\n divider: {\n '::before': {\n content: '\"· \"'\n }\n }\n});\n/**\n * Apply styling to the RatingDisplay slots based on the state\n */ export const useRatingDisplayStyles_unstable = (state)=>{\n 'use no memo';\n const { size } = state;\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);\n const labelClassName = useLabelClassName();\n const labelStyles = useLabelStyles();\n if (state.valueText) {\n state.valueText.className = mergeClasses(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);\n }\n if (state.countText) {\n state.countText.className = mergeClasses(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);\n }\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","tokens","typographyStyles","ratingDisplayClassNames","root","valueText","countText","useRootClassName","useLabelClassName","useLabelStyles","large","Be2twd7","Bg96gwp","Frg6f3","extraLarge","strong","Bhrd7zp","divider","Ftih45","d","useRatingDisplayStyles_unstable","state","size","rootClassName","className","labelClassName","labelStyles"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAGCK,uBAAuB;;;mCAuCY;eAA/BiB;;;uBAzCyC,gBAAgB;AAEnE,gCAAgC;IACnChB,IAAI,EAAE,mBAAmB;IACzBC,SAAS,EAAE,8BAA8B;IACzCC,SAAS,EAAE;AACf,CAAC;AACD;;CAEA,GAAI,MAAMC,gBAAgB,GAAA,WAAA,OAAGT,oBAAA,EAAA,WAAA,MAAA;IAAA;CAI5B,CAAC;AACF,MAAMU,iBAAiB,GAAA,WAAA,OAAGV,oBAAA,EAAA,WAAA,WAAA;IAAA;IAAA;CAIzB,CAAC;AACF,MAAMW,cAAc,GAAA,WAAA,OAAGV,eAAA,EAAA;IAAAW,KAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;IAAA;IAAAC,UAAA,EAAA;QAAAH,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;IAAA;IAAAE,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA,CAmBtB,CAAC;AAGS,yCAAyCE,KAAK,IAAG;IACxD,aAAa;IACb,MAAM,EAAEC,IAAAA,EAAM,GAAGD,KAAK;IACtB,MAAME,aAAa,GAAGhB,gBAAgB,CAAC,CAAC;IACxCc,KAAK,CAACjB,IAAI,CAACoB,SAAS,GAAGxB,uBAAY,EAACG,uBAAuB,CAACC,IAAI,EAAEmB,aAAa,EAAEF,KAAK,CAACjB,IAAI,CAACoB,SAAS,CAAC;IACtG,MAAMC,cAAc,GAAGjB,iBAAiB,CAAC,CAAC;IAC1C,MAAMkB,WAAW,GAAGjB,cAAc,CAAC,CAAC;IACpC,IAAIY,KAAK,CAAChB,SAAS,EAAE;QACjBgB,KAAK,CAAChB,SAAS,CAACmB,SAAS,OAAGxB,mBAAY,EAACG,uBAAuB,CAACE,SAAS,EAAEoB,cAAc,EAAEC,WAAW,CAACX,MAAM,EAAEO,IAAI,KAAK,OAAO,IAAII,WAAW,CAAChB,KAAK,EAAEY,IAAI,KAAK,aAAa,IAAII,WAAW,CAACZ,UAAU,EAAEO,KAAK,CAAChB,SAAS,CAACmB,SAAS,CAAC;IACvO;IACA,IAAIH,KAAK,CAACf,SAAS,EAAE;QACjBe,KAAK,CAACf,SAAS,CAACkB,SAAS,OAAGxB,mBAAY,EAACG,uBAAuB,CAACG,SAAS,EAAEmB,cAAc,EAAEH,IAAI,KAAK,OAAO,IAAII,WAAW,CAAChB,KAAK,EAAEY,IAAI,KAAK,aAAa,IAAII,WAAW,CAACZ,UAAU,EAAEO,KAAK,CAAChB,SAAS,IAAIqB,WAAW,CAACT,OAAO,EAAEI,KAAK,CAACf,SAAS,CAACkB,SAAS,CAAC;IAC3P;IACA,OAAOH,KAAK;AAChB,CAAC"}

View File

@@ -0,0 +1,73 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ratingDisplayClassNames: function() {
return ratingDisplayClassNames;
},
useRatingDisplayStyles_unstable: function() {
return useRatingDisplayStyles_unstable;
}
});
const _react = require("@griffel/react");
const _reacttheme = require("@fluentui/react-theme");
const ratingDisplayClassNames = {
root: 'fui-RatingDisplay',
valueText: 'fui-RatingDisplay__valueText',
countText: 'fui-RatingDisplay__countText'
};
/**
* Styles for the root slot
*/ const useRootClassName = (0, _react.makeResetStyles)({
display: 'flex',
flexWrap: 'wrap',
alignItems: 'center'
});
const useLabelClassName = (0, _react.makeResetStyles)({
color: _reacttheme.tokens.colorNeutralForeground1,
marginLeft: _reacttheme.tokens.spacingHorizontalXS,
..._reacttheme.typographyStyles.caption1
});
const useLabelStyles = (0, _react.makeStyles)({
large: {
fontSize: _reacttheme.tokens.fontSizeBase300,
lineHeight: _reacttheme.tokens.lineHeightBase300,
marginLeft: _reacttheme.tokens.spacingHorizontalSNudge
},
extraLarge: {
fontSize: _reacttheme.tokens.fontSizeBase400,
lineHeight: _reacttheme.tokens.lineHeightBase400,
marginLeft: _reacttheme.tokens.spacingHorizontalS
},
strong: {
fontWeight: _reacttheme.tokens.fontWeightSemibold
},
divider: {
'::before': {
content: '"· "'
}
}
});
const useRatingDisplayStyles_unstable = (state)=>{
'use no memo';
const { size } = state;
const rootClassName = useRootClassName();
state.root.className = (0, _react.mergeClasses)(ratingDisplayClassNames.root, rootClassName, state.root.className);
const labelClassName = useLabelClassName();
const labelStyles = useLabelStyles();
if (state.valueText) {
state.valueText.className = (0, _react.mergeClasses)(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);
}
if (state.countText) {
state.countText.className = (0, _react.mergeClasses)(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingDisplaySlots, RatingDisplayState } from './RatingDisplay.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n\nexport const ratingDisplayClassNames: SlotClassNames<RatingDisplaySlots> = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText',\n};\n\n/**\n * Styles for the root slot\n */\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n});\n\nconst useLabelClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n marginLeft: tokens.spacingHorizontalXS,\n ...typographyStyles.caption1,\n});\n\nconst useLabelStyles = makeStyles({\n large: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n marginLeft: tokens.spacingHorizontalSNudge,\n },\n extraLarge: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n marginLeft: tokens.spacingHorizontalS,\n },\n strong: {\n fontWeight: tokens.fontWeightSemibold,\n },\n divider: {\n '::before': {\n content: '\"· \"',\n },\n },\n});\n\n/**\n * Apply styling to the RatingDisplay slots based on the state\n */\nexport const useRatingDisplayStyles_unstable = (state: RatingDisplayState): RatingDisplayState => {\n 'use no memo';\n\n const { size } = state;\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);\n const labelClassName = useLabelClassName();\n const labelStyles = useLabelStyles();\n\n if (state.valueText) {\n state.valueText.className = mergeClasses(\n ratingDisplayClassNames.valueText,\n labelClassName,\n labelStyles.strong,\n size === 'large' && labelStyles.large,\n size === 'extra-large' && labelStyles.extraLarge,\n state.valueText.className,\n );\n }\n if (state.countText) {\n state.countText.className = mergeClasses(\n ratingDisplayClassNames.countText,\n labelClassName,\n size === 'large' && labelStyles.large,\n size === 'extra-large' && labelStyles.extraLarge,\n state.valueText && labelStyles.divider,\n state.countText.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","typographyStyles","ratingDisplayClassNames","root","valueText","countText","useRootClassName","display","flexWrap","alignItems","useLabelClassName","color","colorNeutralForeground1","marginLeft","spacingHorizontalXS","caption1","useLabelStyles","large","fontSize","fontSizeBase300","lineHeight","lineHeightBase300","spacingHorizontalSNudge","extraLarge","fontSizeBase400","lineHeightBase400","spacingHorizontalS","strong","fontWeight","fontWeightSemibold","divider","content","useRatingDisplayStyles_unstable","state","size","rootClassName","className","labelClassName","labelStyles"],"mappings":"AAAA;;;;;;;;;;;;IAOaK,uBAAAA;;;mCA8CA8B;eAAAA;;;uBAnD6C,iBAAiB;4BAGlC,wBAAwB;AAE1D,gCAAoE;IACzE7B,MAAM;IACNC,WAAW;IACXC,WAAW;AACb,EAAE;AAEF;;CAEC,GAED,MAAMC,uBAAmBT,sBAAAA,EAAgB;IACvCU,SAAS;IACTC,UAAU;IACVC,YAAY;AACd;AAEA,MAAMC,wBAAoBb,sBAAAA,EAAgB;IACxCc,OAAOX,kBAAAA,CAAOY,uBAAuB;IACrCC,YAAYb,kBAAAA,CAAOc,mBAAmB;IACtC,GAAGb,4BAAAA,CAAiBc,QAAQ;AAC9B;AAEA,MAAMC,qBAAiBlB,iBAAAA,EAAW;IAChCmB,OAAO;QACLC,UAAUlB,kBAAAA,CAAOmB,eAAe;QAChCC,YAAYpB,kBAAAA,CAAOqB,iBAAiB;QACpCR,YAAYb,kBAAAA,CAAOsB,uBAAuB;IAC5C;IACAC,YAAY;QACVL,UAAUlB,kBAAAA,CAAOwB,eAAe;QAChCJ,YAAYpB,kBAAAA,CAAOyB,iBAAiB;QACpCZ,YAAYb,kBAAAA,CAAO0B,kBAAkB;IACvC;IACAC,QAAQ;QACNC,YAAY5B,kBAAAA,CAAO6B,kBAAkB;IACvC;IACAC,SAAS;QACP,YAAY;YACVC,SAAS;QACX;IACF;AACF;AAKO,wCAAwC,CAACE;IAC9C;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAME,gBAAgB7B;IACtB2B,MAAM9B,IAAI,CAACiC,SAAS,OAAGrC,mBAAAA,EAAaG,wBAAwBC,IAAI,EAAEgC,eAAeF,MAAM9B,IAAI,CAACiC,SAAS;IACrG,MAAMC,iBAAiB3B;IACvB,MAAM4B,cAActB;IAEpB,IAAIiB,MAAM7B,SAAS,EAAE;QACnB6B,MAAM7B,SAAS,CAACgC,SAAS,OAAGrC,mBAAAA,EAC1BG,wBAAwBE,SAAS,EACjCiC,gBACAC,YAAYX,MAAM,EAClBO,SAAS,WAAWI,YAAYrB,KAAK,EACrCiB,SAAS,iBAAiBI,YAAYf,UAAU,EAChDU,MAAM7B,SAAS,CAACgC,SAAS;IAE7B;IACA,IAAIH,MAAM5B,SAAS,EAAE;QACnB4B,MAAM5B,SAAS,CAAC+B,SAAS,OAAGrC,mBAAAA,EAC1BG,wBAAwBG,SAAS,EACjCgC,gBACAH,SAAS,WAAWI,YAAYrB,KAAK,EACrCiB,SAAS,iBAAiBI,YAAYf,UAAU,EAChDU,MAAM7B,SAAS,IAAIkC,YAAYR,OAAO,EACtCG,MAAM5B,SAAS,CAAC+B,SAAS;IAE7B;IAEA,OAAOH;AACT,EAAE"}

View File

@@ -0,0 +1,24 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "RatingItem", {
enumerable: true,
get: function() {
return RatingItem;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useRatingItem = require("./useRatingItem");
const _renderRatingItem = require("./renderRatingItem");
const _useRatingItemStylesstyles = require("./useRatingItemStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const RatingItem = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useRatingItem.useRatingItem_unstable)(props, ref);
(0, _useRatingItemStylesstyles.useRatingItemStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useRatingItemStyles_unstable')(state);
return (0, _renderRatingItem.renderRatingItem_unstable)(state);
});
RatingItem.displayName = 'RatingItem';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingItem/RatingItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useRatingItem_unstable } from './useRatingItem';\nimport { renderRatingItem_unstable } from './renderRatingItem';\nimport { useRatingItemStyles_unstable } from './useRatingItemStyles.styles';\nimport type { RatingItemProps } from './RatingItem.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * RatingItem is an item that will be used to set or display a rating value.\n */\nexport const RatingItem: ForwardRefComponent<RatingItemProps> = React.forwardRef((props, ref) => {\n const state = useRatingItem_unstable(props, ref);\n\n useRatingItemStyles_unstable(state);\n useCustomStyleHook_unstable('useRatingItemStyles_unstable')(state);\n\n return renderRatingItem_unstable(state);\n});\n\nRatingItem.displayName = 'RatingItem';\n"],"names":["React","useRatingItem_unstable","renderRatingItem_unstable","useRatingItemStyles_unstable","useCustomStyleHook_unstable","RatingItem","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;+BAEQ,kBAAkB;kCACf,qBAAqB;2CAClB,+BAA+B;qCAEhC,kCAAkC;AAKvE,MAAMK,aAAAA,WAAAA,GAAmDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,YAAQR,qCAAAA,EAAuBM,OAAOC;QAE5CL,uDAAAA,EAA6BM;QAC7BL,gDAAAA,EAA4B,gCAAgCK;IAE5D,WAAOP,2CAAAA,EAA0BO;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingItem/RatingItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { RatingState } from '../Rating/Rating.types';\nimport { RatingDisplayState } from '../RatingDisplay/RatingDisplay.types';\n\nexport type RatingItemSlots = {\n /**\n * The root slot of the RatingItem.\n * Default html element is span\n */\n root: NonNullable<Slot<'span'>>;\n /**\n * Icon displayed when the rating value is greater than or equal to the item's value.\n */\n selectedIcon?: NonNullable<Slot<'div'>>;\n /**\n * Icon displayed when the rating value is less than the item's value.\n */\n unselectedIcon?: NonNullable<Slot<'div'>>;\n /**\n * Radio input slot used for half star precision\n */\n halfValueInput?: NonNullable<Slot<'input'>>;\n /**\n * Radio input slot used for full star precision\n */\n fullValueInput?: NonNullable<Slot<'input'>>;\n};\n\n/**\n * RatingItem Props\n */\nexport type RatingItemProps = ComponentProps<Partial<RatingItemSlots>> & {\n /**\n * The positive whole number value that is displayed by this RatingItem\n */\n value?: number;\n};\n\n/**\n * RatingItem base props — same as RatingItemProps (no design-only props at this level).\n */\nexport type RatingItemBaseProps = RatingItemProps;\n\n/**\n * State used in rendering RatingItem\n */\nexport type RatingItemState = ComponentState<RatingItemSlots> &\n Required<Pick<RatingItemProps, 'value'>> &\n Pick<RatingState, 'color' | 'step' | 'size'> & {\n iconFillWidth: number;\n appearance: 'outline' | 'filled';\n };\n\n/**\n * RatingItem base state — excludes design props (color, size) from context.\n */\nexport type RatingItemBaseState = Omit<RatingItemState, 'color' | 'size'>;\n\nexport type RatingItemContextValue = Partial<Pick<RatingState, 'name' | 'hoveredValue' | 'value'>> &\n Pick<RatingState, 'color' | 'iconFilled' | 'iconOutline' | 'itemLabel' | 'step' | 'size'> &\n Partial<Pick<RatingDisplayState, 'compact'>> & {\n interactive?: boolean;\n };\n"],"names":[],"mappings":""}

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
RatingItem: function() {
return _RatingItem.RatingItem;
},
ratingItemClassNames: function() {
return _useRatingItemStylesstyles.ratingItemClassNames;
},
renderRatingItem_unstable: function() {
return _renderRatingItem.renderRatingItem_unstable;
},
useRatingItemBase_unstable: function() {
return _useRatingItem.useRatingItemBase_unstable;
},
useRatingItemStyles_unstable: function() {
return _useRatingItemStylesstyles.useRatingItemStyles_unstable;
},
useRatingItem_unstable: function() {
return _useRatingItem.useRatingItem_unstable;
}
});
const _RatingItem = require("./RatingItem");
const _renderRatingItem = require("./renderRatingItem");
const _useRatingItem = require("./useRatingItem");
const _useRatingItemStylesstyles = require("./useRatingItemStyles.styles");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingItem/index.ts"],"sourcesContent":["export { RatingItem } from './RatingItem';\nexport type {\n RatingItemContextValue,\n RatingItemProps,\n RatingItemBaseProps,\n RatingItemSlots,\n RatingItemState,\n RatingItemBaseState,\n} from './RatingItem.types';\nexport { renderRatingItem_unstable } from './renderRatingItem';\nexport { useRatingItem_unstable, useRatingItemBase_unstable } from './useRatingItem';\nexport { ratingItemClassNames, useRatingItemStyles_unstable } from './useRatingItemStyles.styles';\n"],"names":["RatingItem","renderRatingItem_unstable","useRatingItem_unstable","useRatingItemBase_unstable","ratingItemClassNames","useRatingItemStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,sBAAU;;;eAWVI,+CAAoB;;;eAFpBH,2CAAyB;;;eACDE,yCAA0B;;;eAC5BE,uDAA4B;;;eADlDH,qCAAsB;;;4BAVJ,eAAe;kCASA,qBAAqB;+BACI,kBAAkB;2CAClB,+BAA+B"}

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderRatingItem_unstable", {
enumerable: true,
get: function() {
return renderRatingItem_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderRatingItem_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
state.halfValueInput && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.halfValueInput, {}),
state.fullValueInput && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.fullValueInput, {}),
state.unselectedIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.unselectedIcon, {}),
state.selectedIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.selectedIcon, {})
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingItem/renderRatingItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { RatingItemBaseState, RatingItemSlots } from './RatingItem.types';\n\n/**\n * Render the final JSX of RatingItem\n */\nexport const renderRatingItem_unstable = (state: RatingItemBaseState): JSXElement => {\n assertSlots<RatingItemSlots>(state);\n\n return (\n <state.root>\n {state.halfValueInput && <state.halfValueInput />}\n {state.fullValueInput && <state.fullValueInput />}\n {state.unselectedIcon && <state.unselectedIcon />}\n {state.selectedIcon && <state.selectedIcon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderRatingItem_unstable","state","root","halfValueInput","fullValueInput","unselectedIcon","selectedIcon"],"mappings":";;;;+BAUaC;;;;;;4BATb,iCAAiD;gCAErB,4BAA4B;AAOjD,kCAAkC,CAACC;QACxCF,2BAAAA,EAA6BE;IAE7B,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;YACRD,MAAME,cAAc,IAAA,WAAA,OAAI,eAAA,EAACF,MAAME,cAAc,EAAA,CAAA;YAC7CF,MAAMG,cAAc,IAAA,WAAA,OAAI,eAAA,EAACH,MAAMG,cAAc,EAAA,CAAA;YAC7CH,MAAMI,cAAc,IAAA,WAAA,OAAI,eAAA,EAACJ,MAAMI,cAAc,EAAA,CAAA;YAC7CJ,MAAMK,YAAY,IAAA,WAAA,OAAI,eAAA,EAACL,MAAMK,YAAY,EAAA,CAAA;;;AAGhD,EAAE"}

View File

@@ -0,0 +1,129 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
useRatingItemBase_unstable: function() {
return useRatingItemBase_unstable;
},
useRatingItem_unstable: function() {
return useRatingItem_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _reacttabster = require("@fluentui/react-tabster");
const _RatingItemContext = require("../../contexts/RatingItemContext");
const defaultItemLabel = (num)=>num + '';
const useRatingItem_unstable = (props, ref)=>{
const context = (0, _RatingItemContext.useRatingItemContextValue_unstable)();
const state = useRatingItemBase_unstable(props, ref);
return {
...state,
color: context.color,
size: context.size
};
};
const useRatingItemBase_unstable = (props, ref)=>{
const context = (0, _RatingItemContext.useRatingItemContextValue_unstable)();
const { value = 0 } = props;
const { itemLabel = defaultItemLabel, iconFilled: IconFilled, iconOutline: IconOutline } = context;
const ratingValue = Math.round((context.value || 0) * 2) / 2; // round to the nearest 0.5
var _context_hoveredValue;
const displayedRatingValue = (_context_hoveredValue = context.hoveredValue) !== null && _context_hoveredValue !== void 0 ? _context_hoveredValue : ratingValue;
const appearance = context.interactive ? 'outline' : 'filled';
let iconFillWidth;
if (context.compact || displayedRatingValue >= value) {
iconFillWidth = 1;
} else if (displayedRatingValue >= value - 0.5) {
iconFillWidth = 0.5;
} else {
iconFillWidth = 0;
}
const root = _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('span', {
ref: (0, _reactutilities.useMergedRefs)((0, _reacttabster.useFocusWithin)(), ref),
...props
}), {
elementType: 'span'
});
let unselectedIcon;
if (iconFillWidth < 1) {
unselectedIcon = _reactutilities.slot.always(props.unselectedIcon, {
defaultProps: {
children: appearance === 'filled' ? /*#__PURE__*/ _react.createElement(IconFilled, null) : /*#__PURE__*/ _react.createElement(IconOutline, null),
'aria-hidden': true
},
elementType: 'div'
});
}
let selectedIcon;
if (iconFillWidth > 0) {
selectedIcon = _reactutilities.slot.always(props.selectedIcon, {
defaultProps: {
children: /*#__PURE__*/ _react.createElement(IconFilled, null),
'aria-hidden': true
},
elementType: 'div'
});
}
let halfValueInput;
if (context.interactive && context.step === 0.5) {
halfValueInput = _reactutilities.slot.always(props.halfValueInput, {
defaultProps: {
type: 'radio',
name: context.name,
value: value - 0.5,
checked: ratingValue === value - 0.5,
'aria-label': itemLabel(value - 0.5),
onChange: ()=>{
// This empty onChange handler silences an incorrect React warning about not using onChange for a controlled input.
// The parent Rating component has the real onChange handler to listen to change events from this input.
}
},
elementType: 'input'
});
}
let fullValueInput;
if (context.interactive) {
fullValueInput = _reactutilities.slot.always(props.fullValueInput, {
defaultProps: {
type: 'radio',
name: context.name,
value,
checked: ratingValue === value,
'aria-label': itemLabel(value),
onChange: ()=>{
// This empty onChange handler silences an incorrect React warning about not using onChange for a controlled input.
// The parent Rating component has the real onChange handler to listen to change events from this input.
}
},
elementType: 'input'
});
}
return {
appearance,
step: context.step,
iconFillWidth,
value,
components: {
root: 'span',
selectedIcon: 'div',
unselectedIcon: 'div',
halfValueInput: 'input',
fullValueInput: 'input'
},
root,
selectedIcon,
unselectedIcon,
halfValueInput,
fullValueInput
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,301 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ratingItemClassNames: function() {
return ratingItemClassNames;
},
useRatingItemStyles_unstable: function() {
return useRatingItemStyles_unstable;
}
});
const _react = require("@griffel/react");
const ratingItemClassNames = {
root: 'fui-RatingItem',
selectedIcon: 'fui-RatingItem__selectedIcon',
unselectedIcon: 'fui-RatingItem__unselectedIcon',
halfValueInput: 'fui-RatingItem__halfValueInput',
fullValueInput: 'fui-RatingItem__fullValueInput'
};
/**
* Styles for the root slot
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
qhf8xq: "f10pi13n",
Brovlpu: "ftqa4ok",
B486eqv: "f2hkw1w",
Bssx7fj: "f1b1k54r",
uh7if5: [
"f4ne723",
"fqqcjud"
],
clntm0: "fh7aioi",
Dlk2r6: [
"fqqcjud",
"f4ne723"
],
h6p2u: "f1ufm4qn",
I6qiy5: [
"f1qnwcb4",
"fgrk5zm"
],
yzno9d: "fi52z01",
By0wis0: [
"fgrk5zm",
"f1qnwcb4"
],
B2j2mmj: "ffht0p2",
wigs8: "f1p0ul1q",
pbfy6t: "f1c901ms",
B0v4ure: "f1alokd7",
Byrf0fs: 0,
Bsiemmq: 0,
Bwckmig: 0,
skfxo0: 0,
Iidy0u: 0,
B98u21t: 0,
Bvwlmkc: 0,
jo1ztg: 0,
Ba1iezr: 0,
Blmvk6g: 0,
B24cy0v: 0,
Bil7v7r: 0,
Br3gin4: 0,
nr063g: 0,
ghq09: 0,
Bbgo44z: 0,
Bseh09z: "fmj8fco",
az1dzo: 0,
Ba3ybja: 0,
B6352mv: 0,
vppk2z: 0,
Biaj6j7: "f1iwowo3",
B2pnrqr: "f1spmvte",
B29w5g4: [
"fgp7k2s",
"f13pb23"
],
Bhhzhcn: "f1ihbrwi",
Bec0n69: [
"f13pb23",
"fgp7k2s"
]
},
small: {
Be2twd7: "f1ugzwwg",
a9b677: "frx94fk",
Bqenvij: "fvblgha"
},
medium: {
Be2twd7: "f4ybsrx",
a9b677: "fjw5fx7",
Bqenvij: "fd461yt"
},
large: {
Be2twd7: "fe5j1ua",
a9b677: "f64fuq3",
Bqenvij: "fjamq6b"
},
"extra-large": {
Be2twd7: "f24l1pt",
a9b677: "f1w9dchk",
Bqenvij: "fxldao9"
}
}, {
d: [
".f10pi13n{position:relative;}",
".f1b1k54r[data-fui-focus-within]:focus-within{border-top-color:transparent;}",
".f4ne723[data-fui-focus-within]:focus-within{border-right-color:transparent;}",
".fqqcjud[data-fui-focus-within]:focus-within{border-left-color:transparent;}",
".fh7aioi[data-fui-focus-within]:focus-within{border-bottom-color:transparent;}",
".ffht0p2[data-fui-focus-within]:focus-within::after{content:\"\";}",
".f1p0ul1q[data-fui-focus-within]:focus-within::after{position:absolute;}",
".f1c901ms[data-fui-focus-within]:focus-within::after{pointer-events:none;}",
".f1alokd7[data-fui-focus-within]:focus-within::after{z-index:1;}",
[
".fmj8fco[data-fui-focus-within]:focus-within::after{border:2px solid var(--colorStrokeFocus2);}",
{
p: -2
}
],
[
".f1iwowo3[data-fui-focus-within]:focus-within::after{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
],
".f1spmvte[data-fui-focus-within]:focus-within::after{top:calc(2px * -1);}",
".fgp7k2s[data-fui-focus-within]:focus-within::after{right:calc(2px * -1);}",
".f13pb23[data-fui-focus-within]:focus-within::after{left:calc(2px * -1);}",
".f1ihbrwi[data-fui-focus-within]:focus-within::after{bottom:calc(2px * -1);}",
".f1ugzwwg{font-size:12px;}",
".frx94fk{width:12px;}",
".fvblgha{height:12px;}",
".f4ybsrx{font-size:16px;}",
".fjw5fx7{width:16px;}",
".fd461yt{height:16px;}",
".fe5j1ua{font-size:20px;}",
".f64fuq3{width:20px;}",
".fjamq6b{height:20px;}",
".f24l1pt{font-size:28px;}",
".f1w9dchk{width:28px;}",
".fxldao9{height:28px;}"
],
f: [
".ftqa4ok:focus{outline-style:none;}"
],
i: [
".f2hkw1w:focus-visible{outline-style:none;}"
],
m: [
[
"@media (forced-colors: active){.f1ufm4qn[data-fui-focus-within]:focus-within::after{border-top-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f1qnwcb4[data-fui-focus-within]:focus-within::after{border-right-color:Highlight;}.fgrk5zm[data-fui-focus-within]:focus-within::after{border-left-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.fi52z01[data-fui-focus-within]:focus-within::after{border-bottom-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
]
]
});
const useInputBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1qfsv1p", "rh8pzaz", [
".r1qfsv1p{position:absolute;left:0;top:0;right:0;bottom:0;box-sizing:border-box;margin:0;opacity:0;cursor:pointer;height:100%;}",
".rh8pzaz{position:absolute;right:0;top:0;left:0;bottom:0;box-sizing:border-box;margin:0;opacity:0;cursor:pointer;height:100%;}"
]);
const useInputStyles = /*#__PURE__*/ (0, _react.__styles)({
lowerHalf: {
j35jbq: [
"ffenbu1",
"f1ktbn1t"
]
},
upperHalf: {
oyh7mz: [
"f1ktbn1t",
"ffenbu1"
]
}
}, {
d: [
".ffenbu1{right:50%;}",
".f1ktbn1t{left:50%;}"
]
});
const useIndicatorBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1420l2m", "r1yt29v5", [
".r1420l2m{display:flex;overflow:hidden;color:var(--colorNeutralForeground1);fill:currentColor;pointer-events:none;position:absolute;left:0;right:0;top:0;bottom:0;}",
".r1yt29v5{display:flex;overflow:hidden;color:var(--colorNeutralForeground1);fill:currentColor;pointer-events:none;position:absolute;right:0;left:0;top:0;bottom:0;}"
]);
const useIndicatorStyles = /*#__PURE__*/ (0, _react.__styles)({
lowerHalf: {
j35jbq: [
"ffenbu1",
"f1ktbn1t"
],
l5kjut: 0,
uoufgc: 0,
v39lw8: 0,
Bbwb3tu: "f10jwh99"
},
upperHalf: {
oyh7mz: [
"f1ktbn1t",
"ffenbu1"
],
Frg6f3: [
"fbm7ezh",
"f3ev47i"
]
},
brand: {
sj55zd: "f16muhyy"
},
marigold: {
sj55zd: "f1whvut0"
},
filled: {
sj55zd: "f1qaymga",
ojy3ng: "f13qq9og",
B7iucu3: "f1205bnn",
Biw2w6l: "f1nocmko"
},
brandFilled: {
sj55zd: "f1kdv6iu"
},
marigoldFilled: {
sj55zd: "f1ymbmfq"
}
}, {
d: [
".ffenbu1{right:50%;}",
".f1ktbn1t{left:50%;}",
[
".f10jwh99>svg{flex:0 0 auto;}",
{
p: -1
}
],
".fbm7ezh{margin-left:-50%;}",
".f3ev47i{margin-right:-50%;}",
".f16muhyy{color:var(--colorBrandForeground1);}",
".f1whvut0{color:var(--colorPaletteMarigoldBorderActive);}",
".f1qaymga{color:var(--colorNeutralBackground6);}",
".f13qq9og{stroke:var(--colorTransparentStroke);}",
".f1kdv6iu{color:var(--colorBrandBackground2);}",
".f1ymbmfq{color:var(--colorPaletteMarigoldBackground2);}"
],
m: [
[
"@media (forced-colors: active){.f1205bnn{color:Canvas;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f1nocmko{stroke:CanvasText;}}",
{
m: "(forced-colors: active)"
}
]
]
});
const useRatingItemStyles_unstable = (state)=>{
'use no memo';
const { color, size, iconFillWidth, appearance } = state;
const styles = useStyles();
const inputBaseClassName = useInputBaseClassName();
const inputStyles = useInputStyles();
const indicatorBaseClassName = useIndicatorBaseClassName();
const indicatorStyles = useIndicatorStyles();
state.root.className = (0, _react.mergeClasses)(ratingItemClassNames.root, styles.root, styles[size], state.root.className);
if (state.halfValueInput) {
state.halfValueInput.className = (0, _react.mergeClasses)(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);
}
if (state.fullValueInput) {
state.fullValueInput.className = (0, _react.mergeClasses)(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);
}
if (state.unselectedIcon) {
state.unselectedIcon.className = (0, _react.mergeClasses)(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);
}
if (state.selectedIcon) {
state.selectedIcon.className = (0, _react.mergeClasses)(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);
}
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,147 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ratingItemClassNames: function() {
return ratingItemClassNames;
},
useRatingItemStyles_unstable: function() {
return useRatingItemStyles_unstable;
}
});
const _react = require("@griffel/react");
const _reacttheme = require("@fluentui/react-theme");
const _reacttabster = require("@fluentui/react-tabster");
const ratingItemClassNames = {
root: 'fui-RatingItem',
selectedIcon: 'fui-RatingItem__selectedIcon',
unselectedIcon: 'fui-RatingItem__unselectedIcon',
halfValueInput: 'fui-RatingItem__halfValueInput',
fullValueInput: 'fui-RatingItem__fullValueInput'
};
/**
* Styles for the root slot
*/ const useStyles = (0, _react.makeStyles)({
root: {
position: 'relative',
...(0, _reacttabster.createFocusOutlineStyle)({
style: {},
selector: 'focus-within'
})
},
small: {
fontSize: '12px',
width: '12px',
height: '12px'
},
medium: {
fontSize: '16px',
width: '16px',
height: '16px'
},
large: {
fontSize: '20px',
width: '20px',
height: '20px'
},
'extra-large': {
fontSize: '28px',
width: '28px',
height: '28px'
}
});
const useInputBaseClassName = (0, _react.makeResetStyles)({
position: 'absolute',
left: 0,
top: 0,
right: 0,
bottom: 0,
boxSizing: 'border-box',
margin: 0,
opacity: 0,
cursor: 'pointer',
height: '100%'
});
const useInputStyles = (0, _react.makeStyles)({
lowerHalf: {
right: '50%'
},
upperHalf: {
left: '50%'
}
});
const useIndicatorBaseClassName = (0, _react.makeResetStyles)({
display: 'flex',
overflow: 'hidden',
color: _reacttheme.tokens.colorNeutralForeground1,
fill: 'currentColor',
pointerEvents: 'none',
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0
});
const useIndicatorStyles = (0, _react.makeStyles)({
lowerHalf: {
right: '50%',
'& > svg': {
flex: '0 0 auto'
}
},
upperHalf: {
left: '50%',
marginLeft: '-50%'
},
brand: {
color: _reacttheme.tokens.colorBrandForeground1
},
marigold: {
color: _reacttheme.tokens.colorPaletteMarigoldBorderActive
},
filled: {
color: _reacttheme.tokens.colorNeutralBackground6,
stroke: _reacttheme.tokens.colorTransparentStroke,
'@media (forced-colors: active)': {
color: 'Canvas',
stroke: 'CanvasText'
}
},
brandFilled: {
color: _reacttheme.tokens.colorBrandBackground2
},
marigoldFilled: {
color: _reacttheme.tokens.colorPaletteMarigoldBackground2
}
});
const useRatingItemStyles_unstable = (state)=>{
'use no memo';
const { color, size, iconFillWidth, appearance } = state;
const styles = useStyles();
const inputBaseClassName = useInputBaseClassName();
const inputStyles = useInputStyles();
const indicatorBaseClassName = useIndicatorBaseClassName();
const indicatorStyles = useIndicatorStyles();
state.root.className = (0, _react.mergeClasses)(ratingItemClassNames.root, styles.root, styles[size], state.root.className);
if (state.halfValueInput) {
state.halfValueInput.className = (0, _react.mergeClasses)(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);
}
if (state.fullValueInput) {
state.fullValueInput.className = (0, _react.mergeClasses)(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);
}
if (state.unselectedIcon) {
state.unselectedIcon.className = (0, _react.mergeClasses)(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);
}
if (state.selectedIcon) {
state.selectedIcon.className = (0, _react.mergeClasses)(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);
}
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,35 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
RatingItemContext: function() {
return RatingItemContext;
},
RatingItemProvider: function() {
return RatingItemProvider;
},
useRatingItemContextValue_unstable: function() {
return useRatingItemContextValue_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reacticons = require("@fluentui/react-icons");
const RatingItemContext = /*#__PURE__*/ _react.createContext(undefined);
const ratingItemContextDefaultValue = {
color: 'neutral',
iconFilled: _reacticons.StarFilled,
iconOutline: _reacticons.StarRegular,
step: 1,
size: 'medium'
};
const RatingItemProvider = RatingItemContext.Provider;
const useRatingItemContextValue_unstable = ()=>_react.useContext(RatingItemContext) || ratingItemContextDefaultValue;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/contexts/RatingItemContext.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { RatingItemContextValue } from '../RatingItem';\nimport { StarFilled, StarRegular } from '@fluentui/react-icons';\n\n/**\n * RatingContext is provided by Rating, and is consumed by Rating to determine default values of some props.\n */\nexport const RatingItemContext = React.createContext<RatingItemContextValue | undefined>(undefined);\nconst ratingItemContextDefaultValue: RatingItemContextValue = {\n color: 'neutral',\n iconFilled: StarFilled,\n iconOutline: StarRegular,\n step: 1,\n size: 'medium',\n};\nexport const RatingItemProvider = RatingItemContext.Provider;\n\n/**\n * Get the value of the RatingContext.\n */\nexport const useRatingItemContextValue_unstable = (): RatingItemContextValue =>\n React.useContext(RatingItemContext) || ratingItemContextDefaultValue;\n"],"names":["React","StarFilled","StarRegular","RatingItemContext","createContext","undefined","ratingItemContextDefaultValue","color","iconFilled","iconOutline","step","size","RatingItemProvider","Provider","useRatingItemContextValue_unstable","useContext"],"mappings":"AAAA;;;;;;;;;;;;qBASaG;;;sBAQAS;;;sCAKAE;;;;;iEApBU,QAAQ;4BAES,wBAAwB;AAKzD,MAAMX,oBAAAA,WAAAA,GAAoBH,OAAMI,aAAa,CAAqCC,WAAW;AACpG,MAAMC,gCAAwD;IAC5DC,OAAO;IACPC,YAAYP,sBAAAA;IACZQ,aAAaP,uBAAAA;IACbQ,MAAM;IACNC,MAAM;AACR;AACO,MAAMC,qBAAqBT,kBAAkBU,QAAQ,CAAC;AAKtD,MAAMC,qCAAqC,IAChDd,OAAMe,UAAU,CAACZ,sBAAsBG,8BAA8B"}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
RatingItemContext: function() {
return _RatingItemContext.RatingItemContext;
},
RatingItemProvider: function() {
return _RatingItemContext.RatingItemProvider;
},
useRatingItemContextValue_unstable: function() {
return _RatingItemContext.useRatingItemContextValue_unstable;
}
});
const _RatingItemContext = require("./RatingItemContext");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export { RatingItemContext, RatingItemProvider, useRatingItemContextValue_unstable } from './RatingItemContext';\n"],"names":["RatingItemContext","RatingItemProvider","useRatingItemContextValue_unstable"],"mappings":";;;;;;;;;;;;eAASA,oCAAiB;;;eAAEC,qCAAkB;;;eAAEC,qDAAkC;;;mCAAQ,sBAAsB"}

View File

@@ -0,0 +1,79 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Rating: function() {
return _Rating.Rating;
},
RatingDisplay: function() {
return _RatingDisplay.RatingDisplay;
},
RatingItem: function() {
return _RatingItem.RatingItem;
},
RatingItemProvider: function() {
return _index.RatingItemProvider;
},
ratingClassNames: function() {
return _Rating.ratingClassNames;
},
ratingDisplayClassNames: function() {
return _RatingDisplay.ratingDisplayClassNames;
},
ratingItemClassNames: function() {
return _RatingItem.ratingItemClassNames;
},
renderRatingDisplay_unstable: function() {
return _RatingDisplay.renderRatingDisplay_unstable;
},
renderRatingItem_unstable: function() {
return _RatingItem.renderRatingItem_unstable;
},
renderRating_unstable: function() {
return _Rating.renderRating_unstable;
},
useRatingBase_unstable: function() {
return _Rating.useRatingBase_unstable;
},
useRatingContextValues: function() {
return _Rating.useRatingContextValues;
},
useRatingDisplayBase_unstable: function() {
return _RatingDisplay.useRatingDisplayBase_unstable;
},
useRatingDisplayContextValues: function() {
return _RatingDisplay.useRatingDisplayContextValues;
},
useRatingDisplayStyles_unstable: function() {
return _RatingDisplay.useRatingDisplayStyles_unstable;
},
useRatingDisplay_unstable: function() {
return _RatingDisplay.useRatingDisplay_unstable;
},
useRatingItemContextValue_unstable: function() {
return _index.useRatingItemContextValue_unstable;
},
useRatingItemStyles_unstable: function() {
return _RatingItem.useRatingItemStyles_unstable;
},
useRatingItem_unstable: function() {
return _RatingItem.useRatingItem_unstable;
},
useRatingStyles_unstable: function() {
return _Rating.useRatingStyles_unstable;
},
useRating_unstable: function() {
return _Rating.useRating_unstable;
}
});
const _Rating = require("./Rating");
const _RatingItem = require("./RatingItem");
const _index = require("./contexts/index");
const _RatingDisplay = require("./RatingDisplay");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Rating,\n ratingClassNames,\n renderRating_unstable,\n useRatingStyles_unstable,\n useRating_unstable,\n useRatingContextValues,\n useRatingBase_unstable,\n} from './Rating';\nexport type {\n RatingProps,\n RatingSlots,\n RatingState,\n RatingOnChangeEventData,\n RatingContextValues,\n RatingBaseProps,\n RatingBaseState,\n} from './Rating';\nexport {\n RatingItem,\n ratingItemClassNames,\n renderRatingItem_unstable,\n useRatingItemStyles_unstable,\n useRatingItem_unstable,\n} from './RatingItem';\nexport type {\n RatingItemProps,\n RatingItemSlots,\n RatingItemState,\n RatingItemBaseProps,\n RatingItemBaseState,\n} from './RatingItem';\nexport { RatingItemProvider, useRatingItemContextValue_unstable } from './contexts/index';\nexport {\n RatingDisplay,\n ratingDisplayClassNames,\n renderRatingDisplay_unstable,\n useRatingDisplayStyles_unstable,\n useRatingDisplay_unstable,\n useRatingDisplayContextValues,\n useRatingDisplayBase_unstable,\n} from './RatingDisplay';\nexport type {\n RatingDisplayProps,\n RatingDisplaySlots,\n RatingDisplayState,\n RatingDisplayContextValues,\n RatingDisplayBaseProps,\n RatingDisplayBaseState,\n} from './RatingDisplay';\n"],"names":["Rating","ratingClassNames","renderRating_unstable","useRatingStyles_unstable","useRating_unstable","useRatingContextValues","useRatingBase_unstable","RatingItem","ratingItemClassNames","renderRatingItem_unstable","useRatingItemStyles_unstable","useRatingItem_unstable","RatingItemProvider","useRatingItemContextValue_unstable","RatingDisplay","ratingDisplayClassNames","renderRatingDisplay_unstable","useRatingDisplayStyles_unstable","useRatingDisplay_unstable","useRatingDisplayContextValues","useRatingDisplayBase_unstable"],"mappings":";;;;;;;;;;;IACEA,MAAM;;;iBAiCO;eAAbc;;IAfAP;qCAAU;;;eAaHK,yBAAkB;;;eA9BzBX,wBAAgB;;;eAiChBc,sCAAuB;;;eAfvBP,gCAAoB;;;eAgBpBQ,2CAA4B;;;eAf5BP,qCAAyB;;;eAlBzBP,6BAAqB;;;eAIrBI,8BAAsB;;;eADtBD,8BAAsB;;;eAkCtBe,4CAA6B;;;eAD7BD,4CAA6B;;;eAF7BF,8CAA+B;;;eAC/BC,wCAAyB;;;eANEL,yCAAkC;;;eAV7DH,wCAA4B;;;eAC5BC,kCAAsB;;;eAnBtBR,gCAAwB;;;eACxBC,0BAAkB;;;wBAGb,WAAW;4BAgBX,eAAe;uBAQiD,mBAAmB;+BASnF,kBAAkB"}

1
node_modules/@fluentui/react-rating/lib/Rating.js generated vendored Normal file
View File

@@ -0,0 +1 @@
export { Rating, ratingClassNames, renderRating_unstable, useRatingContextValues, useRatingStyles_unstable, useRating_unstable, useRatingBase_unstable } from './components/Rating/index';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/Rating.ts"],"sourcesContent":["export type {\n RatingContextValues,\n RatingOnChangeEventData,\n RatingProps,\n RatingBaseProps,\n RatingSlots,\n RatingState,\n RatingBaseState,\n} from './components/Rating/index';\nexport {\n Rating,\n ratingClassNames,\n renderRating_unstable,\n useRatingContextValues,\n useRatingStyles_unstable,\n useRating_unstable,\n useRatingBase_unstable,\n} from './components/Rating/index';\n"],"names":["Rating","ratingClassNames","renderRating_unstable","useRatingContextValues","useRatingStyles_unstable","useRating_unstable","useRatingBase_unstable"],"mappings":"AASA,SACEA,MAAM,EACNC,gBAAgB,EAChBC,qBAAqB,EACrBC,sBAAsB,EACtBC,wBAAwB,EACxBC,kBAAkB,EAClBC,sBAAsB,QACjB,4BAA4B"}

View File

@@ -0,0 +1 @@
export { RatingDisplay, ratingDisplayClassNames, renderRatingDisplay_unstable, useRatingDisplayContextValues, useRatingDisplayStyles_unstable, useRatingDisplay_unstable, useRatingDisplayBase_unstable } from './components/RatingDisplay/index';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/RatingDisplay.ts"],"sourcesContent":["export type {\n RatingDisplayContextValues,\n RatingDisplayProps,\n RatingDisplayBaseProps,\n RatingDisplaySlots,\n RatingDisplayState,\n RatingDisplayBaseState,\n} from './components/RatingDisplay/index';\nexport {\n RatingDisplay,\n ratingDisplayClassNames,\n renderRatingDisplay_unstable,\n useRatingDisplayContextValues,\n useRatingDisplayStyles_unstable,\n useRatingDisplay_unstable,\n useRatingDisplayBase_unstable,\n} from './components/RatingDisplay/index';\n"],"names":["RatingDisplay","ratingDisplayClassNames","renderRatingDisplay_unstable","useRatingDisplayContextValues","useRatingDisplayStyles_unstable","useRatingDisplay_unstable","useRatingDisplayBase_unstable"],"mappings":"AAQA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,+BAA+B,EAC/BC,yBAAyB,EACzBC,6BAA6B,QACxB,mCAAmC"}

View File

@@ -0,0 +1 @@
export { RatingItem, ratingItemClassNames, renderRatingItem_unstable, useRatingItemStyles_unstable, useRatingItem_unstable, useRatingItemBase_unstable } from './components/RatingItem/index';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/RatingItem.ts"],"sourcesContent":["export type {\n RatingItemContextValue,\n RatingItemProps,\n RatingItemBaseProps,\n RatingItemSlots,\n RatingItemState,\n RatingItemBaseState,\n} from './components/RatingItem/index';\nexport {\n RatingItem,\n ratingItemClassNames,\n renderRatingItem_unstable,\n useRatingItemStyles_unstable,\n useRatingItem_unstable,\n useRatingItemBase_unstable,\n} from './components/RatingItem/index';\n"],"names":["RatingItem","ratingItemClassNames","renderRatingItem_unstable","useRatingItemStyles_unstable","useRatingItem_unstable","useRatingItemBase_unstable"],"mappings":"AAQA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,EACtBC,0BAA0B,QACrB,gCAAgC"}

View File

@@ -0,0 +1,17 @@
'use client';
import * as React from 'react';
import { useRating_unstable } from './useRating';
import { renderRating_unstable } from './renderRating';
import { useRatingStyles_unstable } from './useRatingStyles.styles';
import { useRatingContextValues } from './useRatingContextValues';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* Rating is a wrapper for one or more rating items that will be used to set a rating value.
*/ export const Rating = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useRating_unstable(props, ref);
const contextValues = useRatingContextValues(state);
useRatingStyles_unstable(state);
useCustomStyleHook_unstable('useRatingStyles_unstable')(state);
return renderRating_unstable(state, contextValues);
});
Rating.displayName = 'Rating';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/Rating.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useRating_unstable } from './useRating';\nimport { renderRating_unstable } from './renderRating';\nimport { useRatingStyles_unstable } from './useRatingStyles.styles';\nimport type { RatingProps } from './Rating.types';\nimport { useRatingContextValues } from './useRatingContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Rating is a wrapper for one or more rating items that will be used to set a rating value.\n */\nexport const Rating: ForwardRefComponent<RatingProps> = React.forwardRef((props, ref) => {\n const state = useRating_unstable(props, ref);\n const contextValues = useRatingContextValues(state);\n\n useRatingStyles_unstable(state);\n useCustomStyleHook_unstable('useRatingStyles_unstable')(state);\n return renderRating_unstable(state, contextValues);\n});\n\nRating.displayName = 'Rating';\n"],"names":["React","useRating_unstable","renderRating_unstable","useRatingStyles_unstable","useRatingContextValues","useCustomStyleHook_unstable","Rating","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,2BAA2B;AAEpE,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,uBAA2CN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC/E,MAAMC,QAAQT,mBAAmBO,OAAOC;IACxC,MAAME,gBAAgBP,uBAAuBM;IAE7CP,yBAAyBO;IACzBL,4BAA4B,4BAA4BK;IACxD,OAAOR,sBAAsBQ,OAAOC;AACtC,GAAG;AAEHL,OAAOM,WAAW,GAAG"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/Rating.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport type RatingSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Rating Props\n */\nexport type RatingProps = Omit<ComponentProps<Partial<RatingSlots>>, 'onChange'> & {\n /**\n * Controls the color of the Rating.\n * @default neutral\n */\n color?: 'brand' | 'marigold' | 'neutral';\n /**\n * Default value of the Rating\n */\n defaultValue?: number;\n /**\n * The icon to display when the rating value is greater than or equal to the item's value.\n */\n iconFilled?: React.ElementType;\n /**\n * The icon to display when the rating value is less than the item's value.\n */\n iconOutline?: React.ElementType;\n /**\n * Prop to generate the aria-label for the rating inputs.\n * @default (rating) =\\> `${rating}`\n */\n itemLabel?: (rating: number) => string;\n /**\n * The max value of the rating. This controls the number of rating items displayed.\n * Must be a whole number greater than 1.\n * @default 5\n */\n max?: number;\n /**\n * Name for the Radio inputs. If not provided, one will be automatically generated\n */\n name?: string;\n /**\n * Callback when the rating value is changed by the user.\n */\n onChange?: EventHandler<RatingOnChangeEventData>;\n /**\n * Sets the precision to allow half-filled shapes in Rating\n * @default 1\n */\n step?: 0.5 | 1;\n /**\n * Sets the size of the Rating items.\n * @default extra-large\n */\n size?: 'small' | 'medium' | 'large' | 'extra-large';\n /**\n * The value of the rating\n */\n value?: number;\n};\n\n/**\n * Data for the onChange event for Rating.\n */\nexport type RatingOnChangeEventData = EventData<'change', React.FormEvent<HTMLDivElement>> & {\n /**\n * The new value of the rating.\n */\n value: number;\n};\n\n/**\n * Rating base props — excludes design props (color, size).\n */\nexport type RatingBaseProps = Omit<RatingProps, 'color' | 'size'>;\n\n/**\n * State used in rendering Rating\n */\nexport type RatingState = ComponentState<RatingSlots> &\n Required<Pick<RatingProps, 'color' | 'iconFilled' | 'iconOutline' | 'name' | 'step' | 'size' | 'value'>> &\n Pick<RatingProps, 'itemLabel'> & {\n hoveredValue?: number | undefined;\n };\n\n/**\n * Rating base state — excludes design props (color, size).\n */\nexport type RatingBaseState = Omit<RatingState, 'color' | 'size'>;\n\nexport type RatingContextValues = {\n ratingItem: RatingItemContextValue;\n};\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,5 @@
export { Rating } from './Rating';
export { renderRating_unstable } from './renderRating';
export { useRating_unstable, useRatingBase_unstable } from './useRating';
export { ratingClassNames, useRatingStyles_unstable } from './useRatingStyles.styles';
export { useRatingContextValues } from './useRatingContextValues';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/index.ts"],"sourcesContent":["export { Rating } from './Rating';\nexport type {\n RatingContextValues,\n RatingOnChangeEventData,\n RatingProps,\n RatingBaseProps,\n RatingSlots,\n RatingState,\n RatingBaseState,\n} from './Rating.types';\nexport { renderRating_unstable } from './renderRating';\nexport { useRating_unstable, useRatingBase_unstable } from './useRating';\nexport { ratingClassNames, useRatingStyles_unstable } from './useRatingStyles.styles';\nexport { useRatingContextValues } from './useRatingContextValues';\n"],"names":["Rating","renderRating_unstable","useRating_unstable","useRatingBase_unstable","ratingClassNames","useRatingStyles_unstable","useRatingContextValues"],"mappings":"AAAA,SAASA,MAAM,QAAQ,WAAW;AAUlC,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,cAAc;AACzE,SAASC,gBAAgB,EAAEC,wBAAwB,QAAQ,2BAA2B;AACtF,SAASC,sBAAsB,QAAQ,2BAA2B"}

View File

@@ -0,0 +1,12 @@
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
import { RatingItemProvider } from '../../contexts/RatingItemContext';
/**
* Render the final JSX of Rating
*/ export const renderRating_unstable = (state, contextValues)=>{
assertSlots(state);
return /*#__PURE__*/ _jsx(RatingItemProvider, {
value: contextValues.ratingItem,
children: /*#__PURE__*/ _jsx(state.root, {})
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/renderRating.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { RatingBaseState, RatingSlots, RatingContextValues } from './Rating.types';\nimport { RatingItemProvider } from '../../contexts/RatingItemContext';\n\n/**\n * Render the final JSX of Rating\n */\nexport const renderRating_unstable = (state: RatingBaseState, contextValues: RatingContextValues): JSXElement => {\n assertSlots<RatingSlots>(state);\n\n return (\n <RatingItemProvider value={contextValues.ratingItem}>\n <state.root />\n </RatingItemProvider>\n );\n};\n"],"names":["assertSlots","RatingItemProvider","renderRating_unstable","state","contextValues","value","ratingItem","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAwBC;IAC5DJ,YAAyBG;IAEzB,qBACE,KAACF;QAAmBI,OAAOD,cAAcE,UAAU;kBACjD,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}

View File

@@ -0,0 +1,102 @@
'use client';
import * as React from 'react';
import { getIntrinsicElementProps, isHTMLElement, mergeCallbacks, slot, useControllableState, useId } from '@fluentui/react-utilities';
import { RatingItem } from '../../RatingItem';
import { StarFilled, StarRegular } from '@fluentui/react-icons';
/**
* Create the state required to render Rating.
*
* The returned state can be modified with hooks such as useRatingStyles_unstable,
* before being passed to renderRating_unstable.
*
* @param props - props from this instance of Rating
* @param ref - reference to root HTMLElement of Rating
*/ export const useRating_unstable = (props, ref)=>{
const { color = 'neutral', size = 'extra-large', iconFilled = StarFilled, iconOutline = StarRegular, ...baseProps } = props;
const state = useRatingBase_unstable({
iconFilled,
iconOutline,
...baseProps
}, ref);
return {
...state,
color,
size
};
};
/**
* Base hook for Rating component. Manages state related to controlled/uncontrolled
* rating value, hover state, radiogroup ARIA role, and keyboard/mouse interaction —
* without design props (color, size).
*
* @param props - props from this instance of Rating (without color, size)
* @param ref - reference to root HTMLElement of Rating
*/ export const useRatingBase_unstable = (props, ref)=>{
const generatedName = useId('rating-');
const { iconFilled = 'span', iconOutline = 'span', max = 5, name = generatedName, onChange, step = 1, itemLabel } = props;
const [value, setValue] = useControllableState({
state: props.value,
defaultState: props.defaultValue,
initialState: 0
});
const isRatingRadioItem = (target)=>isHTMLElement(target, {
constructorName: 'HTMLInputElement'
}) && target.type === 'radio' && target.name === name;
const [hoveredValue, setHoveredValue] = React.useState(undefined);
// Generate the child RatingItems and memoize them to prevent unnecessary re-rendering
const rootChildren = React.useMemo(()=>{
return Array.from(Array(max), (_, i)=>/*#__PURE__*/ React.createElement(RatingItem, {
value: i + 1,
key: i + 1
}));
}, [
max
]);
const state = {
iconFilled,
iconOutline,
name,
step,
itemLabel,
value,
hoveredValue,
components: {
root: 'div'
},
root: slot.always(getIntrinsicElementProps('div', {
ref,
children: rootChildren,
role: 'radiogroup',
...props
}, [
'onChange'
]), {
elementType: 'div'
})
};
state.root.onChange = (ev)=>{
if (isRatingRadioItem(ev.target)) {
const newValue = parseFloat(ev.target.value);
if (!isNaN(newValue)) {
setValue(newValue);
onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
type: 'change',
event: ev,
value: newValue
});
}
}
};
state.root.onMouseOver = mergeCallbacks(props.onMouseOver, (ev)=>{
if (isRatingRadioItem(ev.target)) {
const newValue = parseFloat(ev.target.value);
if (!isNaN(newValue)) {
setHoveredValue(newValue);
}
}
});
state.root.onMouseLeave = mergeCallbacks(props.onMouseLeave, (ev)=>{
setHoveredValue(undefined);
});
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,30 @@
'use client';
import * as React from 'react';
export const useRatingContextValues = (ratingState)=>{
const { color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value } = ratingState;
const ratingItem = React.useMemo(()=>({
color,
hoveredValue,
iconFilled,
iconOutline,
interactive: true,
itemLabel,
name,
step,
size,
value
}), [
color,
hoveredValue,
iconFilled,
iconOutline,
itemLabel,
name,
step,
size,
value
]);
return {
ratingItem
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/useRatingContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { RatingContextValues, RatingState } from './Rating.types';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport const useRatingContextValues = (ratingState: RatingState): RatingContextValues => {\n const { color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value } = ratingState;\n\n const ratingItem = React.useMemo<RatingItemContextValue>(\n () => ({\n color,\n hoveredValue,\n iconFilled,\n iconOutline,\n interactive: true,\n itemLabel,\n name,\n step,\n size,\n value,\n }),\n [color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value],\n );\n\n return { ratingItem };\n};\n"],"names":["React","useRatingContextValues","ratingState","color","hoveredValue","iconFilled","iconOutline","itemLabel","name","step","size","value","ratingItem","useMemo","interactive"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAEC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGT;IAE7F,MAAMU,aAAaZ,MAAMa,OAAO,CAC9B,IAAO,CAAA;YACLV;YACAC;YACAC;YACAC;YACAQ,aAAa;YACbP;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QAACR;QAAOC;QAAcC;QAAYC;QAAaC;QAAWC;QAAMC;QAAMC;QAAMC;KAAM;IAGpF,OAAO;QAAEC;IAAW;AACtB,EAAE"}

View File

@@ -0,0 +1,20 @@
'use client';
import { __resetStyles, mergeClasses } from '@griffel/react';
export const ratingClassNames = {
root: 'fui-Rating'
};
/**
* Styles for the root slot
*/
const useRootClassName = /*#__PURE__*/__resetStyles("r2imjyh", null, [".r2imjyh{display:flex;flex-wrap:wrap;}"]);
/**
* Apply styling to the Rating slots based on the state
*/
export const useRatingStyles_unstable = state => {
'use no memo';
const rootClassName = useRootClassName();
state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__resetStyles","mergeClasses","ratingClassNames","root","useRootClassName","useRatingStyles_unstable","state","rootClassName","className"],"sources":["useRatingStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nexport const ratingClassNames = {\n root: 'fui-Rating'\n};\n/**\n * Styles for the root slot\n */ const useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap'\n});\n/**\n * Apply styling to the Rating slots based on the state\n */ export const useRatingStyles_unstable = (state)=>{\n 'use no memo';\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAA0BC,YAAY,QAAQ,gBAAgB;AAC9D,OAAO,MAAMC,gBAAgB,GAAG;EAC5BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,gBAAgB,gBAAGJ,aAAA,4DAG5B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMK,wBAAwB,GAAIC,KAAK,IAAG;EACjD,aAAa;;EACb,MAAMC,aAAa,GAAGH,gBAAgB,CAAC,CAAC;EACxCE,KAAK,CAACH,IAAI,CAACK,SAAS,GAAGP,YAAY,CAACC,gBAAgB,CAACC,IAAI,EAAEI,aAAa,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;EAC/F,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,19 @@
'use client';
import { makeResetStyles, mergeClasses } from '@griffel/react';
export const ratingClassNames = {
root: 'fui-Rating'
};
/**
* Styles for the root slot
*/ const useRootClassName = makeResetStyles({
display: 'flex',
flexWrap: 'wrap'
});
/**
* Apply styling to the Rating slots based on the state
*/ export const useRatingStyles_unstable = (state)=>{
'use no memo';
const rootClassName = useRootClassName();
state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rating/useRatingStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingSlots, RatingState } from './Rating.types';\n\nexport const ratingClassNames: SlotClassNames<RatingSlots> = {\n root: 'fui-Rating',\n};\n\n/**\n * Styles for the root slot\n */\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\n/**\n * Apply styling to the Rating slots based on the state\n */\nexport const useRatingStyles_unstable = (state: RatingState): RatingState => {\n 'use no memo';\n\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","ratingClassNames","root","useRootClassName","display","flexWrap","useRatingStyles_unstable","state","rootClassName","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,YAAY,QAAQ,iBAAiB;AAI/D,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;AACR,EAAE;AAEF;;CAEC,GAED,MAAMC,mBAAmBJ,gBAAgB;IACvCK,SAAS;IACTC,UAAU;AACZ;AAEA;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvC;IAEA,MAAMC,gBAAgBL;IACtBI,MAAML,IAAI,CAACO,SAAS,GAAGT,aAAaC,iBAAiBC,IAAI,EAAEM,eAAeD,MAAML,IAAI,CAACO,SAAS;IAC9F,OAAOF;AACT,EAAE"}

View File

@@ -0,0 +1,18 @@
'use client';
import * as React from 'react';
import { useRatingDisplay_unstable } from './useRatingDisplay';
import { renderRatingDisplay_unstable } from './renderRatingDisplay';
import { useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';
import { useRatingDisplayContextValues } from './useRatingDisplayContextValues';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* RatingDisplay is a wrapper for one or more rating items that will be used to display a rating value
* as well as the label for the rating.
*/ export const RatingDisplay = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useRatingDisplay_unstable(props, ref);
const contextValues = useRatingDisplayContextValues(state);
useRatingDisplayStyles_unstable(state);
useCustomStyleHook_unstable('useRatingDisplayStyles_unstable')(state);
return renderRatingDisplay_unstable(state, contextValues);
});
RatingDisplay.displayName = 'RatingDisplay';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/RatingDisplay.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useRatingDisplay_unstable } from './useRatingDisplay';\nimport { renderRatingDisplay_unstable } from './renderRatingDisplay';\nimport { useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';\nimport type { RatingDisplayProps } from './RatingDisplay.types';\nimport { useRatingDisplayContextValues } from './useRatingDisplayContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * RatingDisplay is a wrapper for one or more rating items that will be used to display a rating value\n * as well as the label for the rating.\n */\nexport const RatingDisplay: ForwardRefComponent<RatingDisplayProps> = React.forwardRef((props, ref) => {\n const state = useRatingDisplay_unstable(props, ref);\n const contextValues = useRatingDisplayContextValues(state);\n\n useRatingDisplayStyles_unstable(state);\n useCustomStyleHook_unstable('useRatingDisplayStyles_unstable')(state);\n\n return renderRatingDisplay_unstable(state, contextValues);\n});\n\nRatingDisplay.displayName = 'RatingDisplay';\n"],"names":["React","useRatingDisplay_unstable","renderRatingDisplay_unstable","useRatingDisplayStyles_unstable","useRatingDisplayContextValues","useCustomStyleHook_unstable","RatingDisplay","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,kCAAkC;AAElF,SAASC,6BAA6B,QAAQ,kCAAkC;AAChF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,8BAAyDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQT,0BAA0BO,OAAOC;IAC/C,MAAME,gBAAgBP,8BAA8BM;IAEpDP,gCAAgCO;IAChCL,4BAA4B,mCAAmCK;IAE/D,OAAOR,6BAA6BQ,OAAOC;AAC7C,GAAG;AAEHL,cAAcM,WAAW,GAAG"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/RatingDisplay.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport type RatingDisplaySlots = {\n root: NonNullable<Slot<'div'>>;\n valueText?: Slot<'span'>;\n countText?: Slot<'span'>;\n};\n\n/**\n * RatingDisplay Props\n */\nexport type RatingDisplayProps = ComponentProps<RatingDisplaySlots> & {\n /**\n * Color of the rating items (stars).\n * @default neutral\n */\n color?: 'brand' | 'marigold' | 'neutral';\n /**\n * Renders a single filled star, with the value written next to it.\n * @default false\n */\n compact?: boolean;\n /**\n * The number of ratings represented by the rating value.\n * This will be formatted with a thousands separator (if applicable) and displayed next to the value.\n */\n count?: number;\n /**\n * The icon used for rating items.\n * @default StarFilled\n */\n icon?: React.ElementType;\n /**\n * The max value of the rating. This controls the number of rating items displayed.\n * Must be a whole number greater than 1.\n * @default 5\n */\n max?: number;\n /**\n * Sets the size of the RatingDisplay items.\n * @default medium\n */\n size?: 'small' | 'medium' | 'large' | 'extra-large';\n /**\n * The value of the rating\n */\n value?: number;\n};\n\n/**\n * RatingDisplay base props — excludes design props (color, size).\n */\nexport type RatingDisplayBaseProps = Omit<RatingDisplayProps, 'color' | 'size'>;\n\n/**\n * State used in rendering RatingDisplay\n */\nexport type RatingDisplayState = ComponentState<RatingDisplaySlots> &\n Required<Pick<RatingDisplayProps, 'color' | 'compact' | 'icon' | 'max' | 'size'>> &\n Pick<RatingDisplayProps, 'value'>;\n\n/**\n * RatingDisplay base state — excludes design props (color, size).\n */\nexport type RatingDisplayBaseState = Omit<RatingDisplayState, 'color' | 'size' | 'icon'> &\n Pick<RatingDisplayProps, 'icon'>;\n\nexport type RatingDisplayContextValues = { ratingItem: RatingItemContextValue };\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,5 @@
export { RatingDisplay } from './RatingDisplay';
export { renderRatingDisplay_unstable } from './renderRatingDisplay';
export { useRatingDisplay_unstable, useRatingDisplayBase_unstable } from './useRatingDisplay';
export { ratingDisplayClassNames, useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';
export { useRatingDisplayContextValues } from './useRatingDisplayContextValues';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/index.ts"],"sourcesContent":["export { RatingDisplay } from './RatingDisplay';\nexport type {\n RatingDisplayContextValues,\n RatingDisplayProps,\n RatingDisplayBaseProps,\n RatingDisplaySlots,\n RatingDisplayState,\n RatingDisplayBaseState,\n} from './RatingDisplay.types';\nexport { renderRatingDisplay_unstable } from './renderRatingDisplay';\nexport { useRatingDisplay_unstable, useRatingDisplayBase_unstable } from './useRatingDisplay';\nexport { ratingDisplayClassNames, useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';\nexport { useRatingDisplayContextValues } from './useRatingDisplayContextValues';\n"],"names":["RatingDisplay","renderRatingDisplay_unstable","useRatingDisplay_unstable","useRatingDisplayBase_unstable","ratingDisplayClassNames","useRatingDisplayStyles_unstable","useRatingDisplayContextValues"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAShD,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,yBAAyB,EAAEC,6BAA6B,QAAQ,qBAAqB;AAC9F,SAASC,uBAAuB,EAAEC,+BAA+B,QAAQ,kCAAkC;AAC3G,SAASC,6BAA6B,QAAQ,kCAAkC"}

View File

@@ -0,0 +1,18 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
import { RatingItemProvider } from '../../contexts/RatingItemContext';
/**
* Render the final JSX of RatingDisplay
*/ export const renderRatingDisplay_unstable = (state, contextValues)=>{
assertSlots(state);
return /*#__PURE__*/ _jsx(RatingItemProvider, {
value: contextValues.ratingItem,
children: /*#__PURE__*/ _jsxs(state.root, {
children: [
state.root.children,
state.valueText && /*#__PURE__*/ _jsx(state.valueText, {}),
state.countText && /*#__PURE__*/ _jsx(state.countText, {})
]
})
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/renderRatingDisplay.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { RatingDisplayBaseState, RatingDisplaySlots, RatingDisplayContextValues } from './RatingDisplay.types';\nimport { RatingItemProvider } from '../../contexts/RatingItemContext';\n\n/**\n * Render the final JSX of RatingDisplay\n */\nexport const renderRatingDisplay_unstable = (\n state: RatingDisplayBaseState,\n contextValues: RatingDisplayContextValues,\n): JSXElement => {\n assertSlots<RatingDisplaySlots>(state);\n\n return (\n <RatingItemProvider value={contextValues.ratingItem}>\n <state.root>\n {state.root.children}\n {state.valueText && <state.valueText />}\n {state.countText && <state.countText />}\n </state.root>\n </RatingItemProvider>\n );\n};\n"],"names":["assertSlots","RatingItemProvider","renderRatingDisplay_unstable","state","contextValues","value","ratingItem","root","children","valueText","countText"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAC1CC,OACAC;IAEAJ,YAAgCG;IAEhC,qBACE,KAACF;QAAmBI,OAAOD,cAAcE,UAAU;kBACjD,cAAA,MAACH,MAAMI,IAAI;;gBACRJ,MAAMI,IAAI,CAACC,QAAQ;gBACnBL,MAAMM,SAAS,kBAAI,KAACN,MAAMM,SAAS;gBACnCN,MAAMO,SAAS,kBAAI,KAACP,MAAMO,SAAS;;;;AAI5C,EAAE"}

View File

@@ -0,0 +1,98 @@
'use client';
import * as React from 'react';
import { getIntrinsicElementProps, slot, useId } from '@fluentui/react-utilities';
import { StarFilled } from '@fluentui/react-icons';
import { RatingItem } from '../RatingItem/RatingItem';
/**
* Create the state required to render RatingDisplay.
*
* The returned state can be modified with hooks such as useRatingDisplayStyles_unstable,
* before being passed to renderRatingDisplay_unstable.
*
* @param props - props from this instance of RatingDisplay
* @param ref - reference to root HTMLDivElement of RatingDisplay
*/ export const useRatingDisplay_unstable = (props, ref)=>{
const { color = 'neutral', size = 'medium', icon = StarFilled, ...baseProps } = props;
const state = useRatingDisplayBase_unstable({
icon,
...baseProps
}, ref);
return {
...state,
icon,
color,
size
};
};
/**
* Base hook for RatingDisplay component. Manages state related to ARIA img role,
* aria-labelledby composition from valueText/countText IDs, slot structure, and
* compact/full display modes — without design props (color, size).
*
* @param props - props from this instance of RatingDisplay (without color, size)
* @param ref - reference to root HTMLDivElement of RatingDisplay
*/ export const useRatingDisplayBase_unstable = (props, ref)=>{
const { count, compact = false, icon, max = 5, value } = props;
const valueTextId = useId('rating-value-');
const countTextId = useId('rating-count-');
// Generate the child RatingItems and memoize them to prevent unnecessary re-rendering
const rootChildren = React.useMemo(()=>{
return compact ? /*#__PURE__*/ React.createElement(RatingItem, {
value: 1,
key: 1,
"aria-hidden": true
}) : Array.from(Array(max), (_, i)=>/*#__PURE__*/ React.createElement(RatingItem, {
value: i + 1,
key: i + 1,
"aria-hidden": true
}));
}, [
compact,
max
]);
const state = {
compact,
icon,
max,
value,
components: {
root: 'div',
valueText: 'span',
countText: 'span'
},
root: slot.always(getIntrinsicElementProps('div', {
ref,
children: rootChildren,
role: 'img',
...props
}), {
elementType: 'div'
}),
valueText: slot.optional(props.valueText, {
renderByDefault: value !== undefined,
defaultProps: {
children: value,
id: valueTextId,
'aria-hidden': true
},
elementType: 'span'
}),
countText: slot.optional(props.countText, {
renderByDefault: count !== undefined,
defaultProps: {
children: count === null || count === void 0 ? void 0 : count.toLocaleString(),
id: countTextId,
'aria-hidden': true
},
elementType: 'span'
})
};
if (!state.root['aria-label'] && !state.root['aria-labelledby']) {
var _state_valueText, _state_countText;
state.root['aria-labelledby'] = [
(_state_valueText = state.valueText) === null || _state_valueText === void 0 ? void 0 : _state_valueText.id,
(_state_countText = state.countText) === null || _state_countText === void 0 ? void 0 : _state_countText.id
].filter(Boolean).join(' ');
}
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
'use client';
import * as React from 'react';
export const useRatingDisplayContextValues = (state)=>{
const { color, compact, icon, size, value } = state;
const ratingItem = React.useMemo(()=>({
color,
compact,
iconFilled: icon,
iconOutline: icon,
interactive: false,
step: 0.5,
size,
value
}), [
color,
compact,
icon,
size,
value
]);
return {
ratingItem
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { RatingDisplayContextValues, RatingDisplayState } from './RatingDisplay.types';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport const useRatingDisplayContextValues = (state: RatingDisplayState): RatingDisplayContextValues => {\n const { color, compact, icon, size, value } = state;\n\n const ratingItem = React.useMemo<RatingItemContextValue>(\n () => ({\n color,\n compact,\n iconFilled: icon,\n iconOutline: icon,\n interactive: false,\n step: 0.5,\n size,\n value,\n }),\n [color, compact, icon, size, value],\n );\n\n return { ratingItem };\n};\n"],"names":["React","useRatingDisplayContextValues","state","color","compact","icon","size","value","ratingItem","useMemo","iconFilled","iconOutline","interactive","step"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGL;IAE9C,MAAMM,aAAaR,MAAMS,OAAO,CAC9B,IAAO,CAAA;YACLN;YACAC;YACAM,YAAYL;YACZM,aAAaN;YACbO,aAAa;YACbC,MAAM;YACNP;YACAC;QACF,CAAA,GACA;QAACJ;QAAOC;QAASC;QAAMC;QAAMC;KAAM;IAGrC,OAAO;QAAEC;IAAW;AACtB,EAAE"}

View File

@@ -0,0 +1,55 @@
'use client';
import { __resetStyles, __styles, mergeClasses } from '@griffel/react';
import { tokens, typographyStyles } from '@fluentui/react-theme';
export const ratingDisplayClassNames = {
root: 'fui-RatingDisplay',
valueText: 'fui-RatingDisplay__valueText',
countText: 'fui-RatingDisplay__countText'
};
/**
* Styles for the root slot
*/
const useRootClassName = /*#__PURE__*/__resetStyles("rxxdqwu", null, [".rxxdqwu{display:flex;flex-wrap:wrap;align-items:center;}"]);
const useLabelClassName = /*#__PURE__*/__resetStyles("rkwnos5", "rwei36a", [".rkwnos5{color:var(--colorNeutralForeground1);margin-left:var(--spacingHorizontalXS);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}", ".rwei36a{color:var(--colorNeutralForeground1);margin-right:var(--spacingHorizontalXS);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"]);
const useLabelStyles = /*#__PURE__*/__styles({
large: {
Be2twd7: "fkhj508",
Bg96gwp: "f1i3iumi",
Frg6f3: ["f1t5qyk5", "f1ikr372"]
},
extraLarge: {
Be2twd7: "fod5ikn",
Bg96gwp: "faaz57k",
Frg6f3: ["foyynoy", "f1vcna3q"]
},
strong: {
Bhrd7zp: "fl43uef"
},
divider: {
Ftih45: "f169p45e"
}
}, {
d: [".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1t5qyk5{margin-left:var(--spacingHorizontalSNudge);}", ".f1ikr372{margin-right:var(--spacingHorizontalSNudge);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".foyynoy{margin-left:var(--spacingHorizontalS);}", ".f1vcna3q{margin-right:var(--spacingHorizontalS);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f169p45e::before{content:\"\xB7 \";}"]
});
/**
* Apply styling to the RatingDisplay slots based on the state
*/
export const useRatingDisplayStyles_unstable = state => {
'use no memo';
const {
size
} = state;
const rootClassName = useRootClassName();
state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);
const labelClassName = useLabelClassName();
const labelStyles = useLabelStyles();
if (state.valueText) {
state.valueText.className = mergeClasses(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);
}
if (state.countText) {
state.countText.className = mergeClasses(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","typographyStyles","ratingDisplayClassNames","root","valueText","countText","useRootClassName","useLabelClassName","useLabelStyles","large","Be2twd7","Bg96gwp","Frg6f3","extraLarge","strong","Bhrd7zp","divider","Ftih45","d","useRatingDisplayStyles_unstable","state","size","rootClassName","className","labelClassName","labelStyles"],"sources":["useRatingDisplayStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const ratingDisplayClassNames = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText'\n};\n/**\n * Styles for the root slot\n */ const useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center'\n});\nconst useLabelClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n marginLeft: tokens.spacingHorizontalXS,\n ...typographyStyles.caption1\n});\nconst useLabelStyles = makeStyles({\n large: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n marginLeft: tokens.spacingHorizontalSNudge\n },\n extraLarge: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n marginLeft: tokens.spacingHorizontalS\n },\n strong: {\n fontWeight: tokens.fontWeightSemibold\n },\n divider: {\n '::before': {\n content: '\"· \"'\n }\n }\n});\n/**\n * Apply styling to the RatingDisplay slots based on the state\n */ export const useRatingDisplayStyles_unstable = (state)=>{\n 'use no memo';\n const { size } = state;\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);\n const labelClassName = useLabelClassName();\n const labelStyles = useLabelStyles();\n if (state.valueText) {\n state.valueText.className = mergeClasses(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);\n }\n if (state.countText) {\n state.countText.className = mergeClasses(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,uBAAuB,GAAG;EACnCC,IAAI,EAAE,mBAAmB;EACzBC,SAAS,EAAE,8BAA8B;EACzCC,SAAS,EAAE;AACf,CAAC;AACD;AACA;AACA;AAAI,MAAMC,gBAAgB,gBAAGT,aAAA,+EAI5B,CAAC;AACF,MAAMU,iBAAiB,gBAAGV,aAAA,seAIzB,CAAC;AACF,MAAMW,cAAc,gBAAGV,QAAA;EAAAW,KAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAH,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAE,MAAA;IAAAC,OAAA;EAAA;EAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAmBtB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,+BAA+B,GAAIC,KAAK,IAAG;EACxD,aAAa;;EACb,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK;EACtB,MAAME,aAAa,GAAGhB,gBAAgB,CAAC,CAAC;EACxCc,KAAK,CAACjB,IAAI,CAACoB,SAAS,GAAGxB,YAAY,CAACG,uBAAuB,CAACC,IAAI,EAAEmB,aAAa,EAAEF,KAAK,CAACjB,IAAI,CAACoB,SAAS,CAAC;EACtG,MAAMC,cAAc,GAAGjB,iBAAiB,CAAC,CAAC;EAC1C,MAAMkB,WAAW,GAAGjB,cAAc,CAAC,CAAC;EACpC,IAAIY,KAAK,CAAChB,SAAS,EAAE;IACjBgB,KAAK,CAAChB,SAAS,CAACmB,SAAS,GAAGxB,YAAY,CAACG,uBAAuB,CAACE,SAAS,EAAEoB,cAAc,EAAEC,WAAW,CAACX,MAAM,EAAEO,IAAI,KAAK,OAAO,IAAII,WAAW,CAAChB,KAAK,EAAEY,IAAI,KAAK,aAAa,IAAII,WAAW,CAACZ,UAAU,EAAEO,KAAK,CAAChB,SAAS,CAACmB,SAAS,CAAC;EACvO;EACA,IAAIH,KAAK,CAACf,SAAS,EAAE;IACjBe,KAAK,CAACf,SAAS,CAACkB,SAAS,GAAGxB,YAAY,CAACG,uBAAuB,CAACG,SAAS,EAAEmB,cAAc,EAAEH,IAAI,KAAK,OAAO,IAAII,WAAW,CAAChB,KAAK,EAAEY,IAAI,KAAK,aAAa,IAAII,WAAW,CAACZ,UAAU,EAAEO,KAAK,CAAChB,SAAS,IAAIqB,WAAW,CAACT,OAAO,EAAEI,KAAK,CAACf,SAAS,CAACkB,SAAS,CAAC;EAC3P;EACA,OAAOH,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,57 @@
'use client';
import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';
import { tokens, typographyStyles } from '@fluentui/react-theme';
export const ratingDisplayClassNames = {
root: 'fui-RatingDisplay',
valueText: 'fui-RatingDisplay__valueText',
countText: 'fui-RatingDisplay__countText'
};
/**
* Styles for the root slot
*/ const useRootClassName = makeResetStyles({
display: 'flex',
flexWrap: 'wrap',
alignItems: 'center'
});
const useLabelClassName = makeResetStyles({
color: tokens.colorNeutralForeground1,
marginLeft: tokens.spacingHorizontalXS,
...typographyStyles.caption1
});
const useLabelStyles = makeStyles({
large: {
fontSize: tokens.fontSizeBase300,
lineHeight: tokens.lineHeightBase300,
marginLeft: tokens.spacingHorizontalSNudge
},
extraLarge: {
fontSize: tokens.fontSizeBase400,
lineHeight: tokens.lineHeightBase400,
marginLeft: tokens.spacingHorizontalS
},
strong: {
fontWeight: tokens.fontWeightSemibold
},
divider: {
'::before': {
content: '"· "'
}
}
});
/**
* Apply styling to the RatingDisplay slots based on the state
*/ export const useRatingDisplayStyles_unstable = (state)=>{
'use no memo';
const { size } = state;
const rootClassName = useRootClassName();
state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);
const labelClassName = useLabelClassName();
const labelStyles = useLabelStyles();
if (state.valueText) {
state.valueText.className = mergeClasses(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);
}
if (state.countText) {
state.countText.className = mergeClasses(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingDisplaySlots, RatingDisplayState } from './RatingDisplay.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n\nexport const ratingDisplayClassNames: SlotClassNames<RatingDisplaySlots> = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText',\n};\n\n/**\n * Styles for the root slot\n */\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n});\n\nconst useLabelClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n marginLeft: tokens.spacingHorizontalXS,\n ...typographyStyles.caption1,\n});\n\nconst useLabelStyles = makeStyles({\n large: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n marginLeft: tokens.spacingHorizontalSNudge,\n },\n extraLarge: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n marginLeft: tokens.spacingHorizontalS,\n },\n strong: {\n fontWeight: tokens.fontWeightSemibold,\n },\n divider: {\n '::before': {\n content: '\"· \"',\n },\n },\n});\n\n/**\n * Apply styling to the RatingDisplay slots based on the state\n */\nexport const useRatingDisplayStyles_unstable = (state: RatingDisplayState): RatingDisplayState => {\n 'use no memo';\n\n const { size } = state;\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);\n const labelClassName = useLabelClassName();\n const labelStyles = useLabelStyles();\n\n if (state.valueText) {\n state.valueText.className = mergeClasses(\n ratingDisplayClassNames.valueText,\n labelClassName,\n labelStyles.strong,\n size === 'large' && labelStyles.large,\n size === 'extra-large' && labelStyles.extraLarge,\n state.valueText.className,\n );\n }\n if (state.countText) {\n state.countText.className = mergeClasses(\n ratingDisplayClassNames.countText,\n labelClassName,\n size === 'large' && labelStyles.large,\n size === 'extra-large' && labelStyles.extraLarge,\n state.valueText && labelStyles.divider,\n state.countText.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","typographyStyles","ratingDisplayClassNames","root","valueText","countText","useRootClassName","display","flexWrap","alignItems","useLabelClassName","color","colorNeutralForeground1","marginLeft","spacingHorizontalXS","caption1","useLabelStyles","large","fontSize","fontSizeBase300","lineHeight","lineHeightBase300","spacingHorizontalSNudge","extraLarge","fontSizeBase400","lineHeightBase400","spacingHorizontalS","strong","fontWeight","fontWeightSemibold","divider","content","useRatingDisplayStyles_unstable","state","size","rootClassName","className","labelClassName","labelStyles"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,WAAW;IACXC,WAAW;AACb,EAAE;AAEF;;CAEC,GAED,MAAMC,mBAAmBT,gBAAgB;IACvCU,SAAS;IACTC,UAAU;IACVC,YAAY;AACd;AAEA,MAAMC,oBAAoBb,gBAAgB;IACxCc,OAAOX,OAAOY,uBAAuB;IACrCC,YAAYb,OAAOc,mBAAmB;IACtC,GAAGb,iBAAiBc,QAAQ;AAC9B;AAEA,MAAMC,iBAAiBlB,WAAW;IAChCmB,OAAO;QACLC,UAAUlB,OAAOmB,eAAe;QAChCC,YAAYpB,OAAOqB,iBAAiB;QACpCR,YAAYb,OAAOsB,uBAAuB;IAC5C;IACAC,YAAY;QACVL,UAAUlB,OAAOwB,eAAe;QAChCJ,YAAYpB,OAAOyB,iBAAiB;QACpCZ,YAAYb,OAAO0B,kBAAkB;IACvC;IACAC,QAAQ;QACNC,YAAY5B,OAAO6B,kBAAkB;IACvC;IACAC,SAAS;QACP,YAAY;YACVC,SAAS;QACX;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAME,gBAAgB7B;IACtB2B,MAAM9B,IAAI,CAACiC,SAAS,GAAGrC,aAAaG,wBAAwBC,IAAI,EAAEgC,eAAeF,MAAM9B,IAAI,CAACiC,SAAS;IACrG,MAAMC,iBAAiB3B;IACvB,MAAM4B,cAActB;IAEpB,IAAIiB,MAAM7B,SAAS,EAAE;QACnB6B,MAAM7B,SAAS,CAACgC,SAAS,GAAGrC,aAC1BG,wBAAwBE,SAAS,EACjCiC,gBACAC,YAAYX,MAAM,EAClBO,SAAS,WAAWI,YAAYrB,KAAK,EACrCiB,SAAS,iBAAiBI,YAAYf,UAAU,EAChDU,MAAM7B,SAAS,CAACgC,SAAS;IAE7B;IACA,IAAIH,MAAM5B,SAAS,EAAE;QACnB4B,MAAM5B,SAAS,CAAC+B,SAAS,GAAGrC,aAC1BG,wBAAwBG,SAAS,EACjCgC,gBACAH,SAAS,WAAWI,YAAYrB,KAAK,EACrCiB,SAAS,iBAAiBI,YAAYf,UAAU,EAChDU,MAAM7B,SAAS,IAAIkC,YAAYR,OAAO,EACtCG,MAAM5B,SAAS,CAAC+B,SAAS;IAE7B;IAEA,OAAOH;AACT,EAAE"}

Some files were not shown because too many files have changed in this diff Show More