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

188
node_modules/@fluentui/keyboard-keys/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,188 @@
# Change Log - @fluentui/keyboard-keys
This log was last generated on Mon, 11 Nov 2024 09:55:28 GMT and should not be manually modified.
<!-- Start content -->
## [9.0.8](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.8)
Mon, 11 Nov 2024 09:55:28 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.7..@fluentui/keyboard-keys_v9.0.8)
### 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)
## [9.0.7](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.7)
Thu, 09 Nov 2023 17:29:49 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.6..@fluentui/keyboard-keys_v9.0.7)
### Patches
- chore: use package.json#files setup instead of npmignore for all v9 libraries ([PR #29734](https://github.com/microsoft/fluentui/pull/29734) by martinhochel@microsoft.com)
## [9.0.6](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.6)
Tue, 26 Sep 2023 17:49:01 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.5..@fluentui/keyboard-keys_v9.0.6)
### Patches
- chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
## [9.0.5](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.5)
Tue, 26 Sep 2023 15:32:07 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.4..@fluentui/keyboard-keys_v9.0.5)
### Patches
- fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
## [9.0.4](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.4)
Tue, 05 Sep 2023 13:29:14 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.3..@fluentui/keyboard-keys_v9.0.4)
### Patches
- bumps @swc/helpers version to 0.5.1 ([PR #28989](https://github.com/microsoft/fluentui/pull/28989) by bernardo.sunderhus@gmail.com)
## [9.0.3](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.3)
Fri, 12 May 2023 20:28:09 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.2..@fluentui/keyboard-keys_v9.0.3)
### Patches
- chore: exclude .swcrc from being published ([PR #27740](https://github.com/microsoft/fluentui/pull/27740) by olfedias@microsoft.com)
## [9.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.2)
Tue, 21 Mar 2023 21:23:19 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.1..@fluentui/keyboard-keys_v9.0.2)
### Patches
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.1)
Fri, 11 Nov 2022 14:57:50 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0..@fluentui/keyboard-keys_v9.0.1)
### Patches
- fix: create valid export maps ([PR #25558](https://github.com/microsoft/fluentui/pull/25558) by martinhochel@microsoft.com)
## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0)
Tue, 28 Jun 2022 15:14:09 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-rc.6..@fluentui/keyboard-keys_v9.0.0)
### Patches
- feat: Initial 9.0.0 release ([PR #23733](https://github.com/microsoft/fluentui/pull/23733) by lingfangao@hotmail.com)
## [9.0.0-rc.6](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-rc.6)
Thu, 05 May 2022 18:26:28 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-rc.5..@fluentui/keyboard-keys_v9.0.0-rc.6)
### Changes
- feat: ship rolluped only dts ([PR #22823](https://github.com/microsoft/fluentui/pull/22823) by martinhochel@microsoft.com)
## [9.0.0-rc.5](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-rc.5)
Wed, 04 May 2022 13:26:36 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-rc.4..@fluentui/keyboard-keys_v9.0.0-rc.5)
### Changes
- remove star exports ([PR #22681](https://github.com/microsoft/fluentui/pull/22681) by seanmonahan@microsoft.com)
## [9.0.0-rc.4](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-rc.4)
Fri, 04 Mar 2022 05:17:32 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-rc.3..@fluentui/keyboard-keys_v9.0.0-rc.4)
### Changes
- Adding explicit export maps on all consumer packages for FUIR 8 and 9. ([PR #21508](https://github.com/microsoft/fluentui/pull/21508) by dzearing@microsoft.com)
- keyboard-keys: Adding missing tslib dependency. ([PR #21947](https://github.com/microsoft/fluentui/pull/21947) by Humberto.Morimoto@microsoft.com)
## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-rc.3)
Fri, 18 Feb 2022 13:35:37 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-rc.1..@fluentui/keyboard-keys_v9.0.0-rc.3)
### Changes
- fix: Source maps contain original source code ([PR #21690](https://github.com/microsoft/fluentui/pull/21690) by lingfangao@hotmail.com)
## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-rc.1)
Thu, 10 Feb 2022 08:52:11 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-beta.1..@fluentui/keyboard-keys_v9.0.0-rc.1)
### Changes
- Bump Fluent UI packages to 9.0.0-rc ([PR #21623](https://github.com/microsoft/fluentui/pull/21623) by lingfangao@hotmail.com)
## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-beta.1)
Wed, 06 Oct 2021 10:37:22 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-alpha.5..@fluentui/keyboard-keys_v9.0.0-beta.1)
### Changes
- Bump all v9 components to beta prerelease tag ([PR #20106](https://github.com/microsoft/fluentui/pull/20106) by lingfangao@hotmail.com)
## [9.0.0-alpha.5](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-alpha.5)
Fri, 01 Oct 2021 14:13:08 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-alpha.3..@fluentui/keyboard-keys_v9.0.0-alpha.5)
### Changes
- Bump v9 prerelease versions to rerelease ([PR #20069](https://github.com/microsoft/fluentui/pull/20069) by lingfangao@hotmail.com)
## [9.0.0-alpha.3](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-alpha.3)
Fri, 20 Aug 2021 07:37:28 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-alpha.2..@fluentui/keyboard-keys_v9.0.0-alpha.3)
### Changes
- Update .npmignore ([PR #19441](https://github.com/microsoft/fluentui/pull/19441) by elcraig@microsoft.com)
## [9.0.0-alpha.2](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-alpha.2)
Tue, 03 Aug 2021 07:39:30 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-alpha.1..@fluentui/keyboard-keys_v9.0.0-alpha.2)
### Patches
- Bump @fluentui/eslint-plugin to v1.3.3 ([PR #19169](https://github.com/microsoft/fluentui/pull/19169) by behowell@microsoft.com)
- Bump @fluentui/scripts to v1.0.0 ([PR #19169](https://github.com/microsoft/fluentui/pull/19169) by behowell@microsoft.com)
## [9.0.0-alpha.1](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-alpha.1)
Tue, 20 Jul 2021 22:23:17 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/keyboard-keys_v9.0.0-alpha.0..@fluentui/keyboard-keys_v9.0.0-alpha.1)
### Changes
- Publish package ([PR #19016](https://github.com/microsoft/fluentui/pull/19016) by lingfan.gao@microsoft.com)
## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/keyboard-keys_v9.0.0-alpha.0)
Fri, 09 Jul 2021 07:39:31 GMT
### Patches
- Bump @fluentui/eslint-plugin to v1.3.2 ([PR #18808](https://github.com/microsoft/fluentui/pull/18808) by martinhochel@microsoft.com)
- Bump @fluentui/scripts to v1.0.0 ([PR #18808](https://github.com/microsoft/fluentui/pull/18808) by martinhochel@microsoft.com)

15
node_modules/@fluentui/keyboard-keys/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
@fluentui/keyboard-keys
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

45
node_modules/@fluentui/keyboard-keys/README.md generated vendored Normal file
View File

@@ -0,0 +1,45 @@
# @fluentui/keyboard-keys
Contains a set of keyboard constants for key and keyCode comparison in components. This package contains
**named key values** from [The w3 uievents-key specification](https://www.w3.org/TR/uievents-key/).
Unicode values are not included since there are a lot of locales to consider and they provide no benefit since
unicode characters can be used directly in code.
# Usage
```ts
import { Enter } from '@fluentui/keyboard-keys';
const onKeyDown = (e: React.KeyboardEvent) => {
if (e.key === Enter) {
// ...
}
// Unicode characters 'a', '1', '%'...
// should be used directly in code
if (e.key === 'a') {
// ...
}
};
```
## Legacy keyCode
In order to migrate easily from `@fluentui/keyboard-key` legacy `keyCode` support is available in this library but
is not encouraged for reuse since this propoerty has been deprecated for a while and will be removed in future
standards.
```ts
import { keyCodes } from '@fluentui/keyboard-keys';
const onKeyDown = (e: React.KeyboardEvent) => {
if (e.keyCode === keyCodes.Enter) {
// ...
}
if (e.key === keyCodes.a) {
// ...
}
};
```

1073
node_modules/@fluentui/keyboard-keys/dist/index.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,882 @@
// https://github.com/microsoft/rushstack/issues/2780
// API extractor can't support namespace exports
// export * as keyCodes from './keyCodes';
"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, {
AVRInput: function() {
return _keys.AVRInput;
},
AVRPower: function() {
return _keys.AVRPower;
},
Accept: function() {
return _keys.Accept;
},
Again: function() {
return _keys.Again;
},
AllCandidates: function() {
return _keys.AllCandidates;
},
Alphanumeric: function() {
return _keys.Alphanumeric;
},
Alt: function() {
return _keys.Alt;
},
AltGraph: function() {
return _keys.AltGraph;
},
AppSwitch: function() {
return _keys.AppSwitch;
},
ArrowDown: function() {
return _keys.ArrowDown;
},
ArrowLeft: function() {
return _keys.ArrowLeft;
},
ArrowRight: function() {
return _keys.ArrowRight;
},
ArrowUp: function() {
return _keys.ArrowUp;
},
Attn: function() {
return _keys.Attn;
},
AudioBalanceLeft: function() {
return _keys.AudioBalanceLeft;
},
AudioBalanceRight: function() {
return _keys.AudioBalanceRight;
},
AudioBassBoostDown: function() {
return _keys.AudioBassBoostDown;
},
AudioBassBoostToggle: function() {
return _keys.AudioBassBoostToggle;
},
AudioBassBoostUp: function() {
return _keys.AudioBassBoostUp;
},
AudioFaderFront: function() {
return _keys.AudioFaderFront;
},
AudioFaderRear: function() {
return _keys.AudioFaderRear;
},
AudioSurroundModeNext: function() {
return _keys.AudioSurroundModeNext;
},
AudioTrebleDown: function() {
return _keys.AudioTrebleDown;
},
AudioTrebleUp: function() {
return _keys.AudioTrebleUp;
},
AudioVolumeDown: function() {
return _keys.AudioVolumeDown;
},
AudioVolumeMute: function() {
return _keys.AudioVolumeMute;
},
AudioVolumeUp: function() {
return _keys.AudioVolumeUp;
},
Backspace: function() {
return _keys.Backspace;
},
BrightnessDown: function() {
return _keys.BrightnessDown;
},
BrightnessUp: function() {
return _keys.BrightnessUp;
},
BrowserBack: function() {
return _keys.BrowserBack;
},
BrowserFavorites: function() {
return _keys.BrowserFavorites;
},
BrowserForward: function() {
return _keys.BrowserForward;
},
BrowserHome: function() {
return _keys.BrowserHome;
},
BrowserRefresh: function() {
return _keys.BrowserRefresh;
},
BrowserSearch: function() {
return _keys.BrowserSearch;
},
BrowserStop: function() {
return _keys.BrowserStop;
},
Call: function() {
return _keys.Call;
},
Camera: function() {
return _keys.Camera;
},
CameraFocus: function() {
return _keys.CameraFocus;
},
Cancel: function() {
return _keys.Cancel;
},
CapsLock: function() {
return _keys.CapsLock;
},
ChannelDown: function() {
return _keys.ChannelDown;
},
ChannelUp: function() {
return _keys.ChannelUp;
},
Clear: function() {
return _keys.Clear;
},
Close: function() {
return _keys.Close;
},
ClosedCaptionToggle: function() {
return _keys.ClosedCaptionToggle;
},
CodeInput: function() {
return _keys.CodeInput;
},
ColorF0Red: function() {
return _keys.ColorF0Red;
},
ColorF1Green: function() {
return _keys.ColorF1Green;
},
ColorF2Yellow: function() {
return _keys.ColorF2Yellow;
},
ColorF3Blue: function() {
return _keys.ColorF3Blue;
},
ColorF4Grey: function() {
return _keys.ColorF4Grey;
},
ColorF5Brown: function() {
return _keys.ColorF5Brown;
},
Compose: function() {
return _keys.Compose;
},
ContextMenu: function() {
return _keys.ContextMenu;
},
Control: function() {
return _keys.Control;
},
Convert: function() {
return _keys.Convert;
},
Copy: function() {
return _keys.Copy;
},
CrSel: function() {
return _keys.CrSel;
},
Cut: function() {
return _keys.Cut;
},
DVR: function() {
return _keys.DVR;
},
Dead: function() {
return _keys.Dead;
},
Delete: function() {
return _keys.Delete;
},
Dimmer: function() {
return _keys.Dimmer;
},
DisplaySwap: function() {
return _keys.DisplaySwap;
},
Eisu: function() {
return _keys.Eisu;
},
Eject: function() {
return _keys.Eject;
},
End: function() {
return _keys.End;
},
EndCall: function() {
return _keys.EndCall;
},
Enter: function() {
return _keys.Enter;
},
EraseEof: function() {
return _keys.EraseEof;
},
Escape: function() {
return _keys.Escape;
},
ExSel: function() {
return _keys.ExSel;
},
Execute: function() {
return _keys.Execute;
},
Exit: function() {
return _keys.Exit;
},
F1: function() {
return _keys.F1;
},
F10: function() {
return _keys.F10;
},
F11: function() {
return _keys.F11;
},
F12: function() {
return _keys.F12;
},
F2: function() {
return _keys.F2;
},
F3: function() {
return _keys.F3;
},
F4: function() {
return _keys.F4;
},
F5: function() {
return _keys.F5;
},
F6: function() {
return _keys.F6;
},
F7: function() {
return _keys.F7;
},
F8: function() {
return _keys.F8;
},
F9: function() {
return _keys.F9;
},
FavoriteClear0: function() {
return _keys.FavoriteClear0;
},
FavoriteClear1: function() {
return _keys.FavoriteClear1;
},
FavoriteClear2: function() {
return _keys.FavoriteClear2;
},
FavoriteClear3: function() {
return _keys.FavoriteClear3;
},
FavoriteRecall0: function() {
return _keys.FavoriteRecall0;
},
FavoriteRecall1: function() {
return _keys.FavoriteRecall1;
},
FavoriteRecall2: function() {
return _keys.FavoriteRecall2;
},
FavoriteRecall3: function() {
return _keys.FavoriteRecall3;
},
FavoriteStore0: function() {
return _keys.FavoriteStore0;
},
FavoriteStore1: function() {
return _keys.FavoriteStore1;
},
FavoriteStore2: function() {
return _keys.FavoriteStore2;
},
FavoriteStore3: function() {
return _keys.FavoriteStore3;
},
FinalMode: function() {
return _keys.FinalMode;
},
Find: function() {
return _keys.Find;
},
Fn: function() {
return _keys.Fn;
},
FnLock: function() {
return _keys.FnLock;
},
GoBack: function() {
return _keys.GoBack;
},
GoHome: function() {
return _keys.GoHome;
},
GroupFirst: function() {
return _keys.GroupFirst;
},
GroupLast: function() {
return _keys.GroupLast;
},
GroupNext: function() {
return _keys.GroupNext;
},
GroupPrevious: function() {
return _keys.GroupPrevious;
},
Guide: function() {
return _keys.Guide;
},
GuideNextDay: function() {
return _keys.GuideNextDay;
},
GuidePreviousDay: function() {
return _keys.GuidePreviousDay;
},
HangulMode: function() {
return _keys.HangulMode;
},
HanjaMode: function() {
return _keys.HanjaMode;
},
Hankaku: function() {
return _keys.Hankaku;
},
HeadsetHook: function() {
return _keys.HeadsetHook;
},
Help: function() {
return _keys.Help;
},
Hibernate: function() {
return _keys.Hibernate;
},
Hiragana: function() {
return _keys.Hiragana;
},
HiraganaKatakana: function() {
return _keys.HiraganaKatakana;
},
Home: function() {
return _keys.Home;
},
Hyper: function() {
return _keys.Hyper;
},
Info: function() {
return _keys.Info;
},
Insert: function() {
return _keys.Insert;
},
InstantReplay: function() {
return _keys.InstantReplay;
},
JunjaMode: function() {
return _keys.JunjaMode;
},
KanaMode: function() {
return _keys.KanaMode;
},
KanjiMode: function() {
return _keys.KanjiMode;
},
Katakana: function() {
return _keys.Katakana;
},
Key11: function() {
return _keys.Key11;
},
Key12: function() {
return _keys.Key12;
},
LastNumberRedial: function() {
return _keys.LastNumberRedial;
},
LaunchApplication1: function() {
return _keys.LaunchApplication1;
},
LaunchApplication2: function() {
return _keys.LaunchApplication2;
},
LaunchCalendar: function() {
return _keys.LaunchCalendar;
},
LaunchContacts: function() {
return _keys.LaunchContacts;
},
LaunchMail: function() {
return _keys.LaunchMail;
},
LaunchMediaPlayer: function() {
return _keys.LaunchMediaPlayer;
},
LaunchMusicPlayer: function() {
return _keys.LaunchMusicPlayer;
},
LaunchPhone: function() {
return _keys.LaunchPhone;
},
LaunchScreenSaver: function() {
return _keys.LaunchScreenSaver;
},
LaunchSpreadsheet: function() {
return _keys.LaunchSpreadsheet;
},
LaunchWebBrowser: function() {
return _keys.LaunchWebBrowser;
},
LaunchWebCam: function() {
return _keys.LaunchWebCam;
},
LaunchWordProcessor: function() {
return _keys.LaunchWordProcessor;
},
Link: function() {
return _keys.Link;
},
ListProgram: function() {
return _keys.ListProgram;
},
LiveContent: function() {
return _keys.LiveContent;
},
Lock: function() {
return _keys.Lock;
},
LogOff: function() {
return _keys.LogOff;
},
MailForward: function() {
return _keys.MailForward;
},
MailReply: function() {
return _keys.MailReply;
},
MailSend: function() {
return _keys.MailSend;
},
MannerMode: function() {
return _keys.MannerMode;
},
MediaApps: function() {
return _keys.MediaApps;
},
MediaAudioTrack: function() {
return _keys.MediaAudioTrack;
},
MediaClose: function() {
return _keys.MediaClose;
},
MediaFastForward: function() {
return _keys.MediaFastForward;
},
MediaLast: function() {
return _keys.MediaLast;
},
MediaNextTrack: function() {
return _keys.MediaNextTrack;
},
MediaPause: function() {
return _keys.MediaPause;
},
MediaPlay: function() {
return _keys.MediaPlay;
},
MediaPlayPause: function() {
return _keys.MediaPlayPause;
},
MediaPreviousTrack: function() {
return _keys.MediaPreviousTrack;
},
MediaRecord: function() {
return _keys.MediaRecord;
},
MediaRewind: function() {
return _keys.MediaRewind;
},
MediaSkipBackward: function() {
return _keys.MediaSkipBackward;
},
MediaSkipForward: function() {
return _keys.MediaSkipForward;
},
MediaStepBackward: function() {
return _keys.MediaStepBackward;
},
MediaStepForward: function() {
return _keys.MediaStepForward;
},
MediaStop: function() {
return _keys.MediaStop;
},
MediaTopMenu: function() {
return _keys.MediaTopMenu;
},
MediaTrackNext: function() {
return _keys.MediaTrackNext;
},
MediaTrackPrevious: function() {
return _keys.MediaTrackPrevious;
},
Meta: function() {
return _keys.Meta;
},
MicrophoneToggle: function() {
return _keys.MicrophoneToggle;
},
MicrophoneVolumeDown: function() {
return _keys.MicrophoneVolumeDown;
},
MicrophoneVolumeMute: function() {
return _keys.MicrophoneVolumeMute;
},
MicrophoneVolumeUp: function() {
return _keys.MicrophoneVolumeUp;
},
ModeChange: function() {
return _keys.ModeChange;
},
NavigateIn: function() {
return _keys.NavigateIn;
},
NavigateNext: function() {
return _keys.NavigateNext;
},
NavigateOut: function() {
return _keys.NavigateOut;
},
NavigatePrevious: function() {
return _keys.NavigatePrevious;
},
New: function() {
return _keys.New;
},
NextCandidate: function() {
return _keys.NextCandidate;
},
NextFavoriteChannel: function() {
return _keys.NextFavoriteChannel;
},
NextUserProfile: function() {
return _keys.NextUserProfile;
},
NonConvert: function() {
return _keys.NonConvert;
},
Notification: function() {
return _keys.Notification;
},
NumLock: function() {
return _keys.NumLock;
},
OnDemand: function() {
return _keys.OnDemand;
},
Open: function() {
return _keys.Open;
},
PageDown: function() {
return _keys.PageDown;
},
PageUp: function() {
return _keys.PageUp;
},
Pairing: function() {
return _keys.Pairing;
},
Paste: function() {
return _keys.Paste;
},
Pause: function() {
return _keys.Pause;
},
PinPDown: function() {
return _keys.PinPDown;
},
PinPMove: function() {
return _keys.PinPMove;
},
PinPToggle: function() {
return _keys.PinPToggle;
},
PinPUp: function() {
return _keys.PinPUp;
},
Play: function() {
return _keys.Play;
},
PlaySpeedDown: function() {
return _keys.PlaySpeedDown;
},
PlaySpeedReset: function() {
return _keys.PlaySpeedReset;
},
PlaySpeedUp: function() {
return _keys.PlaySpeedUp;
},
Power: function() {
return _keys.Power;
},
PowerOff: function() {
return _keys.PowerOff;
},
PreviousCandidate: function() {
return _keys.PreviousCandidate;
},
Print: function() {
return _keys.Print;
},
PrintScreen: function() {
return _keys.PrintScreen;
},
Process: function() {
return _keys.Process;
},
Props: function() {
return _keys.Props;
},
RandomToggle: function() {
return _keys.RandomToggle;
},
RcLowBattery: function() {
return _keys.RcLowBattery;
},
RecordSpeedNext: function() {
return _keys.RecordSpeedNext;
},
Redo: function() {
return _keys.Redo;
},
RfBypass: function() {
return _keys.RfBypass;
},
Romaji: function() {
return _keys.Romaji;
},
STBInput: function() {
return _keys.STBInput;
},
STBPower: function() {
return _keys.STBPower;
},
Save: function() {
return _keys.Save;
},
ScanChannelsToggle: function() {
return _keys.ScanChannelsToggle;
},
ScreenModeNext: function() {
return _keys.ScreenModeNext;
},
ScrollLock: function() {
return _keys.ScrollLock;
},
Select: function() {
return _keys.Select;
},
Settings: function() {
return _keys.Settings;
},
Shift: function() {
return _keys.Shift;
},
SingleCandidate: function() {
return _keys.SingleCandidate;
},
Soft1: function() {
return _keys.Soft1;
},
Soft2: function() {
return _keys.Soft2;
},
Soft3: function() {
return _keys.Soft3;
},
Soft4: function() {
return _keys.Soft4;
},
Space: function() {
return _keys.Space;
},
SpeechCorrectionList: function() {
return _keys.SpeechCorrectionList;
},
SpeechInputToggle: function() {
return _keys.SpeechInputToggle;
},
SpellCheck: function() {
return _keys.SpellCheck;
},
SplitScreenToggle: function() {
return _keys.SplitScreenToggle;
},
Standby: function() {
return _keys.Standby;
},
Subtitle: function() {
return _keys.Subtitle;
},
Super: function() {
return _keys.Super;
},
Symbol: function() {
return _keys.Symbol;
},
SymbolLock: function() {
return _keys.SymbolLock;
},
TV: function() {
return _keys.TV;
},
TV3DMode: function() {
return _keys.TV3DMode;
},
TVAntennaCable: function() {
return _keys.TVAntennaCable;
},
TVAudioDescription: function() {
return _keys.TVAudioDescription;
},
TVAudioDescriptionMixDown: function() {
return _keys.TVAudioDescriptionMixDown;
},
TVAudioDescriptionMixUp: function() {
return _keys.TVAudioDescriptionMixUp;
},
TVContentsMenu: function() {
return _keys.TVContentsMenu;
},
TVDataService: function() {
return _keys.TVDataService;
},
TVInput: function() {
return _keys.TVInput;
},
TVInputComponent1: function() {
return _keys.TVInputComponent1;
},
TVInputComponent2: function() {
return _keys.TVInputComponent2;
},
TVInputComposite1: function() {
return _keys.TVInputComposite1;
},
TVInputComposite2: function() {
return _keys.TVInputComposite2;
},
TVInputHDMI1: function() {
return _keys.TVInputHDMI1;
},
TVInputHDMI2: function() {
return _keys.TVInputHDMI2;
},
TVInputHDMI3: function() {
return _keys.TVInputHDMI3;
},
TVInputHDMI4: function() {
return _keys.TVInputHDMI4;
},
TVInputVGA1: function() {
return _keys.TVInputVGA1;
},
TVMediaContext: function() {
return _keys.TVMediaContext;
},
TVNetwork: function() {
return _keys.TVNetwork;
},
TVNumberEntry: function() {
return _keys.TVNumberEntry;
},
TVPower: function() {
return _keys.TVPower;
},
TVRadioService: function() {
return _keys.TVRadioService;
},
TVSatellite: function() {
return _keys.TVSatellite;
},
TVSatelliteBS: function() {
return _keys.TVSatelliteBS;
},
TVSatelliteCS: function() {
return _keys.TVSatelliteCS;
},
TVSatelliteToggle: function() {
return _keys.TVSatelliteToggle;
},
TVTerrestrialAnalog: function() {
return _keys.TVTerrestrialAnalog;
},
TVTerrestrialDigital: function() {
return _keys.TVTerrestrialDigital;
},
TVTimer: function() {
return _keys.TVTimer;
},
Tab: function() {
return _keys.Tab;
},
Teletext: function() {
return _keys.Teletext;
},
Undo: function() {
return _keys.Undo;
},
Unidentified: function() {
return _keys.Unidentified;
},
VideoModeNext: function() {
return _keys.VideoModeNext;
},
VoiceDial: function() {
return _keys.VoiceDial;
},
WakeUp: function() {
return _keys.WakeUp;
},
Wink: function() {
return _keys.Wink;
},
Zenkaku: function() {
return _keys.Zenkaku;
},
ZenkakuHankaku: function() {
return _keys.ZenkakuHankaku;
},
ZoomIn: function() {
return _keys.ZoomIn;
},
ZoomOut: function() {
return _keys.ZoomOut;
},
ZoomToggle: function() {
return _keys.ZoomToggle;
},
keyCodes: function() {
return _keyCodes;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _keyCodes = /*#__PURE__*/ _interop_require_wildcard._(require("./keyCodes"));
const _keys = require("./keys");

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,664 @@
"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, {
A: function() {
return A;
},
Accept: function() {
return Accept;
},
Alt: function() {
return Alt;
},
AltGraph: function() {
return AltGraph;
},
Ampersand: function() {
return Ampersand;
},
ArrowDown: function() {
return ArrowDown;
},
ArrowLeft: function() {
return ArrowLeft;
},
ArrowRight: function() {
return ArrowRight;
},
ArrowUp: function() {
return ArrowUp;
},
AtSign: function() {
return AtSign;
},
Attn: function() {
return Attn;
},
B: function() {
return B;
},
BackSlash: function() {
return BackSlash;
},
Backspace: function() {
return Backspace;
},
C: function() {
return C;
},
Cancel: function() {
return Cancel;
},
CapsLock: function() {
return CapsLock;
},
Caret: function() {
return Caret;
},
Clear: function() {
return Clear;
},
Comma: function() {
return Comma;
},
ContextMenu: function() {
return ContextMenu;
},
Control: function() {
return Control;
},
Convert: function() {
return Convert;
},
CrSel: function() {
return CrSel;
},
D: function() {
return D;
},
Decimal: function() {
return Decimal;
},
Delete: function() {
return Delete;
},
Digit0: function() {
return Digit0;
},
Digit1: function() {
return Digit1;
},
Digit2: function() {
return Digit2;
},
Digit3: function() {
return Digit3;
},
Digit4: function() {
return Digit4;
},
Digit5: function() {
return Digit5;
},
Digit6: function() {
return Digit6;
},
Digit7: function() {
return Digit7;
},
Digit8: function() {
return Digit8;
},
Digit9: function() {
return Digit9;
},
DollarSign: function() {
return DollarSign;
},
DoubleQuote: function() {
return DoubleQuote;
},
E: function() {
return E;
},
End: function() {
return End;
},
Enter: function() {
return Enter;
},
EqualsSign: function() {
return EqualsSign;
},
EraseEof: function() {
return EraseEof;
},
Escape: function() {
return Escape;
},
ExSel: function() {
return ExSel;
},
ExclamationPoint: function() {
return ExclamationPoint;
},
Execute: function() {
return Execute;
},
F: function() {
return F;
},
F1: function() {
return F1;
},
F10: function() {
return F10;
},
F11: function() {
return F11;
},
F12: function() {
return F12;
},
F13: function() {
return F13;
},
F14: function() {
return F14;
},
F15: function() {
return F15;
},
F16: function() {
return F16;
},
F17: function() {
return F17;
},
F18: function() {
return F18;
},
F19: function() {
return F19;
},
F2: function() {
return F2;
},
F20: function() {
return F20;
},
F21: function() {
return F21;
},
F22: function() {
return F22;
},
F23: function() {
return F23;
},
F24: function() {
return F24;
},
F3: function() {
return F3;
},
F4: function() {
return F4;
},
F5: function() {
return F5;
},
F6: function() {
return F6;
},
F7: function() {
return F7;
},
F8: function() {
return F8;
},
F9: function() {
return F9;
},
ForwardSlash: function() {
return ForwardSlash;
},
G: function() {
return G;
},
GraveAccent: function() {
return GraveAccent;
},
H: function() {
return H;
},
Help: function() {
return Help;
},
Home: function() {
return Home;
},
I: function() {
return I;
},
Insert: function() {
return Insert;
},
J: function() {
return J;
},
K: function() {
return K;
},
L: function() {
return L;
},
LeftAngleBracket: function() {
return LeftAngleBracket;
},
LeftCurlyBrace: function() {
return LeftCurlyBrace;
},
LeftParenthesis: function() {
return LeftParenthesis;
},
LeftSquareBracket: function() {
return LeftSquareBracket;
},
M: function() {
return M;
},
Meta: function() {
return Meta;
},
MinusSign: function() {
return MinusSign;
},
ModeChange: function() {
return ModeChange;
},
MultiplicationSign: function() {
return MultiplicationSign;
},
N: function() {
return N;
},
NonConvert: function() {
return NonConvert;
},
NumLock: function() {
return NumLock;
},
O: function() {
return O;
},
OS: function() {
return OS;
},
P: function() {
return P;
},
PageDown: function() {
return PageDown;
},
PageUp: function() {
return PageUp;
},
Pause: function() {
return Pause;
},
PercentSign: function() {
return PercentSign;
},
Pipe: function() {
return Pipe;
},
Play: function() {
return Play;
},
PlusSign: function() {
return PlusSign;
},
PoundSign: function() {
return PoundSign;
},
Print: function() {
return Print;
},
PrintScreen: function() {
return PrintScreen;
},
Q: function() {
return Q;
},
QuestionMark: function() {
return QuestionMark;
},
R: function() {
return R;
},
RightAngleBracket: function() {
return RightAngleBracket;
},
RightCurlyBrace: function() {
return RightCurlyBrace;
},
RightParenthesis: function() {
return RightParenthesis;
},
RightSquareBracket: function() {
return RightSquareBracket;
},
S: function() {
return S;
},
ScrollLock: function() {
return ScrollLock;
},
Select: function() {
return Select;
},
Semicolon: function() {
return Semicolon;
},
Shift: function() {
return Shift;
},
SingleQuote: function() {
return SingleQuote;
},
Space: function() {
return Space;
},
T: function() {
return T;
},
Tab: function() {
return Tab;
},
Tilde: function() {
return Tilde;
},
U: function() {
return U;
},
Underscore: function() {
return Underscore;
},
V: function() {
return V;
},
VolumeDown: function() {
return VolumeDown;
},
VolumeMute: function() {
return VolumeMute;
},
VolumeUp: function() {
return VolumeUp;
},
W: function() {
return W;
},
X: function() {
return X;
},
Y: function() {
return Y;
},
Z: function() {
return Z;
},
ZoomOut: function() {
return ZoomOut;
},
a: function() {
return a;
},
b: function() {
return b;
},
c: function() {
return c;
},
d: function() {
return d;
},
e: function() {
return e;
},
f: function() {
return f;
},
g: function() {
return g;
},
h: function() {
return h;
},
i: function() {
return i;
},
j: function() {
return j;
},
k: function() {
return k;
},
l: function() {
return l;
},
m: function() {
return m;
},
n: function() {
return n;
},
o: function() {
return o;
},
p: function() {
return p;
},
q: function() {
return q;
},
r: function() {
return r;
},
s: function() {
return s;
},
t: function() {
return t;
},
u: function() {
return u;
},
v: function() {
return v;
},
w: function() {
return w;
},
x: function() {
return x;
},
y: function() {
return y;
},
z: function() {
return z;
}
});
const Cancel = 3;
const Help = 6;
const Backspace = 8;
const Tab = 9;
const Clear = 12;
const Enter = 13;
const Shift = 16;
const Control = 17;
const Alt = 18;
const Pause = 19;
const CapsLock = 20;
const Escape = 27;
const Convert = 28;
const NonConvert = 29;
const Accept = 30;
const ModeChange = 31;
const Space = 32;
const PageUp = 33;
const PageDown = 34;
const End = 35;
const Home = 36;
const ArrowLeft = 37;
const ArrowUp = 38;
const ArrowRight = 39;
const ArrowDown = 40;
const Select = 41;
const Print = 42;
const Execute = 43;
const PrintScreen = 44;
const Insert = 45;
const Delete = 46;
const Digit0 = 48;
const RightParenthesis = 48;
const Digit1 = 49;
const ExclamationPoint = 49;
const Digit2 = 50;
const AtSign = 50;
const Digit3 = 51;
const PoundSign = 51;
const Digit4 = 52;
const DollarSign = 52;
const Digit5 = 53;
const PercentSign = 53;
const Digit6 = 54;
const Caret = 54;
const Digit7 = 55;
const Ampersand = 55;
const Digit8 = 56;
const MultiplicationSign = 56;
const Digit9 = 57;
const LeftParenthesis = 57;
const a = 65;
const A = 65;
const b = 66;
const B = 66;
const c = 67;
const C = 67;
const d = 68;
const D = 68;
const e = 69;
const E = 69;
const f = 70;
const F = 70;
const g = 71;
const G = 71;
const h = 72;
const H = 72;
const i = 73;
const I = 73;
const j = 74;
const J = 74;
const k = 75;
const K = 75;
const l = 76;
const L = 76;
const m = 77;
const M = 77;
const n = 78;
const N = 78;
const o = 79;
const O = 79;
const p = 80;
const P = 80;
const q = 81;
const Q = 81;
const r = 82;
const R = 82;
const s = 83;
const S = 83;
const t = 84;
const T = 84;
const u = 85;
const U = 85;
const v = 86;
const V = 86;
const w = 87;
const W = 87;
const x = 88;
const X = 88;
const y = 89;
const Y = 89;
const z = 90;
const Z = 90;
const OS = 91;
const ContextMenu = 93;
const F1 = 112;
const F2 = 113;
const F3 = 114;
const F4 = 115;
const F5 = 116;
const F6 = 117;
const F7 = 118;
const F8 = 119;
const F9 = 120;
const F10 = 121;
const F11 = 122;
const F12 = 123;
const F13 = 124;
const F14 = 125;
const F15 = 126;
const F16 = 127;
const F17 = 128;
const F18 = 129;
const F19 = 130;
const F20 = 131;
const F21 = 132;
const F22 = 133;
const F23 = 134;
const F24 = 135;
const NumLock = 144;
const ScrollLock = 145;
const VolumeMute = 181;
const VolumeDown = 182;
const VolumeUp = 183;
const Semicolon = 186;
const EqualsSign = 187;
const PlusSign = 187;
const Comma = 188;
const LeftAngleBracket = 188;
const MinusSign = 189;
const Underscore = 189;
const Decimal = 190;
const RightAngleBracket = 190;
const ForwardSlash = 191;
const QuestionMark = 191;
const GraveAccent = 192;
const Tilde = 192;
const LeftSquareBracket = 219;
const LeftCurlyBrace = 219;
const BackSlash = 220;
const Pipe = 220;
const RightSquareBracket = 221;
const RightCurlyBrace = 221;
const SingleQuote = 222;
const DoubleQuote = 222;
const Meta = 224;
const AltGraph = 225;
const Attn = 246;
const CrSel = 247;
const ExSel = 248;
const EraseEof = 249;
const Play = 250;
const ZoomOut = 251;

File diff suppressed because one or more lines are too long

1160
node_modules/@fluentui/keyboard-keys/lib-commonjs/keys.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

6
node_modules/@fluentui/keyboard-keys/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
// https://github.com/microsoft/rushstack/issues/2780
// API extractor can't support namespace exports
// export * as keyCodes from './keyCodes';
import * as keyCodes from './keyCodes';
export { keyCodes };
export { AVRInput, AVRPower, Accept, Again, AllCandidates, Alphanumeric, Alt, AltGraph, AppSwitch, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Attn, AudioBalanceLeft, AudioBalanceRight, AudioBassBoostDown, AudioBassBoostToggle, AudioBassBoostUp, AudioFaderFront, AudioFaderRear, AudioSurroundModeNext, AudioTrebleDown, AudioTrebleUp, AudioVolumeDown, AudioVolumeMute, AudioVolumeUp, Backspace, BrightnessDown, BrightnessUp, BrowserBack, BrowserFavorites, BrowserForward, BrowserHome, BrowserRefresh, BrowserSearch, BrowserStop, Call, Camera, CameraFocus, Cancel, CapsLock, ChannelDown, ChannelUp, Clear, Close, ClosedCaptionToggle, CodeInput, ColorF0Red, ColorF1Green, ColorF2Yellow, ColorF3Blue, ColorF4Grey, ColorF5Brown, Compose, ContextMenu, Control, Convert, Copy, CrSel, Cut, DVR, Dead, Delete, Dimmer, DisplaySwap, Eisu, Eject, End, EndCall, Enter, EraseEof, Escape, ExSel, Execute, Exit, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, FavoriteClear0, FavoriteClear1, FavoriteClear2, FavoriteClear3, FavoriteRecall0, FavoriteRecall1, FavoriteRecall2, FavoriteRecall3, FavoriteStore0, FavoriteStore1, FavoriteStore2, FavoriteStore3, FinalMode, Find, Fn, FnLock, GoBack, GoHome, GroupFirst, GroupLast, GroupNext, GroupPrevious, Guide, GuideNextDay, GuidePreviousDay, HangulMode, HanjaMode, Hankaku, HeadsetHook, Help, Hibernate, Hiragana, HiraganaKatakana, Home, Hyper, Info, Insert, InstantReplay, JunjaMode, KanaMode, KanjiMode, Katakana, Key11, Key12, LastNumberRedial, LaunchApplication1, LaunchApplication2, LaunchCalendar, LaunchContacts, LaunchMail, LaunchMediaPlayer, LaunchMusicPlayer, LaunchPhone, LaunchScreenSaver, LaunchSpreadsheet, LaunchWebBrowser, LaunchWebCam, LaunchWordProcessor, Link, ListProgram, LiveContent, Lock, LogOff, MailForward, MailReply, MailSend, MannerMode, MediaApps, MediaAudioTrack, MediaClose, MediaFastForward, MediaLast, MediaNextTrack, MediaPause, MediaPlay, MediaPlayPause, MediaPreviousTrack, MediaRecord, MediaRewind, MediaSkipBackward, MediaSkipForward, MediaStepBackward, MediaStepForward, MediaStop, MediaTopMenu, MediaTrackNext, MediaTrackPrevious, Meta, MicrophoneToggle, MicrophoneVolumeDown, MicrophoneVolumeMute, MicrophoneVolumeUp, ModeChange, NavigateIn, NavigateNext, NavigateOut, NavigatePrevious, New, NextCandidate, NextFavoriteChannel, NextUserProfile, NonConvert, Notification, NumLock, OnDemand, Open, PageDown, PageUp, Pairing, Paste, Pause, PinPDown, PinPMove, PinPToggle, PinPUp, Play, PlaySpeedDown, PlaySpeedReset, PlaySpeedUp, Power, PowerOff, PreviousCandidate, Print, PrintScreen, Process, Props, RandomToggle, RcLowBattery, RecordSpeedNext, Redo, RfBypass, Romaji, STBInput, STBPower, Save, ScanChannelsToggle, ScreenModeNext, ScrollLock, Select, Settings, Shift, SingleCandidate, Soft1, Soft2, Soft3, Soft4, Space, SpeechCorrectionList, SpeechInputToggle, SpellCheck, SplitScreenToggle, Standby, Subtitle, Super, Symbol, SymbolLock, TV, TV3DMode, TVAntennaCable, TVAudioDescription, TVAudioDescriptionMixDown, TVAudioDescriptionMixUp, TVContentsMenu, TVDataService, TVInput, TVInputComponent1, TVInputComponent2, TVInputComposite1, TVInputComposite2, TVInputHDMI1, TVInputHDMI2, TVInputHDMI3, TVInputHDMI4, TVInputVGA1, TVMediaContext, TVNetwork, TVNumberEntry, TVPower, TVRadioService, TVSatellite, TVSatelliteBS, TVSatelliteCS, TVSatelliteToggle, TVTerrestrialAnalog, TVTerrestrialDigital, TVTimer, Tab, Teletext, Undo, Unidentified, VideoModeNext, VoiceDial, WakeUp, Wink, Zenkaku, ZenkakuHankaku, ZoomIn, ZoomOut, ZoomToggle } from './keys';

File diff suppressed because one or more lines are too long

163
node_modules/@fluentui/keyboard-keys/lib/keyCodes.js generated vendored Normal file
View File

@@ -0,0 +1,163 @@
export const Cancel = 3;
export const Help = 6;
export const Backspace = 8;
export const Tab = 9;
export const Clear = 12;
export const Enter = 13;
export const Shift = 16;
export const Control = 17;
export const Alt = 18;
export const Pause = 19;
export const CapsLock = 20;
export const Escape = 27;
export const Convert = 28;
export const NonConvert = 29;
export const Accept = 30;
export const ModeChange = 31;
export const Space = 32;
export const PageUp = 33;
export const PageDown = 34;
export const End = 35;
export const Home = 36;
export const ArrowLeft = 37;
export const ArrowUp = 38;
export const ArrowRight = 39;
export const ArrowDown = 40;
export const Select = 41;
export const Print = 42;
export const Execute = 43;
export const PrintScreen = 44;
export const Insert = 45;
export const Delete = 46;
export const Digit0 = 48;
export const RightParenthesis = 48;
export const Digit1 = 49;
export const ExclamationPoint = 49;
export const Digit2 = 50;
export const AtSign = 50;
export const Digit3 = 51;
export const PoundSign = 51;
export const Digit4 = 52;
export const DollarSign = 52;
export const Digit5 = 53;
export const PercentSign = 53;
export const Digit6 = 54;
export const Caret = 54;
export const Digit7 = 55;
export const Ampersand = 55;
export const Digit8 = 56;
export const MultiplicationSign = 56;
export const Digit9 = 57;
export const LeftParenthesis = 57;
export const a = 65;
export const A = 65;
export const b = 66;
export const B = 66;
export const c = 67;
export const C = 67;
export const d = 68;
export const D = 68;
export const e = 69;
export const E = 69;
export const f = 70;
export const F = 70;
export const g = 71;
export const G = 71;
export const h = 72;
export const H = 72;
export const i = 73;
export const I = 73;
export const j = 74;
export const J = 74;
export const k = 75;
export const K = 75;
export const l = 76;
export const L = 76;
export const m = 77;
export const M = 77;
export const n = 78;
export const N = 78;
export const o = 79;
export const O = 79;
export const p = 80;
export const P = 80;
export const q = 81;
export const Q = 81;
export const r = 82;
export const R = 82;
export const s = 83;
export const S = 83;
export const t = 84;
export const T = 84;
export const u = 85;
export const U = 85;
export const v = 86;
export const V = 86;
export const w = 87;
export const W = 87;
export const x = 88;
export const X = 88;
export const y = 89;
export const Y = 89;
export const z = 90;
export const Z = 90;
export const OS = 91;
export const ContextMenu = 93;
export const F1 = 112;
export const F2 = 113;
export const F3 = 114;
export const F4 = 115;
export const F5 = 116;
export const F6 = 117;
export const F7 = 118;
export const F8 = 119;
export const F9 = 120;
export const F10 = 121;
export const F11 = 122;
export const F12 = 123;
export const F13 = 124;
export const F14 = 125;
export const F15 = 126;
export const F16 = 127;
export const F17 = 128;
export const F18 = 129;
export const F19 = 130;
export const F20 = 131;
export const F21 = 132;
export const F22 = 133;
export const F23 = 134;
export const F24 = 135;
export const NumLock = 144;
export const ScrollLock = 145;
export const VolumeMute = 181;
export const VolumeDown = 182;
export const VolumeUp = 183;
export const Semicolon = 186;
export const EqualsSign = 187;
export const PlusSign = 187;
export const Comma = 188;
export const LeftAngleBracket = 188;
export const MinusSign = 189;
export const Underscore = 189;
export const Decimal = 190;
export const RightAngleBracket = 190;
export const ForwardSlash = 191;
export const QuestionMark = 191;
export const GraveAccent = 192;
export const Tilde = 192;
export const LeftSquareBracket = 219;
export const LeftCurlyBrace = 219;
export const BackSlash = 220;
export const Pipe = 220;
export const RightSquareBracket = 221;
export const RightCurlyBrace = 221;
export const SingleQuote = 222;
export const DoubleQuote = 222;
export const Meta = 224;
export const AltGraph = 225;
export const Attn = 246;
export const CrSel = 247;
export const ExSel = 248;
export const EraseEof = 249;
export const Play = 250;
export const ZoomOut = 251;

File diff suppressed because one or more lines are too long

287
node_modules/@fluentui/keyboard-keys/lib/keys.js generated vendored Normal file
View File

@@ -0,0 +1,287 @@
export const Alt = 'Alt';
export const AltGraph = 'AltGraph';
export const CapsLock = 'CapsLock';
export const Control = 'Control';
export const Fn = 'Fn';
export const FnLock = 'FnLock';
export const Meta = 'Meta';
export const NumLock = 'NumLock';
export const ScrollLock = 'ScrollLock';
export const Shift = 'Shift';
export const Symbol = 'Symbol';
export const SymbolLock = 'SymbolLock';
export const Hyper = 'Hyper';
export const Super = 'Super';
export const Enter = 'Enter';
export const Space = ' ';
export const Tab = 'Tab';
export const ArrowDown = 'ArrowDown';
export const ArrowLeft = 'ArrowLeft';
export const ArrowRight = 'ArrowRight';
export const ArrowUp = 'ArrowUp';
export const End = 'End';
export const Home = 'Home';
export const PageDown = 'PageDown';
export const PageUp = 'PageUp';
export const Backspace = 'Backspace';
export const Clear = 'Clear';
export const Copy = 'Copy';
export const CrSel = 'CrSel';
export const Cut = 'Cut';
export const Delete = 'Delete';
export const EraseEof = 'EraseEof';
export const ExSel = 'ExSel';
export const Insert = 'Insert';
export const Paste = 'Paste';
export const Redo = 'Redo';
export const Undo = 'Undo';
export const Accept = 'Accept';
export const Again = 'Again';
export const Attn = 'Attn';
export const Cancel = 'Cancel';
export const ContextMenu = 'ContextMenu';
export const Escape = 'Escape';
export const Execute = 'Execute';
export const Find = 'Find';
export const Help = 'Help';
export const Pause = 'Pause';
export const Play = 'Play';
export const Props = 'Props';
export const Select = 'Select';
export const ZoomIn = 'ZoomIn';
export const ZoomOut = 'ZoomOut';
export const BrightnessDown = 'BrightnessDown';
export const BrightnessUp = 'BrightnessUp';
export const Eject = 'Eject';
export const LogOff = 'LogOff';
export const Power = 'Power';
export const PowerOff = 'PowerOff';
export const PrintScreen = 'PrintScreen';
export const Hibernate = 'Hibernate';
export const Standby = 'Standby';
export const WakeUp = 'WakeUp';
export const AllCandidates = 'AllCandidates';
export const Alphanumeric = 'Alphanumeric';
export const CodeInput = 'CodeInput';
export const Compose = 'Compose';
export const Convert = 'Convert';
export const Dead = 'Dead';
export const FinalMode = 'FinalMode';
export const GroupFirst = 'GroupFirst';
export const GroupLast = 'GroupLast';
export const GroupNext = 'GroupNext';
export const GroupPrevious = 'GroupPrevious';
export const ModeChange = 'ModeChange';
export const NextCandidate = 'NextCandidate';
export const NonConvert = 'NonConvert';
export const PreviousCandidate = 'PreviousCandidate';
export const Process = 'Process';
export const SingleCandidate = 'SingleCandidate';
export const HangulMode = 'HangulMode';
export const HanjaMode = 'HanjaMode';
export const JunjaMode = 'JunjaMode';
export const Eisu = 'Eisu';
export const Hankaku = 'Hankaku';
export const Hiragana = 'Hiragana';
export const HiraganaKatakana = 'HiraganaKatakana';
export const KanaMode = 'KanaMode';
export const KanjiMode = 'KanjiMode';
export const Katakana = 'Katakana';
export const Romaji = 'Romaji';
export const Zenkaku = 'Zenkaku';
export const ZenkakuHankaku = 'ZenkakuHankaku';
export const F1 = 'F1';
export const F2 = 'F2';
export const F3 = 'F3';
export const F4 = 'F4';
export const F5 = 'F5';
export const F6 = 'F6';
export const F7 = 'F7';
export const F8 = 'F8';
export const F9 = 'F9';
export const F10 = 'F10';
export const F11 = 'F11';
export const F12 = 'F12';
export const Soft1 = 'Soft1';
export const Soft2 = 'Soft2';
export const Soft3 = 'Soft3';
export const Soft4 = 'Soft4';
export const ChannelDown = 'ChannelDown';
export const ChannelUp = 'ChannelUp';
export const Close = 'Close';
export const MailForward = 'MailForward';
export const MailReply = 'MailReply';
export const MailSend = 'MailSend';
export const MediaClose = 'MediaClose';
export const MediaFastForward = 'MediaFastForward';
export const MediaPause = 'MediaPause';
export const MediaPlay = 'MediaPlay';
export const MediaPlayPause = 'MediaPlayPause';
export const MediaRecord = 'MediaRecord';
export const MediaRewind = 'MediaRewind';
export const MediaStop = 'MediaStop';
export const MediaTrackNext = 'MediaTrackNext';
export const MediaTrackPrevious = 'MediaTrackPrevious';
export const New = 'New';
export const Open = 'Open';
export const Print = 'Print';
export const Save = 'Save';
export const SpellCheck = 'SpellCheck';
export const Key11 = 'Key11';
export const Key12 = 'Key12';
export const AudioBalanceLeft = 'AudioBalanceLeft';
export const AudioBalanceRight = 'AudioBalanceRight';
export const AudioBassBoostDown = 'AudioBassBoostDown';
export const AudioBassBoostToggle = 'AudioBassBoostToggle';
export const AudioBassBoostUp = 'AudioBassBoostUp';
export const AudioFaderFront = 'AudioFaderFront';
export const AudioFaderRear = 'AudioFaderRear';
export const AudioSurroundModeNext = 'AudioSurroundModeNext';
export const AudioTrebleDown = 'AudioTrebleDown';
export const AudioTrebleUp = 'AudioTrebleUp';
export const AudioVolumeDown = 'AudioVolumeDown';
export const AudioVolumeUp = 'AudioVolumeUp';
export const AudioVolumeMute = 'AudioVolumeMute';
export const MicrophoneToggle = 'MicrophoneToggle';
export const MicrophoneVolumeDown = 'MicrophoneVolumeDown';
export const MicrophoneVolumeUp = 'MicrophoneVolumeUp';
export const MicrophoneVolumeMute = 'MicrophoneVolumeMute';
export const SpeechCorrectionList = 'SpeechCorrectionList';
export const SpeechInputToggle = 'SpeechInputToggle';
export const LaunchApplication1 = 'LaunchApplication1';
export const LaunchApplication2 = 'LaunchApplication2';
export const LaunchCalendar = 'LaunchCalendar';
export const LaunchContacts = 'LaunchContacts';
export const LaunchMail = 'LaunchMail';
export const LaunchMediaPlayer = 'LaunchMediaPlayer';
export const LaunchMusicPlayer = 'LaunchMusicPlayer';
export const LaunchPhone = 'LaunchPhone';
export const LaunchScreenSaver = 'LaunchScreenSaver';
export const LaunchSpreadsheet = 'LaunchSpreadsheet';
export const LaunchWebBrowser = 'LaunchWebBrowser';
export const LaunchWebCam = 'LaunchWebCam';
export const LaunchWordProcessor = 'LaunchWordProcessor';
export const BrowserBack = 'BrowserBack';
export const BrowserFavorites = 'BrowserFavorites';
export const BrowserForward = 'BrowserForward';
export const BrowserHome = 'BrowserHome';
export const BrowserRefresh = 'BrowserRefresh';
export const BrowserSearch = 'BrowserSearch';
export const BrowserStop = 'BrowserStop';
export const AppSwitch = 'AppSwitch';
export const Call = 'Call';
export const Camera = 'Camera';
export const CameraFocus = 'CameraFocus';
export const EndCall = 'EndCall';
export const GoBack = 'GoBack';
export const GoHome = 'GoHome';
export const HeadsetHook = 'HeadsetHook';
export const LastNumberRedial = 'LastNumberRedial';
export const Notification = 'Notification';
export const MannerMode = 'MannerMode';
export const VoiceDial = 'VoiceDial';
export const TV = 'TV';
export const TV3DMode = 'TV3DMode';
export const TVAntennaCable = 'TVAntennaCable';
export const TVAudioDescription = 'TVAudioDescription';
export const TVAudioDescriptionMixDown = 'TVAudioDescriptionMixDown';
export const TVAudioDescriptionMixUp = 'TVAudioDescriptionMixUp';
export const TVContentsMenu = 'TVContentsMenu';
export const TVDataService = 'TVDataService';
export const TVInput = 'TVInput';
export const TVInputComponent1 = 'TVInputComponent1';
export const TVInputComponent2 = 'TVInputComponent2';
export const TVInputComposite1 = 'TVInputComposite1';
export const TVInputComposite2 = 'TVInputComposite2';
export const TVInputHDMI1 = 'TVInputHDMI1';
export const TVInputHDMI2 = 'TVInputHDMI2';
export const TVInputHDMI3 = 'TVInputHDMI3';
export const TVInputHDMI4 = 'TVInputHDMI4';
export const TVInputVGA1 = 'TVInputVGA1';
export const TVMediaContext = 'TVMediaContext';
export const TVNetwork = 'TVNetwork';
export const TVNumberEntry = 'TVNumberEntry';
export const TVPower = 'TVPower';
export const TVRadioService = 'TVRadioService';
export const TVSatellite = 'TVSatellite';
export const TVSatelliteBS = 'TVSatelliteBS';
export const TVSatelliteCS = 'TVSatelliteCS';
export const TVSatelliteToggle = 'TVSatelliteToggle';
export const TVTerrestrialAnalog = 'TVTerrestrialAnalog';
export const TVTerrestrialDigital = 'TVTerrestrialDigital';
export const TVTimer = 'TVTimer';
export const AVRInput = 'AVRInput';
export const AVRPower = 'AVRPower';
export const ColorF0Red = 'ColorF0Red';
export const ColorF1Green = 'ColorF1Green';
export const ColorF2Yellow = 'ColorF2Yellow';
export const ColorF3Blue = 'ColorF3Blue';
export const ColorF4Grey = 'ColorF4Grey';
export const ColorF5Brown = 'ColorF5Brown';
export const ClosedCaptionToggle = 'ClosedCaptionToggle';
export const Dimmer = 'Dimmer';
export const DisplaySwap = 'DisplaySwap';
export const DVR = 'DVR';
export const Exit = 'Exit';
export const FavoriteClear0 = 'FavoriteClear0';
export const FavoriteClear1 = 'FavoriteClear1';
export const FavoriteClear2 = 'FavoriteClear2';
export const FavoriteClear3 = 'FavoriteClear3';
export const FavoriteRecall0 = 'FavoriteRecall0';
export const FavoriteRecall1 = 'FavoriteRecall1';
export const FavoriteRecall2 = 'FavoriteRecall2';
export const FavoriteRecall3 = 'FavoriteRecall3';
export const FavoriteStore0 = 'FavoriteStore0';
export const FavoriteStore1 = 'FavoriteStore1';
export const FavoriteStore2 = 'FavoriteStore2';
export const FavoriteStore3 = 'FavoriteStore3';
export const Guide = 'Guide';
export const GuideNextDay = 'GuideNextDay';
export const GuidePreviousDay = 'GuidePreviousDay';
export const Info = 'Info';
export const InstantReplay = 'InstantReplay';
export const Link = 'Link';
export const ListProgram = 'ListProgram';
export const LiveContent = 'LiveContent';
export const Lock = 'Lock';
export const MediaApps = 'MediaApps';
export const MediaAudioTrack = 'MediaAudioTrack';
export const MediaLast = 'MediaLast';
export const MediaSkipBackward = 'MediaSkipBackward';
export const MediaSkipForward = 'MediaSkipForward';
export const MediaStepBackward = 'MediaStepBackward';
export const MediaStepForward = 'MediaStepForward';
export const MediaTopMenu = 'MediaTopMenu';
export const NavigateIn = 'NavigateIn';
export const NavigateNext = 'NavigateNext';
export const NavigateOut = 'NavigateOut';
export const NavigatePrevious = 'NavigatePrevious';
export const NextFavoriteChannel = 'NextFavoriteChannel';
export const NextUserProfile = 'NextUserProfile';
export const OnDemand = 'OnDemand';
export const Pairing = 'Pairing';
export const PinPDown = 'PinPDown';
export const PinPMove = 'PinPMove';
export const PinPToggle = 'PinPToggle';
export const PinPUp = 'PinPUp';
export const PlaySpeedDown = 'PlaySpeedDown';
export const PlaySpeedReset = 'PlaySpeedReset';
export const PlaySpeedUp = 'PlaySpeedUp';
export const RandomToggle = 'RandomToggle';
export const RcLowBattery = 'RcLowBattery';
export const RecordSpeedNext = 'RecordSpeedNext';
export const RfBypass = 'RfBypass';
export const ScanChannelsToggle = 'ScanChannelsToggle';
export const ScreenModeNext = 'ScreenModeNext';
export const Settings = 'Settings';
export const SplitScreenToggle = 'SplitScreenToggle';
export const STBInput = 'STBInput';
export const STBPower = 'STBPower';
export const Subtitle = 'Subtitle';
export const Teletext = 'Teletext';
export const VideoModeNext = 'VideoModeNext';
export const Wink = 'Wink';
export const ZoomToggle = 'ZoomToggle';
export const MediaNextTrack = 'MediaNextTrack';
export const MediaPreviousTrack = 'MediaPreviousTrack';
export const Unidentified = 'Unidentified';

1
node_modules/@fluentui/keyboard-keys/lib/keys.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

42
node_modules/@fluentui/keyboard-keys/package.json generated vendored Normal file
View File

@@ -0,0 +1,42 @@
{
"name": "@fluentui/keyboard-keys",
"version": "9.0.8",
"description": "Contains a set of keyboard constants for key and keyCode",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/scripts-api-extractor": "*"
},
"dependencies": {
"@swc/helpers": "^0.5.1"
},
"beachball": {
"disallowedChangeTypes": [
"major",
"prerelease"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-commonjs"
]
}

277
node_modules/@fluentui/priority-overflow/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,277 @@
# Change Log - @fluentui/priority-overflow
This log was last generated on Thu, 12 Feb 2026 10:42:45 GMT and should not be manually modified.
<!-- Start content -->
## [9.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.3.0)
Thu, 12 Feb 2026 10:42:45 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.2.1..@fluentui/priority-overflow_v9.3.0)
### Minor changes
- feat: add support for pinned items ([PR #35712](https://github.com/microsoft/fluentui/pull/35712) by olfedias@microsoft.com)
## [9.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.2.1)
Fri, 31 Oct 2025 16:22:02 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.2.0..@fluentui/priority-overflow_v9.2.1)
### Patches
- fix: use numeric literals for Node constants to make SSR work ([PR #35357](https://github.com/microsoft/fluentui/pull/35357) by 198982749+Copilot@users.noreply.github.com)
## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.2.0)
Thu, 02 Oct 2025 15:12:11 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.16..@fluentui/priority-overflow_v9.2.0)
### Minor changes
- fix: overflowMenuSize is included in occupiedSize ([PR #35090](https://github.com/microsoft/fluentui/pull/35090) by vkozlova@microsoft.com)
## [9.1.16](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.16)
Mon, 08 Sep 2025 12:51:42 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.15..@fluentui/priority-overflow_v9.1.16)
### Patches
- chore: enforce explicit module boundary types ([PR #35080](https://github.com/microsoft/fluentui/pull/35080) by dmytrokirpa@microsoft.com)
## [9.1.15](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.15)
Fri, 21 Feb 2025 14:34:03 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.14..@fluentui/priority-overflow_v9.1.15)
### Patches
- fix: Add a defensive check when getting overflow item records ([PR #33876](https://github.com/microsoft/fluentui/pull/33876) by lingfangao@hotmail.com)
## [9.1.14](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.14)
Mon, 11 Nov 2024 10:01:03 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.13..@fluentui/priority-overflow_v9.1.14)
### 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)
## [9.1.13](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.13)
Thu, 06 Jun 2024 15:26:28 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.12..@fluentui/priority-overflow_v9.1.13)
### Patches
- chore: disable eslint rule ([PR #30967](https://github.com/microsoft/fluentui/pull/30967) by seanmonahan@microsoft.com)
## [9.1.12](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.12)
Thu, 16 May 2024 09:25:11 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.11..@fluentui/priority-overflow_v9.1.12)
### Patches
- force update the overflow when item is removed ([PR #31340](https://github.com/microsoft/fluentui/pull/31340) by miroslav.stastny@microsoft.com)
## [9.1.11](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.11)
Thu, 14 Dec 2023 09:58:42 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.10..@fluentui/priority-overflow_v9.1.11)
### Patches
- fix: updates should be synchronous in unit tests ([PR #30014](https://github.com/microsoft/fluentui/pull/30014) by lingfangao@hotmail.com)
## [9.1.10](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.10)
Mon, 20 Nov 2023 09:55:08 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.9..@fluentui/priority-overflow_v9.1.10)
### Patches
- fix: disconnect should dispose all state correctly ([PR #29375](https://github.com/microsoft/fluentui/pull/29375) by lingfan.gao@microsoft.com)
## [9.1.9](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.9)
Thu, 09 Nov 2023 17:29:49 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.8..@fluentui/priority-overflow_v9.1.9)
### Patches
- chore: use package.json#files setup instead of npmignore for all v9 libraries ([PR #29734](https://github.com/microsoft/fluentui/pull/29734) by martinhochel@microsoft.com)
## [9.1.8](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.8)
Mon, 23 Oct 2023 09:51:55 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.7..@fluentui/priority-overflow_v9.1.8)
### Patches
- fix: Use container window's resize observer ([PR #29551](https://github.com/microsoft/fluentui/pull/29551) by lingfangao@hotmail.com)
## [9.1.7](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.7)
Tue, 26 Sep 2023 17:49:01 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.6..@fluentui/priority-overflow_v9.1.7)
### Patches
- chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
## [9.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.6)
Tue, 26 Sep 2023 15:32:06 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.5..@fluentui/priority-overflow_v9.1.6)
### Patches
- fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.5)
Tue, 05 Sep 2023 13:29:14 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.4..@fluentui/priority-overflow_v9.1.5)
### Patches
- bumps @swc/helpers version to 0.5.1 ([PR #28989](https://github.com/microsoft/fluentui/pull/28989) by bernardo.sunderhus@gmail.com)
## [9.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.4)
Fri, 11 Aug 2023 12:14:24 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.3..@fluentui/priority-overflow_v9.1.4)
### Patches
- fix: flickering in Overflow ([PR #28767](https://github.com/microsoft/fluentui/pull/28767) by vkozlova@microsoft.com)
## [9.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.3)
Wed, 09 Aug 2023 13:16:48 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.2..@fluentui/priority-overflow_v9.1.3)
### Patches
- fix: inaccurate calculation of size ([PR #28728](https://github.com/microsoft/fluentui/pull/28728) by vkozlova@microsoft.com)
## [9.1.2](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.2)
Tue, 25 Jul 2023 13:29:15 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.1..@fluentui/priority-overflow_v9.1.2)
### Patches
- fix: Overflow update should run show/hide steps twice ([PR #28628](https://github.com/microsoft/fluentui/pull/28628) by lingfan.gao@microsoft.com)
## [9.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.1)
Mon, 26 Jun 2023 09:53:53 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.0..@fluentui/priority-overflow_v9.1.1)
### Patches
- fix: remove overflow menu if the last overflowed item can take its place ([PR #28285](https://github.com/microsoft/fluentui/pull/28285) by vkozlova@microsoft.com)
## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.1.0)
Tue, 20 Jun 2023 12:38:54 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.3..@fluentui/priority-overflow_v9.1.0)
### Minor changes
- feat: Added support for custom divider ([PR #28011](https://github.com/microsoft/fluentui/pull/28011) by vkozlova@microsoft.com)
## [9.0.3](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.3)
Fri, 12 May 2023 20:28:09 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.2..@fluentui/priority-overflow_v9.0.3)
### Patches
- fix: overflowManager should always dispatch initial state ([PR #27756](https://github.com/microsoft/fluentui/pull/27756) by lingfangao@hotmail.com)
- chore: exclude .swcrc from being published ([PR #27740](https://github.com/microsoft/fluentui/pull/27740) by olfedias@microsoft.com)
## [9.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.2)
Tue, 21 Mar 2023 21:23:19 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.1..@fluentui/priority-overflow_v9.0.2)
### Patches
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.1)
Tue, 07 Feb 2023 14:13:08 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.0..@fluentui/priority-overflow_v9.0.1)
### Patches
- fix: New overflow items all always dispatch updates to subscriber ([PR #26565](https://github.com/microsoft/fluentui/pull/26565) by lingfangao@hotmail.com)
## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.0)
Wed, 18 Jan 2023 16:32:53 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.0-rc.2..@fluentui/priority-overflow_v9.0.0)
### Patches
- Release as stable ([PR #26380](https://github.com/microsoft/fluentui/pull/26380) by lingfangao@hotmail.com)
## [9.0.0-rc.2](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.0-rc.2)
Mon, 09 Jan 2023 14:34:54 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.0-rc.1..@fluentui/priority-overflow_v9.0.0-rc.2)
### Changes
- fix: Minimum visible overflow items should be respected ([PR #26194](https://github.com/microsoft/fluentui/pull/26194) by lingfangao@hotmail.com)
## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.0-rc.1)
Thu, 17 Nov 2022 23:05:32 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.0-beta.4..@fluentui/priority-overflow_v9.0.0-rc.1)
### Changes
- feat: Bump to RC ([PR #25659](https://github.com/microsoft/fluentui/pull/25659) by lingfangao@hotmail.com)
## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.0-beta.4)
Fri, 11 Nov 2022 14:57:50 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.0-beta.3..@fluentui/priority-overflow_v9.0.0-beta.4)
### Changes
- fix: create valid export maps ([PR #25558](https://github.com/microsoft/fluentui/pull/25558) by martinhochel@microsoft.com)
## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.0-beta.3)
Thu, 13 Oct 2022 11:02:41 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.0-beta.2..@fluentui/priority-overflow_v9.0.0-beta.3)
### Changes
- feat: Adds API to register overflow menus for better available space calculation ([PR #25091](https://github.com/microsoft/fluentui/pull/25091) by lingfangao@hotmail.com)
- new overflow items should only be enqueued while observing ([PR #25122](https://github.com/microsoft/fluentui/pull/25122) by lingfangao@hotmail.com)
## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.0-beta.2)
Tue, 28 Jun 2022 15:14:10 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.0.0-beta.1..@fluentui/priority-overflow_v9.0.0-beta.2)
### Changes
- chore: Mark internal APIs with @internal ([PR #23689](https://github.com/microsoft/fluentui/pull/23689) by lingfangao@hotmail.com)
## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v9.0.0-beta.1)
Mon, 23 May 2022 12:13:58 GMT
### Changes
- feat: Initial beta release ([PR #22913](https://github.com/microsoft/fluentui/pull/22913) by lingfangao@hotmail.com)

15
node_modules/@fluentui/priority-overflow/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
@fluentui/priority-overflow
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

5
node_modules/@fluentui/priority-overflow/README.md generated vendored Normal file
View File

@@ -0,0 +1,5 @@
# @fluentui/priority-overflow
**Priority Overflow components for [Fluent UI React](https://react.fluentui.dev)**
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.

View File

@@ -0,0 +1,149 @@
/**
* @internal
* @returns overflow manager instance
*/
export declare function createOverflowManager(): OverflowManager;
export declare interface ObserveOptions {
/**
* Padding (in px) at the end of the container before overflow occurs
* Useful to account for extra elements (i.e. dropdown menu)
* or to account for any kinds of margins between items which are hard to measure with JS
* @default 10
*/
padding?: number;
/**
* Direction where items are removed when overflow occurs
* @default end
*/
overflowDirection?: OverflowDirection;
/**
* Horizontal or vertical overflow
* @default horizontal
*/
overflowAxis?: OverflowAxis;
/**
* The minimum number of visible items
*/
minimumVisible?: number;
/**
* Callback when item visibility is updated
*/
onUpdateItemVisibility: OnUpdateItemVisibility;
/**
* Callback when item visibility is updated
*/
onUpdateOverflow: OnUpdateOverflow;
/**
* When true, the overflow menu has default hidden items
* @default false
*/
hasHiddenItems?: boolean;
}
export declare type OnUpdateItemVisibility = (data: OnUpdateItemVisibilityPayload) => void;
export declare interface OnUpdateItemVisibilityPayload {
item: OverflowItemEntry;
visible: boolean;
}
/**
* signature similar to standard event listeners, but typed to handle the custom event
*/
export declare type OnUpdateOverflow = (data: OverflowEventPayload) => void;
export declare type OverflowAxis = 'horizontal' | 'vertical';
export declare type OverflowDirection = 'start' | 'end';
export declare interface OverflowDividerEntry {
/**
* HTML element that will disappear when overflowed
*/
element: HTMLElement;
groupId: string;
}
/**
* Payload of the custom DOM event for overflow updates
*/
export declare interface OverflowEventPayload {
visibleItems: OverflowItemEntry[];
invisibleItems: OverflowItemEntry[];
groupVisibility: Record<string, OverflowGroupState>;
}
export declare type OverflowGroupState = 'visible' | 'hidden' | 'overflow';
export declare interface OverflowItemEntry {
/**
* HTML element that will be disappear when overflowed
*/
element: HTMLElement;
/**
* Lower priority items are invisible first when the container is overflowed
* @default 0
*/
priority: number;
/**
* Specific id, used to track visibility and provide updates to consumers
*/
id: string;
groupId?: string;
/**
* If true, the item will never overflow and will always be visible.
* Pinned items are excluded from the overflow count.
* @default false
*/
pinned?: boolean;
}
/**
* @internal
*/
export declare interface OverflowManager {
/**
* Starts observing the container and managing the overflow state
*/
observe: (container: HTMLElement, options: ObserveOptions) => void;
/**
* Stops observing the container
*/
disconnect: () => void;
/**
* Add overflow items
*/
addItem: (items: OverflowItemEntry) => void;
/**
* Remove overflow item
*/
removeItem: (itemId: string) => void;
/**
* Manually update the overflow, updates are batched and async
*/
update: () => void;
/**
* Manually update the overflow sync
*/
forceUpdate: () => void;
/**
* Adds an element that opens an overflow menu. This is used to calculate
* available space and check if additional items need to overflow
*/
addOverflowMenu: (element: HTMLElement) => void;
/**
* Add overflow divider
*/
addDivider: (divider: OverflowDividerEntry) => void;
/**
* Remove overflow divider
*/
removeDivider: (groupId: string) => void;
/**
* Unsets the overflow menu element
*/
removeOverflowMenu: () => void;
}
export { }

View File

@@ -0,0 +1,20 @@
"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, {
DATA_OVERFLOWING: function() {
return DATA_OVERFLOWING;
},
DATA_OVERFLOW_GROUP: function() {
return DATA_OVERFLOW_GROUP;
}
});
const DATA_OVERFLOWING = 'data-overflowing';
const DATA_OVERFLOW_GROUP = 'data-overflow-group';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/consts.ts"],"sourcesContent":["export const DATA_OVERFLOWING = 'data-overflowing';\nexport const DATA_OVERFLOW_GROUP = 'data-overflow-group';\n"],"names":["DATA_OVERFLOWING","DATA_OVERFLOW_GROUP"],"mappings":";;;;;;;;;;;IAAaA,gBAAgB;eAAhBA;;IACAC,mBAAmB;eAAnBA;;;AADN,MAAMD,mBAAmB;AACzB,MAAMC,sBAAsB"}

View File

@@ -0,0 +1,32 @@
/**
* Helper function that creates a resize observer in the element's own window global
* @param elementToObserve - Uses the element's window global to create the resize observer
* @param callback
* @returns function to cleanup the resize observer
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "observeResize", {
enumerable: true,
get: function() {
return observeResize;
}
});
function observeResize(elementToObserve, callback) {
var _elementToObserve_ownerDocument_defaultView;
const GlobalResizeObserver = (_elementToObserve_ownerDocument_defaultView = elementToObserve.ownerDocument.defaultView) === null || _elementToObserve_ownerDocument_defaultView === void 0 ? void 0 : _elementToObserve_ownerDocument_defaultView.ResizeObserver;
if (!GlobalResizeObserver) {
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-console
console.error('@fluentui/priority-overflow', 'ResizeObserver does not exist on container window');
}
return ()=>null;
}
let resizeObserver = new GlobalResizeObserver(callback);
resizeObserver.observe(elementToObserve);
return ()=>{
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
resizeObserver = undefined;
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/createResizeObserver.ts"],"sourcesContent":["/**\n * Helper function that creates a resize observer in the element's own window global\n * @param elementToObserve - Uses the element's window global to create the resize observer\n * @param callback\n * @returns function to cleanup the resize observer\n */\nexport function observeResize(elementToObserve: HTMLElement, callback: ResizeObserverCallback): () => void {\n const GlobalResizeObserver = elementToObserve.ownerDocument.defaultView?.ResizeObserver;\n\n if (!GlobalResizeObserver) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('@fluentui/priority-overflow', 'ResizeObserver does not exist on container window');\n }\n return () => null;\n }\n\n let resizeObserver: InstanceType<typeof GlobalResizeObserver> | undefined = new GlobalResizeObserver(callback);\n resizeObserver.observe(elementToObserve);\n\n return () => {\n resizeObserver?.disconnect();\n resizeObserver = undefined;\n };\n}\n"],"names":["observeResize","elementToObserve","callback","GlobalResizeObserver","ownerDocument","defaultView","ResizeObserver","process","env","NODE_ENV","console","error","resizeObserver","observe","disconnect","undefined"],"mappings":"AAAA;;;;;CAKC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,cAAcC,gBAA6B,EAAEC,QAAgC;QAC9DD;IAA7B,MAAME,wBAAuBF,8CAAAA,iBAAiBG,aAAa,CAACC,WAAW,cAA1CJ,kEAAAA,4CAA4CK,cAAc;IAEvF,IAAI,CAACH,sBAAsB;QACzB,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,sCAAsC;YACtCC,QAAQC,KAAK,CAAC,+BAA+B;QAC/C;QACA,OAAO,IAAM;IACf;IAEA,IAAIC,iBAAwE,IAAIT,qBAAqBD;IACrGU,eAAeC,OAAO,CAACZ;IAEvB,OAAO;QACLW,2BAAAA,qCAAAA,eAAgBE,UAAU;QAC1BF,iBAAiBG;IACnB;AACF"}

View File

@@ -0,0 +1,34 @@
/**
* Microtask debouncer
* https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
* @param fn - Function to debounce
* @returns debounced function
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "debounce", {
enumerable: true,
get: function() {
return debounce;
}
});
function debounce(fn) {
let pending;
// React testing platforms will often output errors when state updates happen outside `act`
// Since there is nothing obvious to wait for we just avoid debouncing in unit test environments
if (process.env.NODE_ENV === 'test') {
return fn;
}
return ()=>{
if (!pending) {
pending = true;
queueMicrotask(()=>{
// Need to set pending to `false` before the debounced function is run.
// React can actually interrupt the function while it's running!
pending = false;
fn();
});
}
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/debounce.ts"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */\nexport function debounce(fn: Function): () => void {\n let pending: boolean;\n\n // React testing platforms will often output errors when state updates happen outside `act`\n // Since there is nothing obvious to wait for we just avoid debouncing in unit test environments\n if (process.env.NODE_ENV === 'test') {\n return fn as () => void;\n }\n\n return () => {\n if (!pending) {\n pending = true;\n queueMicrotask(() => {\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"names":["debounce","fn","pending","process","env","NODE_ENV","queueMicrotask"],"mappings":"AAAA;;;;;CAKC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,SAASC,EAAY;IACnC,IAAIC;IAEJ,2FAA2F;IAC3F,gGAAgG;IAChG,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACnC,OAAOJ;IACT;IAEA,OAAO;QACL,IAAI,CAACC,SAAS;YACZA,UAAU;YACVI,eAAe;gBACb,uEAAuE;gBACvE,gEAAgE;gBAChEJ,UAAU;gBACVD;YACF;QACF;IACF;AACF"}

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createOverflowManager", {
enumerable: true,
get: function() {
return _overflowManager.createOverflowManager;
}
});
const _overflowManager = require("./overflowManager");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { createOverflowManager } from './overflowManager';\nexport type {\n ObserveOptions,\n OnUpdateItemVisibility,\n OnUpdateItemVisibilityPayload,\n OnUpdateOverflow,\n OverflowAxis,\n OverflowDirection,\n OverflowEventPayload,\n OverflowGroupState,\n OverflowItemEntry,\n OverflowDividerEntry,\n OverflowManager,\n} from './types';\n"],"names":["createOverflowManager"],"mappings":";;;;+BAASA;;;eAAAA,sCAAqB;;;iCAAQ"}

View File

@@ -0,0 +1,309 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createOverflowManager", {
enumerable: true,
get: function() {
return createOverflowManager;
}
});
const _consts = require("./consts");
const _createResizeObserver = require("./createResizeObserver");
const _debounce = require("./debounce");
const _priorityQueue = require("./priorityQueue");
function createOverflowManager() {
// calls to `offsetWidth or offsetHeight` can happen multiple times in an update
// Use a cache to avoid causing too many recalcs and avoid scripting time to meausure sizes
const sizeCache = new Map();
let container;
let overflowMenu;
// Set as true when resize observer is observing
let observing = false;
// If true, next update will dispatch to onUpdateOverflow even if queue top states don't change
// Initially true to force dispatch on first mount
let forceDispatch = true;
const options = {
padding: 10,
overflowAxis: 'horizontal',
overflowDirection: 'end',
minimumVisible: 0,
onUpdateItemVisibility: ()=>undefined,
onUpdateOverflow: ()=>undefined,
hasHiddenItems: false
};
const overflowItems = {};
const overflowDividers = {};
let disposeResizeObserver = ()=>null;
const getNextItem = (queueToDequeue, queueToEnqueue)=>{
const nextItem = queueToDequeue.dequeue();
queueToEnqueue.enqueue(nextItem);
return overflowItems[nextItem];
};
const groupManager = createGroupManager();
function compareItems(lt, rt) {
if (!lt || !rt) {
return 0;
}
const lte = overflowItems[lt];
const rte = overflowItems[rt];
// TODO this should not happen but there have been reports of one of these items being undefined
// Try to find a consistent repro for this
if (!lte || !rte) {
return lte ? 1 : -1;
}
// Pinned items have "infinite" priority - they should never be hidden
if (lte.pinned !== rte.pinned) {
return lte.pinned ? 1 : -1;
}
if (lte.priority !== rte.priority) {
return lte.priority > rte.priority ? 1 : -1;
}
// Node.DOCUMENT_POSITION_FOLLOWING = 4, Node.DOCUMENT_POSITION_PRECEDING = 2
const positionStatusBit = options.overflowDirection === 'end' ? 4 : 2;
// eslint-disable-next-line no-bitwise
return lte.element.compareDocumentPosition(rte.element) & positionStatusBit ? 1 : -1;
}
function getElementAxisSize(horizontal, vertical, el) {
if (!sizeCache.has(el)) {
sizeCache.set(el, options.overflowAxis === 'horizontal' ? el[horizontal] : el[vertical]);
}
return sizeCache.get(el);
}
const getOffsetSize = getElementAxisSize.bind(null, 'offsetWidth', 'offsetHeight');
const getClientSize = getElementAxisSize.bind(null, 'clientWidth', 'clientHeight');
const invisibleItemQueue = (0, _priorityQueue.createPriorityQueue)((a, b)=>-1 * compareItems(a, b));
const visibleItemQueue = (0, _priorityQueue.createPriorityQueue)(compareItems);
function occupiedSize() {
const totalItemSize = visibleItemQueue.all().map((id)=>overflowItems[id].element).map(getOffsetSize).reduce((prev, current)=>prev + current, 0);
const totalDividerSize = Object.entries(groupManager.groupVisibility()).reduce((acc, [id, state])=>acc + (state !== 'hidden' && overflowDividers[id] ? getOffsetSize(overflowDividers[id].element) : 0), 0);
const overflowMenuSize = (invisibleItemQueue.size() > 0 || options.hasHiddenItems) && overflowMenu ? getOffsetSize(overflowMenu) : 0;
return totalItemSize + totalDividerSize + overflowMenuSize;
}
const showItem = ()=>{
const item = getNextItem(invisibleItemQueue, visibleItemQueue);
options.onUpdateItemVisibility({
item,
visible: true
});
if (item.groupId) {
groupManager.showItem(item.id, item.groupId);
if (groupManager.isSingleItemVisible(item.id, item.groupId)) {
var _overflowDividers_item_groupId;
(_overflowDividers_item_groupId = overflowDividers[item.groupId]) === null || _overflowDividers_item_groupId === void 0 ? void 0 : _overflowDividers_item_groupId.element.removeAttribute(_consts.DATA_OVERFLOWING);
}
}
};
const hideItem = ()=>{
const item = getNextItem(visibleItemQueue, invisibleItemQueue);
options.onUpdateItemVisibility({
item,
visible: false
});
if (item.groupId) {
if (groupManager.isSingleItemVisible(item.id, item.groupId)) {
var _overflowDividers_item_groupId;
(_overflowDividers_item_groupId = overflowDividers[item.groupId]) === null || _overflowDividers_item_groupId === void 0 ? void 0 : _overflowDividers_item_groupId.element.setAttribute(_consts.DATA_OVERFLOWING, '');
}
groupManager.hideItem(item.id, item.groupId);
}
};
const dispatchOverflowUpdate = ()=>{
const visibleItemIds = visibleItemQueue.all();
const invisibleItemIds = invisibleItemQueue.all();
const visibleItems = visibleItemIds.map((itemId)=>overflowItems[itemId]);
const invisibleItems = invisibleItemIds.map((itemId)=>overflowItems[itemId]);
options.onUpdateOverflow({
visibleItems,
invisibleItems,
groupVisibility: groupManager.groupVisibility()
});
};
const processOverflowItems = ()=>{
if (!container) {
return false;
}
sizeCache.clear();
const availableSize = getClientSize(container) - options.padding;
// Snapshot of the visible/invisible state to compare for updates
const visibleTop = visibleItemQueue.peek();
const invisibleTop = invisibleItemQueue.peek();
while(compareItems(invisibleItemQueue.peek(), visibleItemQueue.peek()) > 0){
hideItem(); // hide elements whose priority become smaller than the highest priority of the hidden one
}
// Run the show/hide step twice - the first step might not be correct if
// it was triggered by a new item being added - new items are always visible by default.
for(let i = 0; i < 2; i++){
// Add items until available width is filled - can result in overflow
while(occupiedSize() < availableSize && invisibleItemQueue.size() > 0 || invisibleItemQueue.size() === 1 // attempt to show the last invisible item hoping it's size does not exceed overflow menu size
){
showItem();
}
// Remove items until there's no more overflow
while(occupiedSize() > availableSize && visibleItemQueue.size() > options.minimumVisible){
var _overflowItems_nextItemId;
const nextItemId = visibleItemQueue.peek();
// Never hide pinned items - they should always remain visible
if (nextItemId && ((_overflowItems_nextItemId = overflowItems[nextItemId]) === null || _overflowItems_nextItemId === void 0 ? void 0 : _overflowItems_nextItemId.pinned)) {
break;
}
hideItem();
}
}
// only update when the state of visible/invisible items has changed
return visibleItemQueue.peek() !== visibleTop || invisibleItemQueue.peek() !== invisibleTop;
};
const forceUpdate = ()=>{
if (processOverflowItems() || forceDispatch) {
forceDispatch = false;
dispatchOverflowUpdate();
}
};
const update = (0, _debounce.debounce)(forceUpdate);
const observe = (observedContainer, userOptions)=>{
Object.assign(options, userOptions);
observing = true;
Object.values(overflowItems).forEach((item)=>visibleItemQueue.enqueue(item.id));
container = observedContainer;
disposeResizeObserver = (0, _createResizeObserver.observeResize)(container, (entries)=>{
if (!entries[0] || !container) {
return;
}
update();
});
};
const addItem = (item)=>{
if (overflowItems[item.id]) {
return;
}
overflowItems[item.id] = item;
// some options can affect priority which are only set on `observe`
if (observing) {
// Updates to elements might not change the queue tops
// i.e. new element is enqueued but the top of the queue stays the same
// force a dispatch on the next batched update
forceDispatch = true;
visibleItemQueue.enqueue(item.id);
}
if (item.groupId) {
groupManager.addItem(item.id, item.groupId);
item.element.setAttribute(_consts.DATA_OVERFLOW_GROUP, item.groupId);
}
update();
};
const addOverflowMenu = (el)=>{
overflowMenu = el;
};
const addDivider = (divider)=>{
if (!divider.groupId || overflowDividers[divider.groupId]) {
return;
}
divider.element.setAttribute(_consts.DATA_OVERFLOW_GROUP, divider.groupId);
overflowDividers[divider.groupId] = divider;
};
const removeOverflowMenu = ()=>{
overflowMenu = undefined;
};
const removeDivider = (groupId)=>{
if (!overflowDividers[groupId]) {
return;
}
const divider = overflowDividers[groupId];
if (divider.groupId) {
delete overflowDividers[groupId];
divider.element.removeAttribute(_consts.DATA_OVERFLOW_GROUP);
}
};
const removeItem = (itemId)=>{
if (!overflowItems[itemId]) {
return;
}
if (observing) {
// We might be removing an item in an overflow which would not affect the tops,
// but we need to update anyway to update the overflow menu state
forceDispatch = true;
}
const item = overflowItems[itemId];
visibleItemQueue.remove(itemId);
invisibleItemQueue.remove(itemId);
if (item.groupId) {
groupManager.removeItem(item.id, item.groupId);
item.element.removeAttribute(_consts.DATA_OVERFLOW_GROUP);
}
sizeCache.delete(item.element);
delete overflowItems[itemId];
update();
};
const disconnect = ()=>{
disposeResizeObserver();
// reset flags
container = undefined;
observing = false;
forceDispatch = true;
// clear all entries
Object.keys(overflowItems).forEach((itemId)=>removeItem(itemId));
Object.keys(overflowDividers).forEach((dividerId)=>removeDivider(dividerId));
removeOverflowMenu();
sizeCache.clear();
};
return {
addItem,
disconnect,
forceUpdate,
observe,
removeItem,
update,
addOverflowMenu,
removeOverflowMenu,
addDivider,
removeDivider
};
}
const createGroupManager = ()=>{
const groupVisibility = {};
const groups = {};
function updateGroupVisibility(groupId) {
const group = groups[groupId];
if (group.invisibleItemIds.size && group.visibleItemIds.size) {
groupVisibility[groupId] = 'overflow';
} else if (group.visibleItemIds.size === 0) {
groupVisibility[groupId] = 'hidden';
} else {
groupVisibility[groupId] = 'visible';
}
}
function isGroupVisible(groupId) {
return groupVisibility[groupId] === 'visible' || groupVisibility[groupId] === 'overflow';
}
return {
groupVisibility: ()=>groupVisibility,
isSingleItemVisible (itemId, groupId) {
return isGroupVisible(groupId) && groups[groupId].visibleItemIds.has(itemId) && groups[groupId].visibleItemIds.size === 1;
},
addItem (itemId, groupId) {
var _groups, _groupId;
var _;
(_ = (_groups = groups)[_groupId = groupId]) !== null && _ !== void 0 ? _ : _groups[_groupId] = {
visibleItemIds: new Set(),
invisibleItemIds: new Set()
};
groups[groupId].visibleItemIds.add(itemId);
updateGroupVisibility(groupId);
},
removeItem (itemId, groupId) {
groups[groupId].invisibleItemIds.delete(itemId);
groups[groupId].visibleItemIds.delete(itemId);
updateGroupVisibility(groupId);
},
showItem (itemId, groupId) {
groups[groupId].invisibleItemIds.delete(itemId);
groups[groupId].visibleItemIds.add(itemId);
updateGroupVisibility(groupId);
},
hideItem (itemId, groupId) {
groups[groupId].invisibleItemIds.add(itemId);
groups[groupId].visibleItemIds.delete(itemId);
updateGroupVisibility(groupId);
}
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,96 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createPriorityQueue", {
enumerable: true,
get: function() {
return createPriorityQueue;
}
});
function createPriorityQueue(compare) {
const arr = [];
let size = 0;
const left = (i)=>{
return 2 * i + 1;
};
const right = (i)=>{
return 2 * i + 2;
};
const parent = (i)=>{
return Math.floor((i - 1) / 2);
};
const swap = (a, b)=>{
const tmp = arr[a];
arr[a] = arr[b];
arr[b] = tmp;
};
const heapify = (i)=>{
let smallest = i;
const l = left(i);
const r = right(i);
if (l < size && compare(arr[l], arr[smallest]) < 0) {
smallest = l;
}
if (r < size && compare(arr[r], arr[smallest]) < 0) {
smallest = r;
}
if (smallest !== i) {
swap(smallest, i);
heapify(smallest);
}
};
const dequeue = ()=>{
if (size === 0) {
throw new Error('Priority queue empty');
}
const res = arr[0];
arr[0] = arr[--size];
heapify(0);
return res;
};
const peek = ()=>{
if (size === 0) {
return null;
}
return arr[0];
};
const enqueue = (item)=>{
arr[size++] = item;
let i = size - 1;
let p = parent(i);
while(i > 0 && compare(arr[p], arr[i]) > 0){
swap(p, i);
i = p;
p = parent(i);
}
};
const contains = (item)=>{
const index = arr.indexOf(item);
return index >= 0 && index < size;
};
const remove = (item)=>{
const i = arr.indexOf(item);
if (i === -1 || i >= size) {
return;
}
arr[i] = arr[--size];
heapify(i);
};
const clear = ()=>{
size = 0;
};
const all = ()=>{
return arr.slice(0, size);
};
return {
all,
clear,
contains,
dequeue,
enqueue,
peek,
remove,
size: ()=>size
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/priorityQueue.ts"],"sourcesContent":["export type PriorityQueueCompareFn<T> = (a: T, b: T) => number;\n\nexport interface PriorityQueue<T> {\n all: () => T[];\n clear: () => void;\n contains: (item: T) => boolean;\n dequeue: () => T;\n enqueue: (item: T) => void;\n peek: () => T | null;\n remove: (item: T) => void;\n size: () => number;\n}\n\n/**\n * @param compare - comparison function for items\n * @returns Priority queue implemented with a min heap\n */\nexport function createPriorityQueue<T>(compare: PriorityQueueCompareFn<T>): PriorityQueue<T> {\n const arr: T[] = [];\n let size = 0;\n\n const left = (i: number) => {\n return 2 * i + 1;\n };\n\n const right = (i: number) => {\n return 2 * i + 2;\n };\n\n const parent = (i: number) => {\n return Math.floor((i - 1) / 2);\n };\n\n const swap = (a: number, b: number) => {\n const tmp = arr[a];\n arr[a] = arr[b];\n arr[b] = tmp;\n };\n\n const heapify = (i: number) => {\n let smallest = i;\n const l = left(i);\n const r = right(i);\n\n if (l < size && compare(arr[l], arr[smallest]) < 0) {\n smallest = l;\n }\n\n if (r < size && compare(arr[r], arr[smallest]) < 0) {\n smallest = r;\n }\n\n if (smallest !== i) {\n swap(smallest, i);\n heapify(smallest);\n }\n };\n\n const dequeue = () => {\n if (size === 0) {\n throw new Error('Priority queue empty');\n }\n\n const res = arr[0];\n arr[0] = arr[--size];\n heapify(0);\n\n return res;\n };\n\n const peek = () => {\n if (size === 0) {\n return null;\n }\n\n return arr[0];\n };\n\n const enqueue = (item: T) => {\n arr[size++] = item;\n let i = size - 1;\n let p = parent(i);\n while (i > 0 && compare(arr[p], arr[i]) > 0) {\n swap(p, i);\n i = p;\n p = parent(i);\n }\n };\n\n const contains = (item: T) => {\n const index = arr.indexOf(item);\n return index >= 0 && index < size;\n };\n\n const remove = (item: T) => {\n const i = arr.indexOf(item);\n\n if (i === -1 || i >= size) {\n return;\n }\n\n arr[i] = arr[--size];\n heapify(i);\n };\n\n const clear = () => {\n size = 0;\n };\n\n const all = () => {\n return arr.slice(0, size);\n };\n\n return {\n all,\n clear,\n contains,\n dequeue,\n enqueue,\n peek,\n remove,\n size: () => size,\n };\n}\n"],"names":["createPriorityQueue","compare","arr","size","left","i","right","parent","Math","floor","swap","a","b","tmp","heapify","smallest","l","r","dequeue","Error","res","peek","enqueue","item","p","contains","index","indexOf","remove","clear","all","slice"],"mappings":";;;;+BAiBgBA;;;eAAAA;;;AAAT,SAASA,oBAAuBC,OAAkC;IACvE,MAAMC,MAAW,EAAE;IACnB,IAAIC,OAAO;IAEX,MAAMC,OAAO,CAACC;QACZ,OAAO,IAAIA,IAAI;IACjB;IAEA,MAAMC,QAAQ,CAACD;QACb,OAAO,IAAIA,IAAI;IACjB;IAEA,MAAME,SAAS,CAACF;QACd,OAAOG,KAAKC,KAAK,CAAC,AAACJ,CAAAA,IAAI,CAAA,IAAK;IAC9B;IAEA,MAAMK,OAAO,CAACC,GAAWC;QACvB,MAAMC,MAAMX,GAAG,CAACS,EAAE;QAClBT,GAAG,CAACS,EAAE,GAAGT,GAAG,CAACU,EAAE;QACfV,GAAG,CAACU,EAAE,GAAGC;IACX;IAEA,MAAMC,UAAU,CAACT;QACf,IAAIU,WAAWV;QACf,MAAMW,IAAIZ,KAAKC;QACf,MAAMY,IAAIX,MAAMD;QAEhB,IAAIW,IAAIb,QAAQF,QAAQC,GAAG,CAACc,EAAE,EAAEd,GAAG,CAACa,SAAS,IAAI,GAAG;YAClDA,WAAWC;QACb;QAEA,IAAIC,IAAId,QAAQF,QAAQC,GAAG,CAACe,EAAE,EAAEf,GAAG,CAACa,SAAS,IAAI,GAAG;YAClDA,WAAWE;QACb;QAEA,IAAIF,aAAaV,GAAG;YAClBK,KAAKK,UAAUV;YACfS,QAAQC;QACV;IACF;IAEA,MAAMG,UAAU;QACd,IAAIf,SAAS,GAAG;YACd,MAAM,IAAIgB,MAAM;QAClB;QAEA,MAAMC,MAAMlB,GAAG,CAAC,EAAE;QAClBA,GAAG,CAAC,EAAE,GAAGA,GAAG,CAAC,EAAEC,KAAK;QACpBW,QAAQ;QAER,OAAOM;IACT;IAEA,MAAMC,OAAO;QACX,IAAIlB,SAAS,GAAG;YACd,OAAO;QACT;QAEA,OAAOD,GAAG,CAAC,EAAE;IACf;IAEA,MAAMoB,UAAU,CAACC;QACfrB,GAAG,CAACC,OAAO,GAAGoB;QACd,IAAIlB,IAAIF,OAAO;QACf,IAAIqB,IAAIjB,OAAOF;QACf,MAAOA,IAAI,KAAKJ,QAAQC,GAAG,CAACsB,EAAE,EAAEtB,GAAG,CAACG,EAAE,IAAI,EAAG;YAC3CK,KAAKc,GAAGnB;YACRA,IAAImB;YACJA,IAAIjB,OAAOF;QACb;IACF;IAEA,MAAMoB,WAAW,CAACF;QAChB,MAAMG,QAAQxB,IAAIyB,OAAO,CAACJ;QAC1B,OAAOG,SAAS,KAAKA,QAAQvB;IAC/B;IAEA,MAAMyB,SAAS,CAACL;QACd,MAAMlB,IAAIH,IAAIyB,OAAO,CAACJ;QAEtB,IAAIlB,MAAM,CAAC,KAAKA,KAAKF,MAAM;YACzB;QACF;QAEAD,GAAG,CAACG,EAAE,GAAGH,GAAG,CAAC,EAAEC,KAAK;QACpBW,QAAQT;IACV;IAEA,MAAMwB,QAAQ;QACZ1B,OAAO;IACT;IAEA,MAAM2B,MAAM;QACV,OAAO5B,IAAI6B,KAAK,CAAC,GAAG5B;IACtB;IAEA,OAAO;QACL2B;QACAD;QACAJ;QACAP;QACAI;QACAD;QACAO;QACAzB,MAAM,IAAMA;IACd;AACF"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
export const DATA_OVERFLOWING = 'data-overflowing';
export const DATA_OVERFLOW_GROUP = 'data-overflow-group';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/consts.ts"],"sourcesContent":["export const DATA_OVERFLOWING = 'data-overflowing';\nexport const DATA_OVERFLOW_GROUP = 'data-overflow-group';\n"],"names":["DATA_OVERFLOWING","DATA_OVERFLOW_GROUP"],"mappings":"AAAA,OAAO,MAAMA,mBAAmB,mBAAmB;AACnD,OAAO,MAAMC,sBAAsB,sBAAsB"}

View File

@@ -0,0 +1,22 @@
/**
* Helper function that creates a resize observer in the element's own window global
* @param elementToObserve - Uses the element's window global to create the resize observer
* @param callback
* @returns function to cleanup the resize observer
*/ export function observeResize(elementToObserve, callback) {
var _elementToObserve_ownerDocument_defaultView;
const GlobalResizeObserver = (_elementToObserve_ownerDocument_defaultView = elementToObserve.ownerDocument.defaultView) === null || _elementToObserve_ownerDocument_defaultView === void 0 ? void 0 : _elementToObserve_ownerDocument_defaultView.ResizeObserver;
if (!GlobalResizeObserver) {
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-console
console.error('@fluentui/priority-overflow', 'ResizeObserver does not exist on container window');
}
return ()=>null;
}
let resizeObserver = new GlobalResizeObserver(callback);
resizeObserver.observe(elementToObserve);
return ()=>{
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
resizeObserver = undefined;
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/createResizeObserver.ts"],"sourcesContent":["/**\n * Helper function that creates a resize observer in the element's own window global\n * @param elementToObserve - Uses the element's window global to create the resize observer\n * @param callback\n * @returns function to cleanup the resize observer\n */\nexport function observeResize(elementToObserve: HTMLElement, callback: ResizeObserverCallback): () => void {\n const GlobalResizeObserver = elementToObserve.ownerDocument.defaultView?.ResizeObserver;\n\n if (!GlobalResizeObserver) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('@fluentui/priority-overflow', 'ResizeObserver does not exist on container window');\n }\n return () => null;\n }\n\n let resizeObserver: InstanceType<typeof GlobalResizeObserver> | undefined = new GlobalResizeObserver(callback);\n resizeObserver.observe(elementToObserve);\n\n return () => {\n resizeObserver?.disconnect();\n resizeObserver = undefined;\n };\n}\n"],"names":["observeResize","elementToObserve","callback","GlobalResizeObserver","ownerDocument","defaultView","ResizeObserver","process","env","NODE_ENV","console","error","resizeObserver","observe","disconnect","undefined"],"mappings":"AAAA;;;;;CAKC,GACD,OAAO,SAASA,cAAcC,gBAA6B,EAAEC,QAAgC;QAC9DD;IAA7B,MAAME,wBAAuBF,8CAAAA,iBAAiBG,aAAa,CAACC,WAAW,cAA1CJ,kEAAAA,4CAA4CK,cAAc;IAEvF,IAAI,CAACH,sBAAsB;QACzB,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,sCAAsC;YACtCC,QAAQC,KAAK,CAAC,+BAA+B;QAC/C;QACA,OAAO,IAAM;IACf;IAEA,IAAIC,iBAAwE,IAAIT,qBAAqBD;IACrGU,eAAeC,OAAO,CAACZ;IAEvB,OAAO;QACLW,2BAAAA,qCAAAA,eAAgBE,UAAU;QAC1BF,iBAAiBG;IACnB;AACF"}

View File

@@ -0,0 +1,24 @@
/**
* Microtask debouncer
* https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
* @param fn - Function to debounce
* @returns debounced function
*/ export function debounce(fn) {
let pending;
// React testing platforms will often output errors when state updates happen outside `act`
// Since there is nothing obvious to wait for we just avoid debouncing in unit test environments
if (process.env.NODE_ENV === 'test') {
return fn;
}
return ()=>{
if (!pending) {
pending = true;
queueMicrotask(()=>{
// Need to set pending to `false` before the debounced function is run.
// React can actually interrupt the function while it's running!
pending = false;
fn();
});
}
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/debounce.ts"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */\nexport function debounce(fn: Function): () => void {\n let pending: boolean;\n\n // React testing platforms will often output errors when state updates happen outside `act`\n // Since there is nothing obvious to wait for we just avoid debouncing in unit test environments\n if (process.env.NODE_ENV === 'test') {\n return fn as () => void;\n }\n\n return () => {\n if (!pending) {\n pending = true;\n queueMicrotask(() => {\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"names":["debounce","fn","pending","process","env","NODE_ENV","queueMicrotask"],"mappings":"AAAA;;;;;CAKC,GACD,OAAO,SAASA,SAASC,EAAY;IACnC,IAAIC;IAEJ,2FAA2F;IAC3F,gGAAgG;IAChG,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACnC,OAAOJ;IACT;IAEA,OAAO;QACL,IAAI,CAACC,SAAS;YACZA,UAAU;YACVI,eAAe;gBACb,uEAAuE;gBACvE,gEAAgE;gBAChEJ,UAAU;gBACVD;YACF;QACF;IACF;AACF"}

View File

@@ -0,0 +1 @@
export { createOverflowManager } from './overflowManager';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { createOverflowManager } from './overflowManager';\nexport type {\n ObserveOptions,\n OnUpdateItemVisibility,\n OnUpdateItemVisibilityPayload,\n OnUpdateOverflow,\n OverflowAxis,\n OverflowDirection,\n OverflowEventPayload,\n OverflowGroupState,\n OverflowItemEntry,\n OverflowDividerEntry,\n OverflowManager,\n} from './types';\n"],"names":["createOverflowManager"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oBAAoB"}

View File

@@ -0,0 +1,302 @@
import { DATA_OVERFLOWING, DATA_OVERFLOW_GROUP } from './consts';
import { observeResize } from './createResizeObserver';
import { debounce } from './debounce';
import { createPriorityQueue } from './priorityQueue';
/**
* @internal
* @returns overflow manager instance
*/ export function createOverflowManager() {
// calls to `offsetWidth or offsetHeight` can happen multiple times in an update
// Use a cache to avoid causing too many recalcs and avoid scripting time to meausure sizes
const sizeCache = new Map();
let container;
let overflowMenu;
// Set as true when resize observer is observing
let observing = false;
// If true, next update will dispatch to onUpdateOverflow even if queue top states don't change
// Initially true to force dispatch on first mount
let forceDispatch = true;
const options = {
padding: 10,
overflowAxis: 'horizontal',
overflowDirection: 'end',
minimumVisible: 0,
onUpdateItemVisibility: ()=>undefined,
onUpdateOverflow: ()=>undefined,
hasHiddenItems: false
};
const overflowItems = {};
const overflowDividers = {};
let disposeResizeObserver = ()=>null;
const getNextItem = (queueToDequeue, queueToEnqueue)=>{
const nextItem = queueToDequeue.dequeue();
queueToEnqueue.enqueue(nextItem);
return overflowItems[nextItem];
};
const groupManager = createGroupManager();
function compareItems(lt, rt) {
if (!lt || !rt) {
return 0;
}
const lte = overflowItems[lt];
const rte = overflowItems[rt];
// TODO this should not happen but there have been reports of one of these items being undefined
// Try to find a consistent repro for this
if (!lte || !rte) {
return lte ? 1 : -1;
}
// Pinned items have "infinite" priority - they should never be hidden
if (lte.pinned !== rte.pinned) {
return lte.pinned ? 1 : -1;
}
if (lte.priority !== rte.priority) {
return lte.priority > rte.priority ? 1 : -1;
}
// Node.DOCUMENT_POSITION_FOLLOWING = 4, Node.DOCUMENT_POSITION_PRECEDING = 2
const positionStatusBit = options.overflowDirection === 'end' ? 4 : 2;
// eslint-disable-next-line no-bitwise
return lte.element.compareDocumentPosition(rte.element) & positionStatusBit ? 1 : -1;
}
function getElementAxisSize(horizontal, vertical, el) {
if (!sizeCache.has(el)) {
sizeCache.set(el, options.overflowAxis === 'horizontal' ? el[horizontal] : el[vertical]);
}
return sizeCache.get(el);
}
const getOffsetSize = getElementAxisSize.bind(null, 'offsetWidth', 'offsetHeight');
const getClientSize = getElementAxisSize.bind(null, 'clientWidth', 'clientHeight');
const invisibleItemQueue = createPriorityQueue((a, b)=>-1 * compareItems(a, b));
const visibleItemQueue = createPriorityQueue(compareItems);
function occupiedSize() {
const totalItemSize = visibleItemQueue.all().map((id)=>overflowItems[id].element).map(getOffsetSize).reduce((prev, current)=>prev + current, 0);
const totalDividerSize = Object.entries(groupManager.groupVisibility()).reduce((acc, [id, state])=>acc + (state !== 'hidden' && overflowDividers[id] ? getOffsetSize(overflowDividers[id].element) : 0), 0);
const overflowMenuSize = (invisibleItemQueue.size() > 0 || options.hasHiddenItems) && overflowMenu ? getOffsetSize(overflowMenu) : 0;
return totalItemSize + totalDividerSize + overflowMenuSize;
}
const showItem = ()=>{
const item = getNextItem(invisibleItemQueue, visibleItemQueue);
options.onUpdateItemVisibility({
item,
visible: true
});
if (item.groupId) {
groupManager.showItem(item.id, item.groupId);
if (groupManager.isSingleItemVisible(item.id, item.groupId)) {
var _overflowDividers_item_groupId;
(_overflowDividers_item_groupId = overflowDividers[item.groupId]) === null || _overflowDividers_item_groupId === void 0 ? void 0 : _overflowDividers_item_groupId.element.removeAttribute(DATA_OVERFLOWING);
}
}
};
const hideItem = ()=>{
const item = getNextItem(visibleItemQueue, invisibleItemQueue);
options.onUpdateItemVisibility({
item,
visible: false
});
if (item.groupId) {
if (groupManager.isSingleItemVisible(item.id, item.groupId)) {
var _overflowDividers_item_groupId;
(_overflowDividers_item_groupId = overflowDividers[item.groupId]) === null || _overflowDividers_item_groupId === void 0 ? void 0 : _overflowDividers_item_groupId.element.setAttribute(DATA_OVERFLOWING, '');
}
groupManager.hideItem(item.id, item.groupId);
}
};
const dispatchOverflowUpdate = ()=>{
const visibleItemIds = visibleItemQueue.all();
const invisibleItemIds = invisibleItemQueue.all();
const visibleItems = visibleItemIds.map((itemId)=>overflowItems[itemId]);
const invisibleItems = invisibleItemIds.map((itemId)=>overflowItems[itemId]);
options.onUpdateOverflow({
visibleItems,
invisibleItems,
groupVisibility: groupManager.groupVisibility()
});
};
const processOverflowItems = ()=>{
if (!container) {
return false;
}
sizeCache.clear();
const availableSize = getClientSize(container) - options.padding;
// Snapshot of the visible/invisible state to compare for updates
const visibleTop = visibleItemQueue.peek();
const invisibleTop = invisibleItemQueue.peek();
while(compareItems(invisibleItemQueue.peek(), visibleItemQueue.peek()) > 0){
hideItem(); // hide elements whose priority become smaller than the highest priority of the hidden one
}
// Run the show/hide step twice - the first step might not be correct if
// it was triggered by a new item being added - new items are always visible by default.
for(let i = 0; i < 2; i++){
// Add items until available width is filled - can result in overflow
while(occupiedSize() < availableSize && invisibleItemQueue.size() > 0 || invisibleItemQueue.size() === 1 // attempt to show the last invisible item hoping it's size does not exceed overflow menu size
){
showItem();
}
// Remove items until there's no more overflow
while(occupiedSize() > availableSize && visibleItemQueue.size() > options.minimumVisible){
var _overflowItems_nextItemId;
const nextItemId = visibleItemQueue.peek();
// Never hide pinned items - they should always remain visible
if (nextItemId && ((_overflowItems_nextItemId = overflowItems[nextItemId]) === null || _overflowItems_nextItemId === void 0 ? void 0 : _overflowItems_nextItemId.pinned)) {
break;
}
hideItem();
}
}
// only update when the state of visible/invisible items has changed
return visibleItemQueue.peek() !== visibleTop || invisibleItemQueue.peek() !== invisibleTop;
};
const forceUpdate = ()=>{
if (processOverflowItems() || forceDispatch) {
forceDispatch = false;
dispatchOverflowUpdate();
}
};
const update = debounce(forceUpdate);
const observe = (observedContainer, userOptions)=>{
Object.assign(options, userOptions);
observing = true;
Object.values(overflowItems).forEach((item)=>visibleItemQueue.enqueue(item.id));
container = observedContainer;
disposeResizeObserver = observeResize(container, (entries)=>{
if (!entries[0] || !container) {
return;
}
update();
});
};
const addItem = (item)=>{
if (overflowItems[item.id]) {
return;
}
overflowItems[item.id] = item;
// some options can affect priority which are only set on `observe`
if (observing) {
// Updates to elements might not change the queue tops
// i.e. new element is enqueued but the top of the queue stays the same
// force a dispatch on the next batched update
forceDispatch = true;
visibleItemQueue.enqueue(item.id);
}
if (item.groupId) {
groupManager.addItem(item.id, item.groupId);
item.element.setAttribute(DATA_OVERFLOW_GROUP, item.groupId);
}
update();
};
const addOverflowMenu = (el)=>{
overflowMenu = el;
};
const addDivider = (divider)=>{
if (!divider.groupId || overflowDividers[divider.groupId]) {
return;
}
divider.element.setAttribute(DATA_OVERFLOW_GROUP, divider.groupId);
overflowDividers[divider.groupId] = divider;
};
const removeOverflowMenu = ()=>{
overflowMenu = undefined;
};
const removeDivider = (groupId)=>{
if (!overflowDividers[groupId]) {
return;
}
const divider = overflowDividers[groupId];
if (divider.groupId) {
delete overflowDividers[groupId];
divider.element.removeAttribute(DATA_OVERFLOW_GROUP);
}
};
const removeItem = (itemId)=>{
if (!overflowItems[itemId]) {
return;
}
if (observing) {
// We might be removing an item in an overflow which would not affect the tops,
// but we need to update anyway to update the overflow menu state
forceDispatch = true;
}
const item = overflowItems[itemId];
visibleItemQueue.remove(itemId);
invisibleItemQueue.remove(itemId);
if (item.groupId) {
groupManager.removeItem(item.id, item.groupId);
item.element.removeAttribute(DATA_OVERFLOW_GROUP);
}
sizeCache.delete(item.element);
delete overflowItems[itemId];
update();
};
const disconnect = ()=>{
disposeResizeObserver();
// reset flags
container = undefined;
observing = false;
forceDispatch = true;
// clear all entries
Object.keys(overflowItems).forEach((itemId)=>removeItem(itemId));
Object.keys(overflowDividers).forEach((dividerId)=>removeDivider(dividerId));
removeOverflowMenu();
sizeCache.clear();
};
return {
addItem,
disconnect,
forceUpdate,
observe,
removeItem,
update,
addOverflowMenu,
removeOverflowMenu,
addDivider,
removeDivider
};
}
const createGroupManager = ()=>{
const groupVisibility = {};
const groups = {};
function updateGroupVisibility(groupId) {
const group = groups[groupId];
if (group.invisibleItemIds.size && group.visibleItemIds.size) {
groupVisibility[groupId] = 'overflow';
} else if (group.visibleItemIds.size === 0) {
groupVisibility[groupId] = 'hidden';
} else {
groupVisibility[groupId] = 'visible';
}
}
function isGroupVisible(groupId) {
return groupVisibility[groupId] === 'visible' || groupVisibility[groupId] === 'overflow';
}
return {
groupVisibility: ()=>groupVisibility,
isSingleItemVisible (itemId, groupId) {
return isGroupVisible(groupId) && groups[groupId].visibleItemIds.has(itemId) && groups[groupId].visibleItemIds.size === 1;
},
addItem (itemId, groupId) {
var _groups, _groupId;
var _;
(_ = (_groups = groups)[_groupId = groupId]) !== null && _ !== void 0 ? _ : _groups[_groupId] = {
visibleItemIds: new Set(),
invisibleItemIds: new Set()
};
groups[groupId].visibleItemIds.add(itemId);
updateGroupVisibility(groupId);
},
removeItem (itemId, groupId) {
groups[groupId].invisibleItemIds.delete(itemId);
groups[groupId].visibleItemIds.delete(itemId);
updateGroupVisibility(groupId);
},
showItem (itemId, groupId) {
groups[groupId].invisibleItemIds.delete(itemId);
groups[groupId].visibleItemIds.add(itemId);
updateGroupVisibility(groupId);
},
hideItem (itemId, groupId) {
groups[groupId].invisibleItemIds.add(itemId);
groups[groupId].visibleItemIds.delete(itemId);
updateGroupVisibility(groupId);
}
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,89 @@
/**
* @param compare - comparison function for items
* @returns Priority queue implemented with a min heap
*/ export function createPriorityQueue(compare) {
const arr = [];
let size = 0;
const left = (i)=>{
return 2 * i + 1;
};
const right = (i)=>{
return 2 * i + 2;
};
const parent = (i)=>{
return Math.floor((i - 1) / 2);
};
const swap = (a, b)=>{
const tmp = arr[a];
arr[a] = arr[b];
arr[b] = tmp;
};
const heapify = (i)=>{
let smallest = i;
const l = left(i);
const r = right(i);
if (l < size && compare(arr[l], arr[smallest]) < 0) {
smallest = l;
}
if (r < size && compare(arr[r], arr[smallest]) < 0) {
smallest = r;
}
if (smallest !== i) {
swap(smallest, i);
heapify(smallest);
}
};
const dequeue = ()=>{
if (size === 0) {
throw new Error('Priority queue empty');
}
const res = arr[0];
arr[0] = arr[--size];
heapify(0);
return res;
};
const peek = ()=>{
if (size === 0) {
return null;
}
return arr[0];
};
const enqueue = (item)=>{
arr[size++] = item;
let i = size - 1;
let p = parent(i);
while(i > 0 && compare(arr[p], arr[i]) > 0){
swap(p, i);
i = p;
p = parent(i);
}
};
const contains = (item)=>{
const index = arr.indexOf(item);
return index >= 0 && index < size;
};
const remove = (item)=>{
const i = arr.indexOf(item);
if (i === -1 || i >= size) {
return;
}
arr[i] = arr[--size];
heapify(i);
};
const clear = ()=>{
size = 0;
};
const all = ()=>{
return arr.slice(0, size);
};
return {
all,
clear,
contains,
dequeue,
enqueue,
peek,
remove,
size: ()=>size
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/priorityQueue.ts"],"sourcesContent":["export type PriorityQueueCompareFn<T> = (a: T, b: T) => number;\n\nexport interface PriorityQueue<T> {\n all: () => T[];\n clear: () => void;\n contains: (item: T) => boolean;\n dequeue: () => T;\n enqueue: (item: T) => void;\n peek: () => T | null;\n remove: (item: T) => void;\n size: () => number;\n}\n\n/**\n * @param compare - comparison function for items\n * @returns Priority queue implemented with a min heap\n */\nexport function createPriorityQueue<T>(compare: PriorityQueueCompareFn<T>): PriorityQueue<T> {\n const arr: T[] = [];\n let size = 0;\n\n const left = (i: number) => {\n return 2 * i + 1;\n };\n\n const right = (i: number) => {\n return 2 * i + 2;\n };\n\n const parent = (i: number) => {\n return Math.floor((i - 1) / 2);\n };\n\n const swap = (a: number, b: number) => {\n const tmp = arr[a];\n arr[a] = arr[b];\n arr[b] = tmp;\n };\n\n const heapify = (i: number) => {\n let smallest = i;\n const l = left(i);\n const r = right(i);\n\n if (l < size && compare(arr[l], arr[smallest]) < 0) {\n smallest = l;\n }\n\n if (r < size && compare(arr[r], arr[smallest]) < 0) {\n smallest = r;\n }\n\n if (smallest !== i) {\n swap(smallest, i);\n heapify(smallest);\n }\n };\n\n const dequeue = () => {\n if (size === 0) {\n throw new Error('Priority queue empty');\n }\n\n const res = arr[0];\n arr[0] = arr[--size];\n heapify(0);\n\n return res;\n };\n\n const peek = () => {\n if (size === 0) {\n return null;\n }\n\n return arr[0];\n };\n\n const enqueue = (item: T) => {\n arr[size++] = item;\n let i = size - 1;\n let p = parent(i);\n while (i > 0 && compare(arr[p], arr[i]) > 0) {\n swap(p, i);\n i = p;\n p = parent(i);\n }\n };\n\n const contains = (item: T) => {\n const index = arr.indexOf(item);\n return index >= 0 && index < size;\n };\n\n const remove = (item: T) => {\n const i = arr.indexOf(item);\n\n if (i === -1 || i >= size) {\n return;\n }\n\n arr[i] = arr[--size];\n heapify(i);\n };\n\n const clear = () => {\n size = 0;\n };\n\n const all = () => {\n return arr.slice(0, size);\n };\n\n return {\n all,\n clear,\n contains,\n dequeue,\n enqueue,\n peek,\n remove,\n size: () => size,\n };\n}\n"],"names":["createPriorityQueue","compare","arr","size","left","i","right","parent","Math","floor","swap","a","b","tmp","heapify","smallest","l","r","dequeue","Error","res","peek","enqueue","item","p","contains","index","indexOf","remove","clear","all","slice"],"mappings":"AAaA;;;CAGC,GACD,OAAO,SAASA,oBAAuBC,OAAkC;IACvE,MAAMC,MAAW,EAAE;IACnB,IAAIC,OAAO;IAEX,MAAMC,OAAO,CAACC;QACZ,OAAO,IAAIA,IAAI;IACjB;IAEA,MAAMC,QAAQ,CAACD;QACb,OAAO,IAAIA,IAAI;IACjB;IAEA,MAAME,SAAS,CAACF;QACd,OAAOG,KAAKC,KAAK,CAAC,AAACJ,CAAAA,IAAI,CAAA,IAAK;IAC9B;IAEA,MAAMK,OAAO,CAACC,GAAWC;QACvB,MAAMC,MAAMX,GAAG,CAACS,EAAE;QAClBT,GAAG,CAACS,EAAE,GAAGT,GAAG,CAACU,EAAE;QACfV,GAAG,CAACU,EAAE,GAAGC;IACX;IAEA,MAAMC,UAAU,CAACT;QACf,IAAIU,WAAWV;QACf,MAAMW,IAAIZ,KAAKC;QACf,MAAMY,IAAIX,MAAMD;QAEhB,IAAIW,IAAIb,QAAQF,QAAQC,GAAG,CAACc,EAAE,EAAEd,GAAG,CAACa,SAAS,IAAI,GAAG;YAClDA,WAAWC;QACb;QAEA,IAAIC,IAAId,QAAQF,QAAQC,GAAG,CAACe,EAAE,EAAEf,GAAG,CAACa,SAAS,IAAI,GAAG;YAClDA,WAAWE;QACb;QAEA,IAAIF,aAAaV,GAAG;YAClBK,KAAKK,UAAUV;YACfS,QAAQC;QACV;IACF;IAEA,MAAMG,UAAU;QACd,IAAIf,SAAS,GAAG;YACd,MAAM,IAAIgB,MAAM;QAClB;QAEA,MAAMC,MAAMlB,GAAG,CAAC,EAAE;QAClBA,GAAG,CAAC,EAAE,GAAGA,GAAG,CAAC,EAAEC,KAAK;QACpBW,QAAQ;QAER,OAAOM;IACT;IAEA,MAAMC,OAAO;QACX,IAAIlB,SAAS,GAAG;YACd,OAAO;QACT;QAEA,OAAOD,GAAG,CAAC,EAAE;IACf;IAEA,MAAMoB,UAAU,CAACC;QACfrB,GAAG,CAACC,OAAO,GAAGoB;QACd,IAAIlB,IAAIF,OAAO;QACf,IAAIqB,IAAIjB,OAAOF;QACf,MAAOA,IAAI,KAAKJ,QAAQC,GAAG,CAACsB,EAAE,EAAEtB,GAAG,CAACG,EAAE,IAAI,EAAG;YAC3CK,KAAKc,GAAGnB;YACRA,IAAImB;YACJA,IAAIjB,OAAOF;QACb;IACF;IAEA,MAAMoB,WAAW,CAACF;QAChB,MAAMG,QAAQxB,IAAIyB,OAAO,CAACJ;QAC1B,OAAOG,SAAS,KAAKA,QAAQvB;IAC/B;IAEA,MAAMyB,SAAS,CAACL;QACd,MAAMlB,IAAIH,IAAIyB,OAAO,CAACJ;QAEtB,IAAIlB,MAAM,CAAC,KAAKA,KAAKF,MAAM;YACzB;QACF;QAEAD,GAAG,CAACG,EAAE,GAAGH,GAAG,CAAC,EAAEC,KAAK;QACpBW,QAAQT;IACV;IAEA,MAAMwB,QAAQ;QACZ1B,OAAO;IACT;IAEA,MAAM2B,MAAM;QACV,OAAO5B,IAAI6B,KAAK,CAAC,GAAG5B;IACtB;IAEA,OAAO;QACL2B;QACAD;QACAJ;QACAP;QACAI;QACAD;QACAO;QACAzB,MAAM,IAAMA;IACd;AACF"}

View File

@@ -0,0 +1,3 @@
/**
* @internal
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["export type OverflowDirection = 'start' | 'end';\nexport type OverflowAxis = 'horizontal' | 'vertical';\nexport type OverflowGroupState = 'visible' | 'hidden' | 'overflow';\nexport interface OverflowItemEntry {\n /**\n * HTML element that will be disappear when overflowed\n */\n element: HTMLElement;\n /**\n * Lower priority items are invisible first when the container is overflowed\n * @default 0\n */\n priority: number;\n /**\n * Specific id, used to track visibility and provide updates to consumers\n */\n id: string;\n\n groupId?: string;\n\n /**\n * If true, the item will never overflow and will always be visible.\n * Pinned items are excluded from the overflow count.\n * @default false\n */\n pinned?: boolean;\n}\n\nexport interface OverflowDividerEntry {\n /**\n * HTML element that will disappear when overflowed\n */\n element: HTMLElement;\n\n groupId: string;\n}\n\n/**\n * signature similar to standard event listeners, but typed to handle the custom event\n */\nexport type OnUpdateOverflow = (data: OverflowEventPayload) => void;\n\nexport type OnUpdateItemVisibility = (data: OnUpdateItemVisibilityPayload) => void;\n\n/**\n * Payload of the custom DOM event for overflow updates\n */\nexport interface OverflowEventPayload {\n visibleItems: OverflowItemEntry[];\n invisibleItems: OverflowItemEntry[];\n groupVisibility: Record<string, OverflowGroupState>;\n}\n\nexport interface OnUpdateItemVisibilityPayload {\n item: OverflowItemEntry;\n visible: boolean;\n}\n\nexport interface ObserveOptions {\n /**\n * Padding (in px) at the end of the container before overflow occurs\n * Useful to account for extra elements (i.e. dropdown menu)\n * or to account for any kinds of margins between items which are hard to measure with JS\n * @default 10\n */\n padding?: number;\n /**\n * Direction where items are removed when overflow occurs\n * @default end\n */\n overflowDirection?: OverflowDirection;\n\n /**\n * Horizontal or vertical overflow\n * @default horizontal\n */\n overflowAxis?: OverflowAxis;\n\n /**\n * The minimum number of visible items\n */\n minimumVisible?: number;\n\n /**\n * Callback when item visibility is updated\n */\n onUpdateItemVisibility: OnUpdateItemVisibility;\n\n /**\n * Callback when item visibility is updated\n */\n onUpdateOverflow: OnUpdateOverflow;\n\n /**\n * When true, the overflow menu has default hidden items\n * @default false\n */\n hasHiddenItems?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface OverflowManager {\n /**\n * Starts observing the container and managing the overflow state\n */\n observe: (container: HTMLElement, options: ObserveOptions) => void;\n /**\n * Stops observing the container\n */\n disconnect: () => void;\n /**\n * Add overflow items\n */\n addItem: (items: OverflowItemEntry) => void;\n /**\n * Remove overflow item\n */\n removeItem: (itemId: string) => void;\n /**\n * Manually update the overflow, updates are batched and async\n */\n update: () => void;\n /**\n * Manually update the overflow sync\n */\n forceUpdate: () => void;\n\n /**\n * Adds an element that opens an overflow menu. This is used to calculate\n * available space and check if additional items need to overflow\n */\n addOverflowMenu: (element: HTMLElement) => void;\n\n /**\n * Add overflow divider\n */\n addDivider: (divider: OverflowDividerEntry) => void;\n\n /**\n * Remove overflow divider\n */\n removeDivider: (groupId: string) => void;\n\n /**\n * Unsets the overflow menu element\n */\n removeOverflowMenu: () => void;\n}\n"],"names":[],"mappings":"AAoGA;;CAEC,GACD,WA8CC"}

38
node_modules/@fluentui/priority-overflow/package.json generated vendored Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "@fluentui/priority-overflow",
"version": "9.3.0",
"description": "Vanilla JS utilities to implement overflow menus",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"dependencies": {
"@swc/helpers": "^0.5.1"
},
"beachball": {
"disallowedChangeTypes": [
"prerelease",
"major"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-commonjs"
]
}

3394
node_modules/@fluentui/react-accordion/CHANGELOG.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

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

@@ -0,0 +1,15 @@
@fluentui/react-accordion
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

3
node_modules/@fluentui/react-accordion/README.md generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# @fluentui/react-accordion
**React Accordion components for [Fluent UI React](https://react.fluentui.dev)**

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

@@ -0,0 +1,322 @@
import type { ARIAButtonSlotProps } from '@fluentui/react-aria';
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import { ContextSelector } from '@fluentui/react-context-selector';
import { FC } from 'react';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import type { JSXElement } from '@fluentui/react-utilities';
import type { PresenceMotionSlotProps } from '@fluentui/react-motion';
import { Provider } from 'react';
import { ProviderProps } from 'react';
import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';
/**
* Define a styled Accordion, using the `useAccordion_unstable` and `useAccordionStyles_unstable` hooks.
*/
export declare const Accordion: ForwardRefComponent<AccordionProps> & (<TItem>(props: AccordionProps<TItem>) => JSXElement);
export declare type AccordionBaseProps<Value = AccordionItemValue> = Omit<AccordionProps<Value>, 'navigation'>;
export declare type AccordionBaseState<Value = AccordionItemValue> = Omit<AccordionState<Value>, 'navigation'>;
export declare const accordionClassNames: SlotClassNames<AccordionSlots>;
export declare type AccordionContextValue<Value = AccordionItemValue> = {
/**
* The list of opened panels by index
*/
openItems: AccordionItemValue[];
/**
* Callback used by AccordionItem to request a change on it's own opened state
* Should be used to toggle AccordionItem
*/
requestToggle: (data: AccordionRequestToggleData<Value>) => void;
collapsible: boolean;
multiple: boolean;
navigation: 'linear' | 'circular' | undefined;
};
export declare type AccordionContextValues = {
accordion: AccordionContextValue;
};
/**
* Define a styled AccordionHeader, using the `useAccordionHeader_unstable` and `useAccordionHeaderStyles_unstable`
* hooks.
*/
export declare const AccordionHeader: ForwardRefComponent<AccordionHeaderProps>;
export declare type AccordionHeaderBaseProps = Omit<AccordionHeaderProps, 'inline' | 'size'>;
export declare type AccordionHeaderBaseState = Omit<AccordionHeaderState, 'inline' | 'size'>;
export declare const accordionHeaderClassNames: SlotClassNames<AccordionHeaderSlots>;
export declare type AccordionHeaderContextValue = {
disabled: boolean;
open: boolean;
expandIconPosition: AccordionHeaderExpandIconPosition;
size: AccordionHeaderSize;
};
export declare type AccordionHeaderContextValues = {
accordionHeader: AccordionHeaderContextValue;
};
export declare type AccordionHeaderExpandIconPosition = 'start' | 'end';
export declare type AccordionHeaderProps = ComponentProps<Partial<AccordionHeaderSlots>> & {
/**
* The position of the expand icon slot in heading.
*/
expandIconPosition?: AccordionHeaderExpandIconPosition;
/**
* Indicates if the AccordionHeader should be rendered inline.
*/
inline?: boolean;
/**
* Size of spacing in the heading.
*/
size?: AccordionHeaderSize;
};
export declare const AccordionHeaderProvider: React_2.Provider<AccordionHeaderContextValue>;
export declare type AccordionHeaderSize = 'small' | 'medium' | 'large' | 'extra-large';
export declare type AccordionHeaderSlots = {
/**
* The element wrapping the button. By default this is a div, but can be a heading.
*/
root: NonNullable<Slot<'div', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>>;
/**
* The component to be used as button in heading
*/
button: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;
/**
* Expand icon slot rendered before (or after) children content in heading.
*/
expandIcon?: Slot<'span'>;
/**
* Expand icon slot rendered before (or after) children content in heading.
*/
icon?: Slot<'div'>;
};
export declare type AccordionHeaderState = ComponentState<AccordionHeaderSlots> & Required<Pick<AccordionHeaderProps, 'inline'>> & AccordionHeaderContextValue;
export declare type AccordionIndex = number | number[];
/**
* Define a styled AccordionItem, using the `useAccordionItem_unstable` and `useAccordionItemStyles_unstable` hooks.
*/
export declare const AccordionItem: ForwardRefComponent<AccordionItemProps>;
export declare const accordionItemClassNames: SlotClassNames<AccordionItemSlots>;
export declare type AccordionItemContextValue<Value = AccordionItemValue> = {
open: boolean;
disabled: boolean;
value: Value;
/**
* @deprecated - use `requestToggle` from AccordionContent instead
*/
onHeaderClick(event: AccordionToggleEvent): void;
};
export declare type AccordionItemContextValues<Value = AccordionItemValue> = {
accordionItem: AccordionItemContextValue<Value>;
};
export declare type AccordionItemProps<Value = AccordionItemValue> = ComponentProps<AccordionItemSlots> & {
/**
* Disables opening/closing of panel.
*/
disabled?: boolean;
/**
* Required value that identifies this item inside an Accordion component.
*/
value: Value;
};
export declare const AccordionItemProvider: React_2.Provider<AccordionItemContextValue<unknown>>;
export declare type AccordionItemSlots = {
root: NonNullable<Slot<'div'>>;
};
export declare type AccordionItemState<Value = AccordionItemValue> = ComponentState<AccordionItemSlots> & AccordionItemContextValue<Value>;
export declare type AccordionItemValue = unknown;
/**
* Define a styled AccordionPanel, using the `useAccordionPanel_unstable` and `useAccordionPanelStyles_unstable` hooks.
*/
export declare const AccordionPanel: ForwardRefComponent<AccordionPanelProps>;
export declare type AccordionPanelBaseProps = ComponentProps<Omit<AccordionPanelSlots, 'collapseMotion'>>;
export declare type AccordionPanelBaseState = ComponentState<Omit<AccordionPanelSlots, 'collapseMotion'>> & Pick<AccordionPanelState, 'open'>;
export declare const accordionPanelClassNames: SlotClassNames<Omit<AccordionPanelSlots, 'collapseMotion'>>;
export declare type AccordionPanelProps = ComponentProps<AccordionPanelSlots>;
export declare type AccordionPanelSlots = {
root: NonNullable<Slot<'div'>>;
collapseMotion?: Slot<PresenceMotionSlotProps>;
};
export declare type AccordionPanelState = ComponentState<AccordionPanelSlots> & {
/**
* Internal open state, provided by context.
*/
open: boolean;
};
export declare type AccordionProps<Value = AccordionItemValue> = Omit<ComponentProps<AccordionSlots>, 'onToggle'> & {
/**
* Default value for the uncontrolled state of the panel.
*/
defaultOpenItems?: Value | Value[];
/**
* Indicates if Accordion support multiple Panels closed at the same time.
*/
collapsible?: boolean;
/**
* Indicates if Accordion support multiple Panels opened at the same time.
*/
multiple?: boolean;
/**
* @deprecated Arrow keyboard navigation is not recommended for accordions. Consider using Tree if arrow navigation is a hard requirement.
* Indicates if keyboard navigation is available and gives two options, linear or circular navigation.
*/
navigation?: 'linear' | 'circular';
/**
* Callback to be called when the opened items change.
*/
onToggle?: AccordionToggleEventHandler<Value>;
/**
* Controls the state of the panel.
*/
openItems?: Value | Value[];
};
export declare const AccordionProvider: Provider<AccordionContextValue<unknown>> & FC<ProviderProps<AccordionContextValue<unknown>>>;
declare type AccordionRequestToggleData<Value = AccordionItemValue> = {
event: AccordionToggleEvent;
} & Pick<AccordionToggleData<Value>, 'value'>;
export declare type AccordionSlots = {
root: NonNullable<Slot<'div'>>;
};
export declare type AccordionState<Value = AccordionItemValue> = ComponentState<AccordionSlots> & AccordionContextValue<Value>;
export declare type AccordionToggleData<Value = AccordionItemValue> = {
value: Value;
openItems: Value[];
};
export declare type AccordionToggleEvent<E = HTMLElement> = React_2.MouseEvent<E> | React_2.KeyboardEvent<E>;
export declare type AccordionToggleEventHandler<Value = AccordionItemValue> = (event: AccordionToggleEvent, data: AccordionToggleData<Value>) => void;
/**
* Function that renders the final JSX of the component
*/
export declare const renderAccordion_unstable: (state: AccordionBaseState, contextValues: AccordionContextValues) => JSXElement;
/**
* Function that renders the final JSX of the component
*/
export declare const renderAccordionHeader_unstable: (state: AccordionHeaderBaseState, contextValues: AccordionHeaderContextValues) => JSXElement;
/**
* Function that renders the final JSX of the component
*/
export declare const renderAccordionItem_unstable: (state: AccordionItemState, contextValues: AccordionItemContextValues) => JSXElement;
/**
* Function that renders the final JSX of the component
*/
export declare const renderAccordionPanel_unstable: (state: AccordionPanelState) => JSXElement;
/**
* Returns the props and state required to render the component
* @param props - Accordion properties
* @param ref - reference to root HTMLElement of Accordion
*/
export declare const useAccordion_unstable: <Value = unknown>(props: AccordionProps<Value>, ref: React_2.Ref<HTMLElement>) => AccordionState<Value>;
/**
* Returns the props and state required to render the component
* @param props - Accordion properties
* @param ref - reference to root HTMLElement of Accordion
*/
export declare const useAccordionBase_unstable: <Value = unknown>(props: AccordionBaseProps<Value>, ref: React_2.Ref<HTMLElement>) => AccordionBaseState<Value>;
export declare const useAccordionContext_unstable: <T>(selector: ContextSelector<AccordionContextValue, T>) => T;
export declare function useAccordionContextValues_unstable(state: AccordionState): AccordionContextValues;
/**
* Returns the props and state required to render the component
*
* @param props - AccordionHeader properties
* @param ref - reference to root HTMLElement of AccordionHeader
*/
export declare const useAccordionHeader_unstable: (props: AccordionHeaderProps, ref: React_2.Ref<HTMLElement>) => AccordionHeaderState;
/**
* Base state hook for AccordionHeader, without design related features.
*
* @param props - AccordionHeader properties
* @param ref - reference to root HTMLElement of AccordionHeader
*/
export declare const useAccordionHeaderBase_unstable: (props: AccordionHeaderBaseProps, ref: React_2.Ref<HTMLElement>) => AccordionHeaderBaseState;
export declare const useAccordionHeaderContext_unstable: () => AccordionHeaderContextValue;
export declare function useAccordionHeaderContextValues_unstable(state: AccordionHeaderState): AccordionHeaderContextValues;
/** Applies style classnames to slots */
export declare const useAccordionHeaderStyles_unstable: (state: AccordionHeaderState) => AccordionHeaderState;
/**
* Returns the props and state required to render the component
* @param props - AccordionItem properties
* @param ref - reference to root HTMLElement of AccordionItem
*/
export declare const useAccordionItem_unstable: (props: AccordionItemProps, ref: React_2.Ref<HTMLElement>) => AccordionItemState;
export declare const useAccordionItemContext_unstable: () => AccordionItemContextValue<unknown>;
export declare function useAccordionItemContextValues_unstable(state: AccordionItemState): AccordionItemContextValues;
export declare const useAccordionItemStyles_unstable: (state: AccordionItemState) => AccordionItemState;
/**
* Returns the props and state required to render the component
* @param props - AccordionPanel properties
* @param ref - reference to root HTMLElement of AccordionPanel
*/
export declare const useAccordionPanel_unstable: (props: AccordionPanelProps, ref: React_2.Ref<HTMLElement>) => AccordionPanelState;
/**
* Base state hook for AccordionPanel, without design related features.
*
* @param props - AccordionPanelBaseProps properties
* @param ref - reference to root HTMLElement of AccordionPanel
*/
export declare const useAccordionPanelBase_unstable: (props: AccordionPanelBaseProps, ref: React_2.Ref<HTMLElement>) => AccordionPanelBaseState;
/** Applies style classnames to slots */
export declare const useAccordionPanelStyles_unstable: (state: AccordionPanelState) => AccordionPanelState;
export declare const useAccordionStyles_unstable: (state: AccordionState) => AccordionState;
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, {
Accordion: function() {
return _index.Accordion;
},
accordionClassNames: function() {
return _index.accordionClassNames;
},
renderAccordion_unstable: function() {
return _index.renderAccordion_unstable;
},
useAccordionBase_unstable: function() {
return _index.useAccordionBase_unstable;
},
useAccordionContextValues_unstable: function() {
return _index.useAccordionContextValues_unstable;
},
useAccordionStyles_unstable: function() {
return _index.useAccordionStyles_unstable;
},
useAccordion_unstable: function() {
return _index.useAccordion_unstable;
}
});
const _index = require("./components/Accordion/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/Accordion.ts"],"sourcesContent":["export type {\n AccordionContextValues,\n AccordionIndex,\n AccordionProps,\n AccordionSlots,\n AccordionState,\n AccordionToggleData,\n AccordionToggleEvent,\n AccordionToggleEventHandler,\n AccordionBaseState,\n AccordionBaseProps,\n} from './components/Accordion/index';\nexport {\n Accordion,\n accordionClassNames,\n renderAccordion_unstable,\n useAccordionContextValues_unstable,\n useAccordionStyles_unstable,\n useAccordion_unstable,\n useAccordionBase_unstable,\n} from './components/Accordion/index';\n"],"names":["Accordion","accordionClassNames","renderAccordion_unstable","useAccordionContextValues_unstable","useAccordionStyles_unstable","useAccordion_unstable","useAccordionBase_unstable"],"mappings":";;;;;;;;;;;;eAaEA,gBAAS;;;eACTC,0BAAmB;;;eACnBC,+BAAwB;;;eAIxBI,gCAAyB;;;eAHzBH,yCAAkC;;;eAClCC,kCAA2B;;;eAC3BC,4BAAqB;;;uBAEhB,+BAA+B"}

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, {
AccordionHeader: function() {
return _index.AccordionHeader;
},
accordionHeaderClassNames: function() {
return _index.accordionHeaderClassNames;
},
renderAccordionHeader_unstable: function() {
return _index.renderAccordionHeader_unstable;
},
useAccordionHeaderBase_unstable: function() {
return _index.useAccordionHeaderBase_unstable;
},
useAccordionHeaderContextValues_unstable: function() {
return _index.useAccordionHeaderContextValues_unstable;
},
useAccordionHeaderStyles_unstable: function() {
return _index.useAccordionHeaderStyles_unstable;
},
useAccordionHeader_unstable: function() {
return _index.useAccordionHeader_unstable;
}
});
const _index = require("./components/AccordionHeader/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/AccordionHeader.ts"],"sourcesContent":["export type {\n AccordionHeaderContextValues,\n AccordionHeaderExpandIconPosition,\n AccordionHeaderProps,\n AccordionHeaderSize,\n AccordionHeaderSlots,\n AccordionHeaderState,\n AccordionHeaderBaseState,\n AccordionHeaderBaseProps,\n} from './components/AccordionHeader/index';\nexport {\n AccordionHeader,\n accordionHeaderClassNames,\n renderAccordionHeader_unstable,\n useAccordionHeaderContextValues_unstable,\n useAccordionHeaderStyles_unstable,\n useAccordionHeader_unstable,\n useAccordionHeaderBase_unstable,\n} from './components/AccordionHeader/index';\n"],"names":["AccordionHeader","accordionHeaderClassNames","renderAccordionHeader_unstable","useAccordionHeaderContextValues_unstable","useAccordionHeaderStyles_unstable","useAccordionHeader_unstable","useAccordionHeaderBase_unstable"],"mappings":";;;;;;;;;;;;eAWEA,sBAAe;;;eACfC,gCAAyB;;;eACzBC,qCAA8B;;;eAI9BI,sCAA+B;;;eAH/BH,+CAAwC;;;eACxCC,wCAAiC;;;eACjCC,kCAA2B;;;uBAEtB,qCAAqC"}

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, {
AccordionItem: function() {
return _index.AccordionItem;
},
accordionItemClassNames: function() {
return _index.accordionItemClassNames;
},
renderAccordionItem_unstable: function() {
return _index.renderAccordionItem_unstable;
},
useAccordionItemContextValues_unstable: function() {
return _index.useAccordionItemContextValues_unstable;
},
useAccordionItemStyles_unstable: function() {
return _index.useAccordionItemStyles_unstable;
},
useAccordionItem_unstable: function() {
return _index.useAccordionItem_unstable;
}
});
const _index = require("./components/AccordionItem/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/AccordionItem.ts"],"sourcesContent":["export type {\n AccordionItemContextValues,\n AccordionItemProps,\n AccordionItemSlots,\n AccordionItemState,\n AccordionItemValue,\n} from './components/AccordionItem/index';\nexport {\n AccordionItem,\n accordionItemClassNames,\n renderAccordionItem_unstable,\n useAccordionItemContextValues_unstable,\n useAccordionItemStyles_unstable,\n useAccordionItem_unstable,\n} from './components/AccordionItem/index';\n"],"names":["AccordionItem","accordionItemClassNames","renderAccordionItem_unstable","useAccordionItemContextValues_unstable","useAccordionItemStyles_unstable","useAccordionItem_unstable"],"mappings":";;;;;;;;;;;;eAQEA,oBAAa;;;eACbC,8BAAuB;;;eACvBC,mCAA4B;;;eAC5BC,6CAAsC;;;eACtCC,sCAA+B;;;eAC/BC,gCAAyB;;;uBACpB,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, {
AccordionPanel: function() {
return _index.AccordionPanel;
},
accordionPanelClassNames: function() {
return _index.accordionPanelClassNames;
},
renderAccordionPanel_unstable: function() {
return _index.renderAccordionPanel_unstable;
},
useAccordionPanelBase_unstable: function() {
return _index.useAccordionPanelBase_unstable;
},
useAccordionPanelStyles_unstable: function() {
return _index.useAccordionPanelStyles_unstable;
},
useAccordionPanel_unstable: function() {
return _index.useAccordionPanel_unstable;
}
});
const _index = require("./components/AccordionPanel/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/AccordionPanel.ts"],"sourcesContent":["export type {\n AccordionPanelProps,\n AccordionPanelSlots,\n AccordionPanelState,\n AccordionPanelBaseProps,\n AccordionPanelBaseState,\n} from './components/AccordionPanel/index';\nexport {\n AccordionPanel,\n accordionPanelClassNames,\n renderAccordionPanel_unstable,\n useAccordionPanelStyles_unstable,\n useAccordionPanel_unstable,\n useAccordionPanelBase_unstable,\n} from './components/AccordionPanel/index';\n"],"names":["AccordionPanel","accordionPanelClassNames","renderAccordionPanel_unstable","useAccordionPanelStyles_unstable","useAccordionPanel_unstable","useAccordionPanelBase_unstable"],"mappings":";;;;;;;;;;;;eAQEA,qBAAc;;;eACdC,+BAAwB;;;eACxBC,oCAA6B;;;eAG7BG,qCAA8B;;;eAF9BF,uCAAgC;;;eAChCC,iCAA0B;;;uBAErB,oCAAoC"}

View File

@@ -0,0 +1,26 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Accordion", {
enumerable: true,
get: function() {
return Accordion;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _renderAccordion = require("./renderAccordion");
const _useAccordion = require("./useAccordion");
const _useAccordionContextValues = require("./useAccordionContextValues");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _useAccordionStylesstyles = require("./useAccordionStyles.styles");
const Accordion = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useAccordion.useAccordion_unstable)(props, ref);
const contextValues = (0, _useAccordionContextValues.useAccordionContextValues_unstable)(state);
(0, _useAccordionStylesstyles.useAccordionStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useAccordionStyles_unstable')(state);
return (0, _renderAccordion.renderAccordion_unstable)(state, contextValues);
});
Accordion.displayName = 'Accordion';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Accordion/Accordion.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { renderAccordion_unstable } from './renderAccordion';\nimport { useAccordion_unstable } from './useAccordion';\nimport { useAccordionContextValues_unstable } from './useAccordionContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useAccordionStyles_unstable } from './useAccordionStyles.styles';\nimport type { AccordionProps } from './Accordion.types';\nimport type { ForwardRefComponent, JSXElement } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Accordion, using the `useAccordion_unstable` and `useAccordionStyles_unstable` hooks.\n */\nexport const Accordion: ForwardRefComponent<AccordionProps> & (<TItem>(props: AccordionProps<TItem>) => JSXElement) =\n React.forwardRef<HTMLDivElement, AccordionProps>((props, ref) => {\n const state = useAccordion_unstable(props, ref);\n const contextValues = useAccordionContextValues_unstable(state);\n\n useAccordionStyles_unstable(state);\n\n useCustomStyleHook_unstable('useAccordionStyles_unstable')(state);\n\n return renderAccordion_unstable(state, contextValues);\n }) as ForwardRefComponent<AccordionProps> & (<TItem>(props: AccordionProps<TItem>) => JSXElement);\n\nAccordion.displayName = 'Accordion';\n"],"names":["React","renderAccordion_unstable","useAccordion_unstable","useAccordionContextValues_unstable","useCustomStyleHook_unstable","useAccordionStyles_unstable","Accordion","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;iCACU,oBAAoB;8BACvB,iBAAiB;2CACJ,8BAA8B;qCACrC,kCAAkC;0CAClC,8BAA8B;AAOnE,MAAMM,YAAAA,WAAAA,GACXN,OAAMO,UAAU,CAAiC,CAACC,OAAOC;IACvD,MAAMC,YAAQR,mCAAAA,EAAsBM,OAAOC;IAC3C,MAAME,oBAAgBR,6DAAAA,EAAmCO;QAEzDL,qDAAAA,EAA4BK;QAE5BN,gDAAAA,EAA4B,+BAA+BM;IAE3D,WAAOT,yCAAAA,EAAyBS,OAAOC;AACzC,GAAkG;AAEpGL,UAAUM,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/Accordion/Accordion.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { AccordionContextValue } from '../../contexts/accordion';\nimport type { AccordionItemValue } from '../AccordionItem/AccordionItem.types';\n\nexport type AccordionIndex = number | number[];\n\nexport type AccordionToggleEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;\n\nexport type AccordionToggleEventHandler<Value = AccordionItemValue> = (\n event: AccordionToggleEvent,\n data: AccordionToggleData<Value>,\n) => void;\n\nexport type AccordionContextValues = {\n accordion: AccordionContextValue;\n};\n\nexport type AccordionSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type AccordionToggleData<Value = AccordionItemValue> = {\n value: Value;\n openItems: Value[];\n};\n\nexport type AccordionProps<Value = AccordionItemValue> = Omit<ComponentProps<AccordionSlots>, 'onToggle'> & {\n /**\n * Default value for the uncontrolled state of the panel.\n */\n defaultOpenItems?: Value | Value[];\n\n /**\n * Indicates if Accordion support multiple Panels closed at the same time.\n */\n collapsible?: boolean;\n\n /**\n * Indicates if Accordion support multiple Panels opened at the same time.\n */\n multiple?: boolean;\n\n /**\n * @deprecated Arrow keyboard navigation is not recommended for accordions. Consider using Tree if arrow navigation is a hard requirement.\n * Indicates if keyboard navigation is available and gives two options, linear or circular navigation.\n */\n navigation?: 'linear' | 'circular';\n\n /**\n * Callback to be called when the opened items change.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onToggle?: AccordionToggleEventHandler<Value>;\n\n /**\n * Controls the state of the panel.\n */\n openItems?: Value | Value[];\n};\n\nexport type AccordionBaseProps<Value = AccordionItemValue> = Omit<AccordionProps<Value>, 'navigation'>;\n\nexport type AccordionState<Value = AccordionItemValue> = ComponentState<AccordionSlots> & AccordionContextValue<Value>;\n\nexport type AccordionBaseState<Value = AccordionItemValue> = Omit<AccordionState<Value>, 'navigation'>;\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, {
Accordion: function() {
return _Accordion.Accordion;
},
accordionClassNames: function() {
return _useAccordionStylesstyles.accordionClassNames;
},
renderAccordion_unstable: function() {
return _renderAccordion.renderAccordion_unstable;
},
useAccordionBase_unstable: function() {
return _useAccordion.useAccordionBase_unstable;
},
useAccordionContextValues_unstable: function() {
return _useAccordionContextValues.useAccordionContextValues_unstable;
},
useAccordionStyles_unstable: function() {
return _useAccordionStylesstyles.useAccordionStyles_unstable;
},
useAccordion_unstable: function() {
return _useAccordion.useAccordion_unstable;
}
});
const _Accordion = require("./Accordion");
const _renderAccordion = require("./renderAccordion");
const _useAccordion = require("./useAccordion");
const _useAccordionStylesstyles = require("./useAccordionStyles.styles");
const _useAccordionContextValues = require("./useAccordionContextValues");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Accordion/index.ts"],"sourcesContent":["export { Accordion } from './Accordion';\nexport type {\n AccordionContextValues,\n AccordionIndex,\n AccordionProps,\n AccordionSlots,\n AccordionState,\n AccordionToggleData,\n AccordionToggleEvent,\n AccordionToggleEventHandler,\n AccordionBaseState,\n AccordionBaseProps,\n} from './Accordion.types';\nexport { renderAccordion_unstable } from './renderAccordion';\nexport { useAccordion_unstable, useAccordionBase_unstable } from './useAccordion';\nexport { accordionClassNames, useAccordionStyles_unstable } from './useAccordionStyles.styles';\nexport { useAccordionContextValues_unstable } from './useAccordionContextValues';\n"],"names":["Accordion","renderAccordion_unstable","useAccordion_unstable","useAccordionBase_unstable","accordionClassNames","useAccordionStyles_unstable","useAccordionContextValues_unstable"],"mappings":";;;;;;;;;;;IAASA;mCAAS;;IAeTI;4DAAmB;;;eAFnBH,yCAAwB;;;eACDE,uCAAyB;;;eAEhDG,6DAAkC;;;eADbD,qDAA2B;;;eADhDH,mCAAqB;;;2BAdJ,cAAc;iCAaC,oBAAoB;8BACI,iBAAiB;0CACjB,8BAA8B;2CAC5C,8BAA8B"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Accordion/renderAccordion.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport type { AccordionBaseState, AccordionSlots, AccordionContextValues } from './Accordion.types';\nimport { AccordionProvider } from '../../contexts/accordion';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderAccordion_unstable = (\n state: AccordionBaseState,\n contextValues: AccordionContextValues,\n): JSXElement => {\n assertSlots<AccordionSlots>(state);\n\n return (\n <state.root>\n <AccordionProvider value={contextValues.accordion}>{state.root.children}</AccordionProvider>\n </state.root>\n );\n};\n"],"names":["assertSlots","AccordionProvider","renderAccordion_unstable","state","contextValues","root","value","accordion","children"],"mappings":";;;;+BAYaE;;;;;;4BAXb,gDAAiD;gCAErB,4BAA4B;2BAItB,2BAA2B;AAKtD,iCAAiC,CACtCC,OACAC;QAEAJ,2BAAAA,EAA4BG;IAE5B,OAAA,WAAA,OACE,eAAA,EAACA,MAAME,IAAI,EAAA;kBACT,WAAA,OAAA,eAAA,EAACJ,4BAAAA,EAAAA;YAAkBK,OAAOF,cAAcG,SAAS;sBAAGJ,MAAME,IAAI,CAACG,QAAQ;;;AAG7E,EAAE"}

View File

@@ -0,0 +1,125 @@
'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, {
useAccordionBase_unstable: function() {
return useAccordionBase_unstable;
},
useAccordion_unstable: function() {
return useAccordion_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 useAccordion_unstable = (props, ref)=>{
const { navigation, ...baseProps } = props;
const state = useAccordionBase_unstable(baseProps, ref);
/** FIXME: deprecated will be removed after navigation prop is removed */ const arrowNavigationProps = (0, _reacttabster.useArrowNavigationGroup)({
circular: navigation === 'circular',
tabbable: true
});
return {
navigation,
...state,
root: {
...state.root,
...navigation ? arrowNavigationProps : undefined
}
};
};
const useAccordionBase_unstable = (props, ref)=>{
const { openItems: controlledOpenItems, defaultOpenItems, multiple = false, collapsible = false, onToggle, ...rest } = props;
const [openItems, setOpenItems] = (0, _reactutilities.useControllableState)({
state: _react.useMemo(()=>normalizeValues(controlledOpenItems), [
controlledOpenItems
]),
defaultState: defaultOpenItems && (()=>initializeUncontrolledOpenItems({
defaultOpenItems,
multiple
})),
initialState: []
});
const requestToggle = (0, _reactutilities.useEventCallback)((data)=>{
const nextOpenItems = updateOpenItems(data.value, openItems, multiple, collapsible);
onToggle === null || onToggle === void 0 ? void 0 : onToggle(data.event, {
value: data.value,
openItems: nextOpenItems
});
setOpenItems(nextOpenItems);
});
return {
collapsible,
multiple,
openItems,
requestToggle,
components: {
root: 'div'
},
root: _reactutilities.slot.always({
ref: ref,
...rest
}, {
elementType: 'div'
})
};
};
/**
* Initial value for the uncontrolled case of the list of open indexes
*/ function initializeUncontrolledOpenItems({ defaultOpenItems, multiple }) {
if (defaultOpenItems !== undefined) {
if (Array.isArray(defaultOpenItems)) {
return multiple ? defaultOpenItems : [
defaultOpenItems[0]
];
}
return [
defaultOpenItems
];
}
return [];
}
/**
* Updates the list of open indexes based on an index that changes
* @param value - the index that will change
* @param previousOpenItems - list of current open indexes
* @param multiple - if Accordion support multiple Panels opened at the same time
* @param collapsible - if Accordion support multiple Panels closed at the same time
*/ function updateOpenItems(value, previousOpenItems, multiple, collapsible) {
if (multiple) {
if (previousOpenItems.includes(value)) {
if (previousOpenItems.length > 1 || collapsible) {
return previousOpenItems.filter((i)=>i !== value);
}
} else {
return [
...previousOpenItems,
value
].sort();
}
} else {
return previousOpenItems[0] === value && collapsible ? [] : [
value
];
}
return previousOpenItems;
}
/**
* Normalizes Accordion index into an array of indexes
*/ function normalizeValues(index) {
if (index === undefined) {
return undefined;
}
return Array.isArray(index) ? index : [
index
];
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useAccordionContextValues_unstable", {
enumerable: true,
get: function() {
return useAccordionContextValues_unstable;
}
});
function useAccordionContextValues_unstable(state) {
const { navigation, openItems, requestToggle, multiple, collapsible } = state;
// This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
const accordion = {
navigation,
openItems,
requestToggle,
collapsible,
multiple
};
return {
accordion
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Accordion/useAccordionContextValues.ts"],"sourcesContent":["import type { AccordionContextValue } from '../../contexts/accordion';\nimport type { AccordionContextValues, AccordionState } from './Accordion.types';\n\nexport function useAccordionContextValues_unstable(state: AccordionState): AccordionContextValues {\n const { navigation, openItems, requestToggle, multiple, collapsible } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const accordion: AccordionContextValue = {\n navigation,\n openItems,\n requestToggle,\n collapsible,\n multiple,\n };\n\n return { accordion };\n}\n"],"names":["useAccordionContextValues_unstable","state","navigation","openItems","requestToggle","multiple","collapsible","accordion"],"mappings":";;;;+BAGgBA;;;;;;AAAT,4CAA4CC,KAAqB;IACtE,MAAM,EAAEC,UAAU,EAAEC,SAAS,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,WAAW,EAAE,GAAGL;IAExE,mGAAmG;IACnG,MAAMM,YAAmC;QACvCL;QACAC;QACAC;QACAE;QACAD;IACF;IAEA,OAAO;QAAEE;IAAU;AACrB"}

View File

@@ -0,0 +1,27 @@
"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, {
accordionClassNames: function() {
return accordionClassNames;
},
useAccordionStyles_unstable: function() {
return useAccordionStyles_unstable;
}
});
const _react = require("@griffel/react");
const accordionClassNames = {
root: 'fui-Accordion'
};
const useAccordionStyles_unstable = (state)=>{
'use no memo';
state.root.className = (0, _react.mergeClasses)(accordionClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["useAccordionStyles.styles.js"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nexport const accordionClassNames = {\n root: 'fui-Accordion'\n};\nexport const useAccordionStyles_unstable = (state)=>{\n 'use no memo';\n state.root.className = mergeClasses(accordionClassNames.root, state.root.className);\n return state;\n};\n"],"names":["mergeClasses","accordionClassNames","root","useAccordionStyles_unstable","state","className"],"mappings":";;;;;;;;;;;IACaC,mBAAmB;;;+BAGQ;;;;uBAJX,gBAAgB;AACtC,4BAA4B;IAC/BC,IAAI,EAAE;AACV,CAAC;AACM,MAAMC,8BAA+BC,KAAK,IAAG;IAChD,aAAa;IACbA,KAAK,CAACF,IAAI,CAACG,SAAS,OAAGL,mBAAY,EAACC,mBAAmB,CAACC,IAAI,EAAEE,KAAK,CAACF,IAAI,CAACG,SAAS,CAAC;IACnF,OAAOD,KAAK;AAChB,CAAC"}

View File

@@ -0,0 +1,27 @@
"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, {
accordionClassNames: function() {
return accordionClassNames;
},
useAccordionStyles_unstable: function() {
return useAccordionStyles_unstable;
}
});
const _react = require("@griffel/react");
const accordionClassNames = {
root: 'fui-Accordion'
};
const useAccordionStyles_unstable = (state)=>{
'use no memo';
state.root.className = (0, _react.mergeClasses)(accordionClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Accordion/useAccordionStyles.styles.ts"],"sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses } from '@griffel/react';\nimport type { AccordionSlots, AccordionState } from './Accordion.types';\n\nexport const accordionClassNames: SlotClassNames<AccordionSlots> = {\n root: 'fui-Accordion',\n};\n\nexport const useAccordionStyles_unstable = (state: AccordionState): AccordionState => {\n 'use no memo';\n\n state.root.className = mergeClasses(accordionClassNames.root, state.root.className);\n\n return state;\n};\n"],"names":["mergeClasses","accordionClassNames","root","useAccordionStyles_unstable","state","className"],"mappings":";;;;;;;;;;;IAIaC,mBAAAA;;;+BAIAE;;;;uBAPgB,iBAAiB;AAGvC,4BAA4D;IACjED,MAAM;AACR,EAAE;AAEK,MAAMC,8BAA8B,CAACC;IAC1C;IAEAA,MAAMF,IAAI,CAACG,SAAS,OAAGL,mBAAAA,EAAaC,oBAAoBC,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IAElF,OAAOD;AACT,EAAE"}

View File

@@ -0,0 +1,26 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AccordionHeader", {
enumerable: true,
get: function() {
return AccordionHeader;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useAccordionHeader = require("./useAccordionHeader");
const _renderAccordionHeader = require("./renderAccordionHeader");
const _useAccordionHeaderStylesstyles = require("./useAccordionHeaderStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _useAccordionHeaderContextValues = require("./useAccordionHeaderContextValues");
const AccordionHeader = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useAccordionHeader.useAccordionHeader_unstable)(props, ref);
const contextValues = (0, _useAccordionHeaderContextValues.useAccordionHeaderContextValues_unstable)(state);
(0, _useAccordionHeaderStylesstyles.useAccordionHeaderStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useAccordionHeaderStyles_unstable')(state);
return (0, _renderAccordionHeader.renderAccordionHeader_unstable)(state, contextValues);
});
AccordionHeader.displayName = 'AccordionHeader';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AccordionHeader/AccordionHeader.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useAccordionHeader_unstable } from './useAccordionHeader';\nimport { renderAccordionHeader_unstable } from './renderAccordionHeader';\nimport { useAccordionHeaderStyles_unstable } from './useAccordionHeaderStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useAccordionHeaderContextValues_unstable } from './useAccordionHeaderContextValues';\nimport type { AccordionHeaderProps } from './AccordionHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled AccordionHeader, using the `useAccordionHeader_unstable` and `useAccordionHeaderStyles_unstable`\n * hooks.\n */\nexport const AccordionHeader: ForwardRefComponent<AccordionHeaderProps> = React.forwardRef((props, ref) => {\n const state = useAccordionHeader_unstable(props, ref);\n const contextValues = useAccordionHeaderContextValues_unstable(state);\n\n useAccordionHeaderStyles_unstable(state);\n\n useCustomStyleHook_unstable('useAccordionHeaderStyles_unstable')(state);\n\n return renderAccordionHeader_unstable(state, contextValues);\n});\n\nAccordionHeader.displayName = 'AccordionHeader';\n"],"names":["React","useAccordionHeader_unstable","renderAccordionHeader_unstable","useAccordionHeaderStyles_unstable","useCustomStyleHook_unstable","useAccordionHeaderContextValues_unstable","AccordionHeader","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;oCACa,uBAAuB;uCACpB,0BAA0B;gDACvB,oCAAoC;qCAC1C,kCAAkC;iDACrB,oCAAoC;AAQtF,MAAMM,kBAAAA,WAAAA,GAA6DN,OAAMO,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,YAAQT,+CAAAA,EAA4BO,OAAOC;IACjD,MAAME,oBAAgBN,yEAAAA,EAAyCK;QAE/DP,iEAAAA,EAAkCO;QAElCN,gDAAAA,EAA4B,qCAAqCM;IAEjE,WAAOR,qDAAAA,EAA+BQ,OAAOC;AAC/C,GAAG;AAEHL,gBAAgBM,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/AccordionHeader/AccordionHeader.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { AccordionHeaderContextValue } from '../../contexts/accordionHeader';\n\nexport type AccordionHeaderSize = 'small' | 'medium' | 'large' | 'extra-large';\nexport type AccordionHeaderExpandIconPosition = 'start' | 'end';\n\nexport type AccordionHeaderContextValues = {\n accordionHeader: AccordionHeaderContextValue;\n};\n\nexport type AccordionHeaderSlots = {\n /**\n * The element wrapping the button. By default this is a div, but can be a heading.\n */\n root: NonNullable<Slot<'div', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>>;\n /**\n * The component to be used as button in heading\n */\n button: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n /**\n * Expand icon slot rendered before (or after) children content in heading.\n */\n expandIcon?: Slot<'span'>;\n /**\n * Expand icon slot rendered before (or after) children content in heading.\n */\n icon?: Slot<'div'>;\n};\n\nexport type AccordionHeaderProps = ComponentProps<Partial<AccordionHeaderSlots>> & {\n /**\n * The position of the expand icon slot in heading.\n */\n expandIconPosition?: AccordionHeaderExpandIconPosition;\n\n /**\n * Indicates if the AccordionHeader should be rendered inline.\n */\n inline?: boolean;\n\n /**\n * Size of spacing in the heading.\n */\n size?: AccordionHeaderSize;\n};\n\nexport type AccordionHeaderBaseProps = Omit<AccordionHeaderProps, 'inline' | 'size'>;\n\nexport type AccordionHeaderState = ComponentState<AccordionHeaderSlots> &\n Required<Pick<AccordionHeaderProps, 'inline'>> &\n AccordionHeaderContextValue;\n\nexport type AccordionHeaderBaseState = Omit<AccordionHeaderState, 'inline' | 'size'>;\n"],"names":[],"mappings":""}

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, {
AccordionHeader: function() {
return _AccordionHeader.AccordionHeader;
},
accordionHeaderClassNames: function() {
return _useAccordionHeaderStylesstyles.accordionHeaderClassNames;
},
renderAccordionHeader_unstable: function() {
return _renderAccordionHeader.renderAccordionHeader_unstable;
},
useAccordionHeaderBase_unstable: function() {
return _useAccordionHeader.useAccordionHeaderBase_unstable;
},
useAccordionHeaderContextValues_unstable: function() {
return _useAccordionHeaderContextValues.useAccordionHeaderContextValues_unstable;
},
useAccordionHeaderStyles_unstable: function() {
return _useAccordionHeaderStylesstyles.useAccordionHeaderStyles_unstable;
},
useAccordionHeader_unstable: function() {
return _useAccordionHeader.useAccordionHeader_unstable;
}
});
const _AccordionHeader = require("./AccordionHeader");
const _renderAccordionHeader = require("./renderAccordionHeader");
const _useAccordionHeader = require("./useAccordionHeader");
const _useAccordionHeaderContextValues = require("./useAccordionHeaderContextValues");
const _useAccordionHeaderStylesstyles = require("./useAccordionHeaderStyles.styles");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AccordionHeader/index.ts"],"sourcesContent":["export { AccordionHeader } from './AccordionHeader';\nexport type {\n AccordionHeaderContextValues,\n AccordionHeaderExpandIconPosition,\n AccordionHeaderProps,\n AccordionHeaderSize,\n AccordionHeaderSlots,\n AccordionHeaderState,\n AccordionHeaderBaseState,\n AccordionHeaderBaseProps,\n} from './AccordionHeader.types';\nexport { renderAccordionHeader_unstable } from './renderAccordionHeader';\nexport { useAccordionHeader_unstable, useAccordionHeaderBase_unstable } from './useAccordionHeader';\nexport { useAccordionHeaderContextValues_unstable } from './useAccordionHeaderContextValues';\nexport { accordionHeaderClassNames, useAccordionHeaderStyles_unstable } from './useAccordionHeaderStyles.styles';\n"],"names":["AccordionHeader","renderAccordionHeader_unstable","useAccordionHeader_unstable","useAccordionHeaderBase_unstable","useAccordionHeaderContextValues_unstable","accordionHeaderClassNames","useAccordionHeaderStyles_unstable"],"mappings":";;;;;;;;;;;IAASA;+CAAe;;IAcfK;wEAAyB;;;eAHzBJ,qDAA8B;;;eACDE,mDAA+B;;;eAC5DC,yEAAwC;;;eACbE,iEAAiC;;;eAF5DJ,+CAA2B;;;iCAZJ,oBAAoB;uCAWL,0BAA0B;oCACI,uBAAuB;iDAC3C,oCAAoC;gDAChB,oCAAoC"}

View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderAccordionHeader_unstable", {
enumerable: true,
get: function() {
return renderAccordionHeader_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const _accordionHeader = require("../../contexts/accordionHeader");
const renderAccordionHeader_unstable = (state, contextValues)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_accordionHeader.AccordionHeaderProvider, {
value: contextValues.accordionHeader,
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.button, {
children: [
state.expandIconPosition === 'start' && state.expandIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.expandIcon, {}),
state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
state.root.children,
state.expandIconPosition === 'end' && state.expandIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.expandIcon, {})
]
})
})
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AccordionHeader/renderAccordionHeader.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 {\n AccordionHeaderBaseState,\n AccordionHeaderSlots,\n AccordionHeaderContextValues,\n} from './AccordionHeader.types';\nimport { AccordionHeaderProvider } from '../../contexts/accordionHeader';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderAccordionHeader_unstable = (\n state: AccordionHeaderBaseState,\n contextValues: AccordionHeaderContextValues,\n): JSXElement => {\n assertSlots<AccordionHeaderSlots>(state);\n\n return (\n <AccordionHeaderProvider value={contextValues.accordionHeader}>\n <state.root>\n <state.button>\n {state.expandIconPosition === 'start' && state.expandIcon && <state.expandIcon />}\n {state.icon && <state.icon />}\n {state.root.children}\n {state.expandIconPosition === 'end' && state.expandIcon && <state.expandIcon />}\n </state.button>\n </state.root>\n </AccordionHeaderProvider>\n );\n};\n"],"names":["assertSlots","AccordionHeaderProvider","renderAccordionHeader_unstable","state","contextValues","value","accordionHeader","root","button","expandIconPosition","expandIcon","icon","children"],"mappings":";;;;+BAeaE;;;;;;4BAdb,iCAAiD;gCAErB,4BAA4B;iCAOhB,iCAAiC;AAKlE,uCAAuC,CAC5CC,OACAC;QAEAJ,2BAAAA,EAAkCG;IAElC,OAAA,WAAA,OACE,eAAA,EAACF,wCAAAA,EAAAA;QAAwBI,OAAOD,cAAcE,eAAe;kBAC3D,WAAA,GAAA,mBAAA,EAACH,MAAMI,IAAI,EAAA;sBACT,WAAA,OAAA,gBAAA,EAACJ,MAAMK,MAAM,EAAA;;oBACVL,MAAMM,kBAAkB,KAAK,WAAWN,MAAMO,UAAU,IAAA,WAAA,OAAI,eAAA,EAACP,MAAMO,UAAU,EAAA,CAAA;oBAC7EP,MAAMQ,IAAI,IAAA,WAAA,OAAI,eAAA,EAACR,MAAMQ,IAAI,EAAA,CAAA;oBACzBR,MAAMI,IAAI,CAACK,QAAQ;oBACnBT,MAAMM,kBAAkB,KAAK,SAASN,MAAMO,UAAU,IAAA,WAAA,OAAI,eAAA,EAACP,MAAMO,UAAU,EAAA,CAAA;;;;;AAKtF,EAAE"}

View File

@@ -0,0 +1,115 @@
'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, {
useAccordionHeaderBase_unstable: function() {
return useAccordionHeaderBase_unstable;
},
useAccordionHeader_unstable: function() {
return useAccordionHeader_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 _reactaria = require("@fluentui/react-aria");
const _accordion = require("../../contexts/accordion");
const _reacticons = require("@fluentui/react-icons");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _accordionItem = require("../../contexts/accordionItem");
const _reactmotion = require("@fluentui/react-motion");
const useAccordionHeader_unstable = (props, ref)=>{
const { inline = false, size = 'medium', ...baseProps } = props;
const state = useAccordionHeaderBase_unstable(baseProps, ref);
const { dir } = (0, _reactsharedcontexts.useFluent_unstable)();
// Calculate how to rotate the expand icon [>] (ChevronRightRegular)
let expandIconRotation;
if (state.expandIconPosition === 'end') {
// If expand icon is at the end, the chevron points up [^] when open, and down [v] when closed
expandIconRotation = state.open ? -90 : 90;
} else {
// Otherwise, the chevron points down [v] when open, and right [>] (or left [<] in RTL) when closed
expandIconRotation = state.open ? 90 : dir !== 'rtl' ? 0 : 180;
}
if (state.expandIcon) {
var _state_expandIcon;
var _children;
(_children = (_state_expandIcon = state.expandIcon).children) !== null && _children !== void 0 ? _children : _state_expandIcon.children = /*#__PURE__*/ _react.createElement(_reacticons.ChevronRightRegular, {
style: {
transform: `rotate(${expandIconRotation}deg)`,
transition: `transform ${_reactmotion.motionTokens.durationNormal}ms ease-out`
}
});
}
return {
...state,
inline,
size
};
};
const useAccordionHeaderBase_unstable = (props, ref)=>{
const { icon, button, expandIcon, expandIconPosition = 'start', ...rest } = props;
const { value, disabled, open } = (0, _accordionItem.useAccordionItemContext_unstable)();
const requestToggle = (0, _accordion.useAccordionContext_unstable)((ctx)=>ctx.requestToggle);
/**
* force disabled state on button if accordion isn't collapsible
* and this is the only item opened
*/ const disabledFocusable = (0, _accordion.useAccordionContext_unstable)((ctx)=>!ctx.collapsible && ctx.openItems.length === 1 && open);
const buttonSlot = _reactutilities.slot.always(button, {
elementType: 'button',
defaultProps: {
disabled,
disabledFocusable,
'aria-expanded': open,
type: 'button'
}
});
buttonSlot.onClick = (0, _reactutilities.useEventCallback)((event)=>{
if ((0, _reactutilities.isResolvedShorthand)(button)) {
var _button_onClick;
(_button_onClick = button.onClick) === null || _button_onClick === void 0 ? void 0 : _button_onClick.call(button, event);
}
if (!event.defaultPrevented) {
requestToggle({
value,
event
});
}
});
return {
disabled,
open,
expandIconPosition,
components: {
root: 'div',
button: 'button',
expandIcon: 'span',
icon: 'div'
},
root: _reactutilities.slot.always({
ref: ref,
...rest
}, {
elementType: 'div'
}),
icon: _reactutilities.slot.optional(icon, {
elementType: 'div'
}),
expandIcon: _reactutilities.slot.optional(expandIcon, {
renderByDefault: true,
defaultProps: {
'aria-hidden': true
},
elementType: 'span'
}),
button: (0, _reactaria.useARIAButtonProps)(buttonSlot.as, buttonSlot)
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,30 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useAccordionHeaderContextValues_unstable", {
enumerable: true,
get: function() {
return useAccordionHeaderContextValues_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
function useAccordionHeaderContextValues_unstable(state) {
const { disabled, expandIconPosition, open, size } = state;
const accordionHeader = _react.useMemo(()=>({
disabled,
expandIconPosition,
open,
size
}), [
disabled,
expandIconPosition,
open,
size
]);
return {
accordionHeader
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AccordionHeader/useAccordionHeaderContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { AccordionHeaderState, AccordionHeaderContextValues } from './AccordionHeader.types';\nimport type { AccordionHeaderContextValue } from '../../contexts/accordionHeader';\n\nexport function useAccordionHeaderContextValues_unstable(state: AccordionHeaderState): AccordionHeaderContextValues {\n const { disabled, expandIconPosition, open, size } = state;\n\n const accordionHeader = React.useMemo<AccordionHeaderContextValue>(\n () => ({\n disabled,\n expandIconPosition,\n open,\n size,\n }),\n [disabled, expandIconPosition, open, size],\n );\n\n return { accordionHeader };\n}\n"],"names":["React","useAccordionHeaderContextValues_unstable","state","disabled","expandIconPosition","open","size","accordionHeader","useMemo"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;AAIxB,SAASC,yCAAyCC,KAA2B;IAClF,MAAM,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAGJ;IAErD,MAAMK,kBAAkBP,OAAMQ,OAAO,CACnC,IAAO,CAAA;YACLL;YACAC;YACAC;YACAC;SACF,CAAA,EACA;QAACH;QAAUC;QAAoBC;QAAMC;KAAK;IAG5C,OAAO;QAAEC;IAAgB;AAC3B"}

View File

@@ -0,0 +1,372 @@
'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, {
accordionHeaderClassNames: function() {
return accordionHeaderClassNames;
},
useAccordionHeaderStyles_unstable: function() {
return useAccordionHeaderStyles_unstable;
}
});
const _react = require("@griffel/react");
const accordionHeaderClassNames = {
root: 'fui-AccordionHeader',
button: 'fui-AccordionHeader__button',
expandIcon: 'fui-AccordionHeader__expandIcon',
icon: 'fui-AccordionHeader__icon'
};
const useStyles = /*#__PURE__*/ (0, _react.__styles)({
resetButton: {
B7ck84d: "f1e4lqlz",
De3pzq: "f1u2r49w",
sj55zd: "f1ym3bx4",
Bahqtrf: "f1mo0ibp",
Be2twd7: "fjoy568",
Bg96gwp: "fytdu2e",
B68tc82: 0,
Bmxbyg5: 0,
Bpg54ce: "f1gl81tg",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1mk8lai",
Bv0vk6g: "f37px4s",
fsow6f: "fgusgyc"
},
focusIndicator: {
Brovlpu: "ftqa4ok",
B486eqv: "f2hkw1w",
B8q5s1w: "f8hki3x",
Bci5o5g: [
"f1d2448m",
"ffh67wi"
],
n8qw10: "f1bjia2o",
Bdrgwmp: [
"ffh67wi",
"f1d2448m"
],
Bqhya38: "f1j6vpng",
Bwxa6fj: [
"f1pniga2",
"f1ffjurs"
],
Bdhvstf: "f987i1v",
B7zbvrb: [
"f1ffjurs",
"f1pniga2"
],
Bm4h7ae: "f15bsgw9",
B7ys5i9: "f14e48fq",
Busjfv9: "f18yb2kv",
Bhk32uz: "fd6o370",
f6g5ot: 0,
Boxcth7: 0,
Bhdgwq3: 0,
hgwjuy: 0,
Bshpdp8: 0,
Bsom6fd: 0,
Blkhhs4: 0,
Bonggc9: 0,
Ddfuxk: 0,
i03rao: 0,
kclons: 0,
clg4pj: 0,
Bpqj9nj: 0,
B6dhp37: 0,
Bf4ptjt: 0,
Bqtpl0w: 0,
i4rwgc: "ffwy5si",
Dah5zi: 0,
B1tsrr9: 0,
qqdqy8: 0,
Bkh64rk: 0,
e3fwne: "f3znvyf",
J0r882: "f57olzd",
Bule8hv: [
"f4stah7",
"fs1por5"
],
Bjwuhne: "f480a47",
Ghsupd: [
"fs1por5",
"f4stah7"
]
},
root: {
sj55zd: "f19n0e5",
De3pzq: "f1c21dwh",
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: "f1s184ao",
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ft85np5"
},
rootDisabled: {
Bcmaq0h: "fwrgwhw",
sj55zd: "f1s2aq7o"
},
rootInline: {
mc9l5x: "f14t3ns0"
},
button: {
qhf8xq: "f10pi13n",
a9b677: "fly5x3f",
B4j52fo: "fre7gi1",
Bekrc4i: [
"f1358rze",
"f1rvrf73"
],
Bn0qgzm: "fqdk4by",
ibv6hh: [
"f1rvrf73",
"f1358rze"
],
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: [
"f1rmphuq",
"f26yw9j"
],
sshi5w: "f5pgtk9",
mc9l5x: "f22iagw",
Bt984gj: "f122n59",
Bceei9c: "f1k6fduh",
Bahqtrf: "fk6fouc",
Be2twd7: "fkhj508",
Bhrd7zp: "figsok6",
Bg96gwp: "f1i3iumi",
B7ck84d: "f1ewtqcl"
},
buttonSmall: {
sshi5w: "f1nxs5xn",
Be2twd7: "fy9rknc"
},
buttonLarge: {
Bg96gwp: "faaz57k",
Be2twd7: "fod5ikn"
},
buttonExtraLarge: {
Bg96gwp: "f106mvju",
Be2twd7: "f1pp30po"
},
buttonInline: {
mc9l5x: "ftuwxu6"
},
buttonExpandIconEndNoIcon: {
uwmqm3: [
"f1uw59to",
"fw5db7e"
]
},
buttonExpandIconEnd: {
z189sj: [
"f11gcy0p",
"f1ng84yb"
]
},
buttonDisabled: {
Bceei9c: "fdrzuqr"
},
expandIcon: {
Bqenvij: "f1l02sjl",
mc9l5x: "f22iagw",
Bt984gj: "f122n59",
Bg96gwp: "f106mvju",
Be2twd7: "f1pp30po"
},
expandIconStart: {
z189sj: [
"f1vdfbxk",
"f1f5gg8d"
]
},
expandIconEnd: {
Bh6795r: "fqerorx",
Bnnss6s: "f1neuvcm",
xawz: "flqd7gy",
mc9l5x: "f22iagw",
Brf1p80: "f9c4gz4",
uwmqm3: [
"f1f5gg8d",
"f1vdfbxk"
]
},
icon: {
Bqenvij: "f1l02sjl",
mc9l5x: "f22iagw",
Bt984gj: "f122n59",
z189sj: [
"f1vdfbxk",
"f1f5gg8d"
],
Bg96gwp: "f106mvju",
Be2twd7: "f1pp30po"
}
}, {
d: [
".f1e4lqlz{box-sizing:content-box;}",
".f1u2r49w{background-color:inherit;}",
".f1ym3bx4{color:inherit;}",
".f1mo0ibp{font-family:inherit;}",
".fjoy568{font-size:inherit;}",
".fytdu2e{line-height:normal;}",
[
".f1gl81tg{overflow:visible;}",
{
p: -1
}
],
[
".f1mk8lai{padding:0;}",
{
p: -1
}
],
".f37px4s{-webkit-appearance:button;}",
".fgusgyc{text-align:unset;}",
".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}",
".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}",
".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}",
".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}",
".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}",
".f14e48fq[data-fui-focus-visible]::after{position:absolute;}",
".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}",
".fd6o370[data-fui-focus-visible]::after{z-index:1;}",
[
".ffwy5si[data-fui-focus-visible]::after{border:2px solid var(--colorStrokeFocus2);}",
{
p: -2
}
],
[
".f3znvyf[data-fui-focus-visible]::after{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
],
".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}",
".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}",
".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}",
".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}",
".f19n0e5{color:var(--colorNeutralForeground1);}",
".f1c21dwh{background-color:var(--colorTransparentBackground);}",
[
".f1s184ao{margin:0;}",
{
p: -1
}
],
[
".ft85np5{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
],
".fwrgwhw{background-image:none;}",
".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
".f14t3ns0{display:inline-block;}",
".f10pi13n{position:relative;}",
".fly5x3f{width:100%;}",
".fre7gi1{border-top-width:0;}",
".f1358rze{border-right-width:0;}",
".f1rvrf73{border-left-width:0;}",
".fqdk4by{border-bottom-width:0;}",
[
".f1rmphuq{padding:0 var(--spacingHorizontalM) 0 var(--spacingHorizontalMNudge);}",
{
p: -1
}
],
[
".f26yw9j{padding:0 var(--spacingHorizontalMNudge) 0 var(--spacingHorizontalM);}",
{
p: -1
}
],
".f5pgtk9{min-height:44px;}",
".f22iagw{display:flex;}",
".f122n59{align-items:center;}",
".f1k6fduh{cursor:pointer;}",
".fk6fouc{font-family:var(--fontFamilyBase);}",
".fkhj508{font-size:var(--fontSizeBase300);}",
".figsok6{font-weight:var(--fontWeightRegular);}",
".f1i3iumi{line-height:var(--lineHeightBase300);}",
".f1ewtqcl{box-sizing:border-box;}",
".f1nxs5xn{min-height:32px;}",
".fy9rknc{font-size:var(--fontSizeBase200);}",
".faaz57k{line-height:var(--lineHeightBase400);}",
".fod5ikn{font-size:var(--fontSizeBase400);}",
".f106mvju{line-height:var(--lineHeightBase500);}",
".f1pp30po{font-size:var(--fontSizeBase500);}",
".ftuwxu6{display:inline-flex;}",
".f1uw59to{padding-left:var(--spacingHorizontalM);}",
".fw5db7e{padding-right:var(--spacingHorizontalM);}",
".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}",
".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}",
".fdrzuqr{cursor:not-allowed;}",
".f1l02sjl{height:100%;}",
".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
".fqerorx{flex-grow:1;}",
".f1neuvcm{flex-shrink:1;}",
".flqd7gy{flex-basis:0%;}",
".f9c4gz4{justify-content:flex-end;}"
],
f: [
".ftqa4ok:focus{outline-style:none;}"
],
i: [
".f2hkw1w:focus-visible{outline-style:none;}"
],
m: [
[
"@media (forced-colors: active){.f1j6vpng[data-fui-focus-visible]::after{border-top-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f1ffjurs[data-fui-focus-visible]::after{border-left-color:Highlight;}.f1pniga2[data-fui-focus-visible]::after{border-right-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f987i1v[data-fui-focus-visible]::after{border-bottom-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
]
]
});
const useAccordionHeaderStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = (0, _react.mergeClasses)(accordionHeaderClassNames.root, styles.root, state.inline && styles.rootInline, state.disabled && styles.rootDisabled, state.root.className);
state.button.className = (0, _react.mergeClasses)(accordionHeaderClassNames.button, styles.resetButton, styles.button, styles.focusIndicator, state.expandIconPosition === 'end' && !state.icon && styles.buttonExpandIconEndNoIcon, state.expandIconPosition === 'end' && styles.buttonExpandIconEnd, state.inline && styles.buttonInline, state.size === 'small' && styles.buttonSmall, state.size === 'large' && styles.buttonLarge, state.size === 'extra-large' && styles.buttonExtraLarge, state.disabled && styles.buttonDisabled, state.button.className);
if (state.expandIcon) {
state.expandIcon.className = (0, _react.mergeClasses)(accordionHeaderClassNames.expandIcon, styles.expandIcon, state.expandIconPosition === 'start' && styles.expandIconStart, state.expandIconPosition === 'end' && styles.expandIconEnd, state.expandIcon.className);
}
if (state.icon) {
state.icon.className = (0, _react.mergeClasses)(accordionHeaderClassNames.icon, styles.icon, state.icon.className);
}
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,132 @@
'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, {
accordionHeaderClassNames: function() {
return accordionHeaderClassNames;
},
useAccordionHeaderStyles_unstable: function() {
return useAccordionHeaderStyles_unstable;
}
});
const _react = require("@griffel/react");
const _reacttabster = require("@fluentui/react-tabster");
const _reacttheme = require("@fluentui/react-theme");
const accordionHeaderClassNames = {
root: 'fui-AccordionHeader',
button: 'fui-AccordionHeader__button',
expandIcon: 'fui-AccordionHeader__expandIcon',
icon: 'fui-AccordionHeader__icon'
};
const useStyles = (0, _react.makeStyles)({
// TODO: this should be extracted to another package
resetButton: {
boxSizing: 'content-box',
backgroundColor: 'inherit',
color: 'inherit',
fontFamily: 'inherit',
fontSize: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
padding: '0',
WebkitAppearance: 'button',
textAlign: 'unset'
},
focusIndicator: (0, _reacttabster.createFocusOutlineStyle)(),
root: {
color: _reacttheme.tokens.colorNeutralForeground1,
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
margin: '0',
borderRadius: _reacttheme.tokens.borderRadiusMedium
},
rootDisabled: {
backgroundImage: 'none',
color: _reacttheme.tokens.colorNeutralForegroundDisabled
},
rootInline: {
display: 'inline-block'
},
button: {
position: 'relative',
width: '100%',
..._react.shorthands.borderWidth('0'),
padding: `0 ${_reacttheme.tokens.spacingHorizontalM} 0 ${_reacttheme.tokens.spacingHorizontalMNudge}`,
minHeight: '44px',
display: 'flex',
alignItems: 'center',
cursor: 'pointer',
..._reacttheme.typographyStyles.body1,
boxSizing: 'border-box'
},
buttonSmall: {
minHeight: '32px',
fontSize: _reacttheme.tokens.fontSizeBase200
},
buttonLarge: {
lineHeight: _reacttheme.tokens.lineHeightBase400,
fontSize: _reacttheme.tokens.fontSizeBase400
},
buttonExtraLarge: {
lineHeight: _reacttheme.tokens.lineHeightBase500,
fontSize: _reacttheme.tokens.fontSizeBase500
},
buttonInline: {
display: 'inline-flex'
},
buttonExpandIconEndNoIcon: {
paddingLeft: _reacttheme.tokens.spacingHorizontalM
},
buttonExpandIconEnd: {
paddingRight: _reacttheme.tokens.spacingHorizontalMNudge
},
buttonDisabled: {
cursor: 'not-allowed'
},
expandIcon: {
height: '100%',
display: 'flex',
alignItems: 'center',
lineHeight: _reacttheme.tokens.lineHeightBase500,
fontSize: _reacttheme.tokens.fontSizeBase500
},
expandIconStart: {
paddingRight: _reacttheme.tokens.spacingHorizontalS
},
expandIconEnd: {
flexGrow: 1,
flexShrink: 1,
flexBasis: '0%',
display: 'flex',
justifyContent: 'flex-end',
paddingLeft: _reacttheme.tokens.spacingHorizontalS
},
icon: {
height: '100%',
display: 'flex',
alignItems: 'center',
paddingRight: _reacttheme.tokens.spacingHorizontalS,
lineHeight: _reacttheme.tokens.lineHeightBase500,
fontSize: _reacttheme.tokens.fontSizeBase500
}
});
const useAccordionHeaderStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = (0, _react.mergeClasses)(accordionHeaderClassNames.root, styles.root, state.inline && styles.rootInline, state.disabled && styles.rootDisabled, state.root.className);
state.button.className = (0, _react.mergeClasses)(accordionHeaderClassNames.button, styles.resetButton, styles.button, styles.focusIndicator, state.expandIconPosition === 'end' && !state.icon && styles.buttonExpandIconEndNoIcon, state.expandIconPosition === 'end' && styles.buttonExpandIconEnd, state.inline && styles.buttonInline, state.size === 'small' && styles.buttonSmall, state.size === 'large' && styles.buttonLarge, state.size === 'extra-large' && styles.buttonExtraLarge, state.disabled && styles.buttonDisabled, state.button.className);
if (state.expandIcon) {
state.expandIcon.className = (0, _react.mergeClasses)(accordionHeaderClassNames.expandIcon, styles.expandIcon, state.expandIconPosition === 'start' && styles.expandIconStart, state.expandIconPosition === 'end' && styles.expandIconEnd, state.expandIcon.className);
}
if (state.icon) {
state.icon.className = (0, _react.mergeClasses)(accordionHeaderClassNames.icon, styles.icon, state.icon.className);
}
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,26 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AccordionItem", {
enumerable: true,
get: function() {
return AccordionItem;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useAccordionItem = require("./useAccordionItem");
const _useAccordionItemContextValues = require("./useAccordionItemContextValues");
const _renderAccordionItem = require("./renderAccordionItem");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _useAccordionItemStylesstyles = require("./useAccordionItemStyles.styles");
const AccordionItem = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useAccordionItem.useAccordionItem_unstable)(props, ref);
const contextValues = (0, _useAccordionItemContextValues.useAccordionItemContextValues_unstable)(state);
(0, _useAccordionItemStylesstyles.useAccordionItemStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useAccordionItemStyles_unstable')(state);
return (0, _renderAccordionItem.renderAccordionItem_unstable)(state, contextValues);
});
AccordionItem.displayName = 'AccordionItem';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AccordionItem/AccordionItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useAccordionItem_unstable } from './useAccordionItem';\nimport { useAccordionItemContextValues_unstable } from './useAccordionItemContextValues';\nimport { renderAccordionItem_unstable } from './renderAccordionItem';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useAccordionItemStyles_unstable } from './useAccordionItemStyles.styles';\nimport type { AccordionItemProps } from './AccordionItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled AccordionItem, using the `useAccordionItem_unstable` and `useAccordionItemStyles_unstable` hooks.\n */\nexport const AccordionItem: ForwardRefComponent<AccordionItemProps> = React.forwardRef((props, ref) => {\n const state = useAccordionItem_unstable(props, ref);\n const contextValues = useAccordionItemContextValues_unstable(state);\n\n useAccordionItemStyles_unstable(state);\n\n useCustomStyleHook_unstable('useAccordionItemStyles_unstable')(state);\n\n return renderAccordionItem_unstable(state, contextValues);\n});\n\nAccordionItem.displayName = 'AccordionItem';\n"],"names":["React","useAccordionItem_unstable","useAccordionItemContextValues_unstable","renderAccordionItem_unstable","useCustomStyleHook_unstable","useAccordionItemStyles_unstable","AccordionItem","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;kCACW,qBAAqB;+CACR,kCAAkC;qCAC5C,wBAAwB;qCACzB,kCAAkC;8CAC9B,kCAAkC;AAO3E,MAAMM,gBAAAA,WAAAA,GAAyDN,OAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,YAAQT,2CAAAA,EAA0BO,OAAOC;IAC/C,MAAME,oBAAgBT,qEAAAA,EAAuCQ;QAE7DL,6DAAAA,EAAgCK;QAEhCN,gDAAAA,EAA4B,mCAAmCM;IAE/D,WAAOP,iDAAAA,EAA6BO,OAAOC;AAC7C,GAAG;AAEHL,cAAcM,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/AccordionItem/AccordionItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { AccordionItemContextValue } from '../../contexts/accordionItem';\n\nexport type AccordionItemContextValues<Value = AccordionItemValue> = {\n accordionItem: AccordionItemContextValue<Value>;\n};\n\nexport type AccordionItemSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type AccordionItemProps<Value = AccordionItemValue> = ComponentProps<AccordionItemSlots> & {\n /**\n * Disables opening/closing of panel.\n */\n disabled?: boolean;\n /**\n * Required value that identifies this item inside an Accordion component.\n */\n value: Value;\n};\n\nexport type AccordionItemValue = unknown;\n\nexport type AccordionItemState<Value = AccordionItemValue> = ComponentState<AccordionItemSlots> &\n AccordionItemContextValue<Value>;\n"],"names":[],"mappings":""}

View File

@@ -0,0 +1,35 @@
"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, {
AccordionItem: function() {
return _AccordionItem.AccordionItem;
},
accordionItemClassNames: function() {
return _useAccordionItemStylesstyles.accordionItemClassNames;
},
renderAccordionItem_unstable: function() {
return _renderAccordionItem.renderAccordionItem_unstable;
},
useAccordionItemContextValues_unstable: function() {
return _useAccordionItemContextValues.useAccordionItemContextValues_unstable;
},
useAccordionItemStyles_unstable: function() {
return _useAccordionItemStylesstyles.useAccordionItemStyles_unstable;
},
useAccordionItem_unstable: function() {
return _useAccordionItem.useAccordionItem_unstable;
}
});
const _AccordionItem = require("./AccordionItem");
const _renderAccordionItem = require("./renderAccordionItem");
const _useAccordionItem = require("./useAccordionItem");
const _useAccordionItemContextValues = require("./useAccordionItemContextValues");
const _useAccordionItemStylesstyles = require("./useAccordionItemStyles.styles");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AccordionItem/index.ts"],"sourcesContent":["export { AccordionItem } from './AccordionItem';\nexport type {\n AccordionItemContextValues,\n AccordionItemProps,\n AccordionItemSlots,\n AccordionItemState,\n AccordionItemValue,\n} from './AccordionItem.types';\nexport { renderAccordionItem_unstable } from './renderAccordionItem';\nexport { useAccordionItem_unstable } from './useAccordionItem';\nexport { useAccordionItemContextValues_unstable } from './useAccordionItemContextValues';\nexport { accordionItemClassNames, useAccordionItemStyles_unstable } from './useAccordionItemStyles.styles';\n"],"names":["AccordionItem","renderAccordionItem_unstable","useAccordionItem_unstable","useAccordionItemContextValues_unstable","accordionItemClassNames","useAccordionItemStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,4BAAa;;;eAWbI,qDAAuB;;;eAHvBH,iDAA4B;;;eAE5BE,qEAAsC;;;eACbE,6DAA+B;;;eAFxDH,2CAAyB;;;+BATJ,kBAAkB;qCAQH,wBAAwB;kCAC3B,qBAAqB;+CACR,kCAAkC;8CAChB,kCAAkC"}

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