@primer/react 38.28.0 → 38.29.0-rc.0d60f51e2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -1
- package/dist/ActionList/ActionList-65f7daac.css +2 -0
- package/dist/ActionList/ActionList-65f7daac.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +2 -2
- package/dist/ActionList/Group.d.ts +0 -5
- package/dist/ActionList/Group.d.ts.map +1 -1
- package/dist/ActionList/Group.js +2 -5
- package/dist/ActionList/GroupContext.d.ts +8 -0
- package/dist/ActionList/GroupContext.d.ts.map +1 -0
- package/dist/ActionList/GroupContext.js +8 -0
- package/dist/ActionList/Item.js +3 -2
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +21 -16
- package/dist/ActionList/Selection.js +1 -1
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/ActionList/index.js +2 -1
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +6 -2
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +3 -1
- package/dist/Autocomplete/AutocompleteInput.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +2 -1
- package/dist/Autocomplete/AutocompleteMenu.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteMenu.js +1 -0
- package/dist/Autocomplete/AutocompleteOverlay.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteOverlay.js +1 -0
- package/dist/Button/IconButton.d.ts.map +1 -1
- package/dist/Button/IconButton.js +3 -2
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts +0 -9
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.js +1 -42
- package/dist/ConfirmationDialog/useConfirm.d.ts +12 -0
- package/dist/ConfirmationDialog/useConfirm.d.ts.map +1 -0
- package/dist/ConfirmationDialog/useConfirm.js +44 -0
- package/dist/Dialog/Dialog.d.ts +0 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +2 -4
- package/dist/Dialog/DialogContext.d.ts +3 -0
- package/dist/Dialog/DialogContext.d.ts.map +1 -0
- package/dist/Dialog/DialogContext.js +5 -0
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -0
- package/dist/FilteredActionList/FilteredActionList.js +2 -1
- package/dist/FilteredActionList/FilteredActionListLoaders.d.ts +2 -10
- package/dist/FilteredActionList/FilteredActionListLoaders.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionListLoaders.js +3 -12
- package/dist/FilteredActionList/constants.d.ts +11 -0
- package/dist/FilteredActionList/constants.d.ts.map +1 -0
- package/dist/FilteredActionList/constants.js +13 -0
- package/dist/FilteredActionList/index.js +0 -1
- package/dist/KeybindingHint/KeybindingHint.d.ts +0 -14
- package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
- package/dist/KeybindingHint/KeybindingHint.js +2 -16
- package/dist/KeybindingHint/components/Chord.d.ts +0 -3
- package/dist/KeybindingHint/components/Chord.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Chord.js +2 -21
- package/dist/KeybindingHint/components/Sequence.d.ts +0 -3
- package/dist/KeybindingHint/components/Sequence.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Sequence.js +2 -5
- package/dist/KeybindingHint/components/utils.d.ts +8 -0
- package/dist/KeybindingHint/components/utils.d.ts.map +1 -0
- package/dist/KeybindingHint/components/utils.js +32 -0
- package/dist/KeybindingHint/index.d.ts +2 -1
- package/dist/KeybindingHint/index.d.ts.map +1 -1
- package/dist/KeybindingHint/utils.d.ts +15 -0
- package/dist/KeybindingHint/utils.d.ts.map +1 -0
- package/dist/KeybindingHint/utils.js +17 -0
- package/dist/NavList/NavList.d.ts.map +1 -1
- package/dist/NavList/NavList.js +4 -0
- package/dist/Overlay/Overlay.d.ts +2 -18
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +1 -20
- package/dist/Overlay/constants.d.ts +19 -0
- package/dist/Overlay/constants.d.ts.map +1 -0
- package/dist/Overlay/constants.js +20 -0
- package/dist/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/PageHeader/PageHeader.js +63 -35
- package/dist/Portal/Portal.d.ts +0 -14
- package/dist/Portal/Portal.d.ts.map +1 -1
- package/dist/Portal/Portal.js +4 -46
- package/dist/Portal/PortalContext.d.ts +5 -0
- package/dist/Portal/PortalContext.d.ts.map +1 -0
- package/dist/Portal/PortalContext.js +5 -0
- package/dist/Portal/index.d.ts +3 -1
- package/dist/Portal/index.d.ts.map +1 -1
- package/dist/Portal/index.js +0 -1
- package/dist/Portal/portalRoot.d.ts +11 -0
- package/dist/Portal/portalRoot.d.ts.map +1 -0
- package/dist/Portal/portalRoot.js +39 -0
- package/dist/Radio/Radio.js +1 -1
- package/dist/RadioGroup/RadioGroup.d.ts +1 -6
- package/dist/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup/RadioGroup.js +2 -3
- package/dist/RadioGroup/RadioGroupContext.d.ts +7 -0
- package/dist/RadioGroup/RadioGroupContext.d.ts.map +1 -0
- package/dist/RadioGroup/RadioGroupContext.js +5 -0
- package/dist/RadioGroup/index.d.ts +2 -1
- package/dist/RadioGroup/index.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +2 -1
- package/dist/TextInput/TextInput.d.ts +6 -0
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +2 -1
- package/dist/ThemeContext.d.ts +15 -0
- package/dist/ThemeContext.d.ts.map +1 -0
- package/dist/ThemeContext.js +9 -0
- package/dist/ThemeProvider.d.ts +1 -14
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/ThemeProvider.js +3 -18
- package/dist/Timeline/Timeline.d.ts +1 -1
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Timeline/constants.d.ts +2 -0
- package/dist/Timeline/constants.d.ts.map +1 -0
- package/dist/Token/IssueLabelToken.d.ts.map +1 -1
- package/dist/Token/IssueLabelToken.js +3 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +3 -1
- package/dist/Token/TokenBase.d.ts +2 -5
- package/dist/Token/TokenBase.d.ts.map +1 -1
- package/dist/Token/TokenBase.js +3 -14
- package/dist/Token/_RemoveTokenButton.js +1 -1
- package/dist/Token/constants.d.ts +4 -0
- package/dist/Token/constants.d.ts.map +1 -0
- package/dist/Token/constants.js +3 -0
- package/dist/Token/utils.d.ts +3 -0
- package/dist/Token/utils.d.ts.map +1 -0
- package/dist/Token/utils.js +14 -0
- package/dist/Tooltip/Tooltip.d.ts +0 -3
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +2 -3
- package/dist/Tooltip/TooltipContext.d.ts +5 -0
- package/dist/Tooltip/TooltipContext.d.ts.map +1 -0
- package/dist/Tooltip/TooltipContext.js +5 -0
- package/dist/TooltipV2/Tooltip.d.ts +0 -3
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +4 -3
- package/dist/TooltipV2/TooltipContext.d.ts +5 -0
- package/dist/TooltipV2/TooltipContext.d.ts.map +1 -0
- package/dist/TooltipV2/TooltipContext.js +5 -0
- package/dist/TreeView/TreeView.js +1 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts +0 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +2 -5
- package/dist/UnderlineNav/utils.d.ts +3 -0
- package/dist/UnderlineNav/utils.d.ts.map +1 -0
- package/dist/UnderlineNav/utils.js +8 -0
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +2 -1
- package/dist/experimental/SelectPanel2/index.d.ts +2 -1
- package/dist/experimental/SelectPanel2/index.d.ts.map +1 -1
- package/dist/experimental/Tabs/Tabs.d.ts +3 -111
- package/dist/experimental/Tabs/Tabs.d.ts.map +1 -1
- package/dist/experimental/Tabs/Tabs.js +3 -237
- package/dist/experimental/Tabs/TabsContext.d.ts +3 -0
- package/dist/experimental/Tabs/TabsContext.d.ts.map +1 -0
- package/dist/experimental/Tabs/TabsContext.js +5 -0
- package/dist/experimental/Tabs/index.d.ts +5 -2
- package/dist/experimental/Tabs/index.d.ts.map +1 -1
- package/dist/experimental/Tabs/types.d.ts +107 -0
- package/dist/experimental/Tabs/types.d.ts.map +1 -0
- package/dist/experimental/Tabs/useTab.d.ts +7 -0
- package/dist/experimental/Tabs/useTab.d.ts.map +1 -0
- package/dist/experimental/Tabs/useTab.js +97 -0
- package/dist/experimental/Tabs/useTabList.d.ts +3 -0
- package/dist/experimental/Tabs/useTabList.d.ts.map +1 -0
- package/dist/experimental/Tabs/useTabList.js +100 -0
- package/dist/experimental/Tabs/useTabPanel.d.ts +4 -0
- package/dist/experimental/Tabs/useTabPanel.d.ts.map +1 -0
- package/dist/experimental/Tabs/useTabPanel.js +37 -0
- package/dist/experimental/Tabs/useTabs.d.ts +3 -0
- package/dist/experimental/Tabs/useTabs.d.ts.map +1 -0
- package/dist/experimental/Tabs/useTabs.js +12 -0
- package/dist/experimental/index.js +7 -3
- package/dist/hooks/MatchMedia.d.ts +23 -0
- package/dist/hooks/MatchMedia.d.ts.map +1 -0
- package/dist/hooks/MatchMediaContext.d.ts +5 -0
- package/dist/hooks/MatchMediaContext.d.ts.map +1 -0
- package/dist/hooks/MatchMediaContext.js +8 -0
- package/dist/hooks/useMedia.d.ts +1 -24
- package/dist/hooks/useMedia.d.ts.map +1 -1
- package/dist/hooks/useMedia.js +15 -6
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/useTheme.d.ts +15 -0
- package/dist/useTheme.d.ts.map +1 -0
- package/dist/useTheme.js +16 -0
- package/dist/utils/story-helpers.d.ts +70 -0
- package/dist/utils/story-helpers.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/ActionList/ActionList-1940009e.css +0 -2
- package/dist/ActionList/ActionList-1940009e.css.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ConfirmationDialogProps } from './ConfirmationDialog';
|
|
3
|
+
export type ConfirmOptions = Omit<ConfirmationDialogProps, 'onClose'> & {
|
|
4
|
+
content: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* This hook takes no parameters and returns an `async` function, `confirm`. When `confirm`
|
|
8
|
+
* is called, it shows the confirmation dialog. When the dialog is dismissed, a promise is
|
|
9
|
+
* resolved with `true` or `false` depending on whether or not the confirm button was used.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useConfirm(): (options: ConfirmOptions) => Promise<boolean>;
|
|
12
|
+
//# sourceMappingURL=useConfirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfirm.d.ts","sourceRoot":"","sources":["../../src/ConfirmationDialog/useConfirm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAqB,KAAK,uBAAuB,EAAC,MAAM,sBAAsB,CAAA;AAIrF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,CAAA;AA0BlG;;;;GAIG;AACH,wBAAgB,UAAU,cACa,cAAc,sBAIpD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import BaseStyles from '../BaseStyles.js';
|
|
4
|
+
import { ConfirmationDialog } from './ConfirmationDialog.js';
|
|
5
|
+
|
|
6
|
+
let hostElement = null;
|
|
7
|
+
async function confirm(options) {
|
|
8
|
+
const {
|
|
9
|
+
content,
|
|
10
|
+
...confirmationDialogProps
|
|
11
|
+
} = options;
|
|
12
|
+
return new Promise(resolve => {
|
|
13
|
+
hostElement ||= document.createElement('div');
|
|
14
|
+
if (!hostElement.isConnected) document.body.append(hostElement);
|
|
15
|
+
const root = createRoot(hostElement);
|
|
16
|
+
const onClose = gesture => {
|
|
17
|
+
root.unmount();
|
|
18
|
+
if (gesture === 'confirm') {
|
|
19
|
+
resolve(true);
|
|
20
|
+
} else {
|
|
21
|
+
resolve(false);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
root.render(/*#__PURE__*/React.createElement(BaseStyles, null, /*#__PURE__*/React.createElement(ConfirmationDialog, {
|
|
25
|
+
...confirmationDialogProps,
|
|
26
|
+
onClose
|
|
27
|
+
}, content)));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* This hook takes no parameters and returns an `async` function, `confirm`. When `confirm`
|
|
33
|
+
* is called, it shows the confirmation dialog. When the dialog is dismissed, a promise is
|
|
34
|
+
* resolved with `true` or `false` depending on whether or not the confirm button was used.
|
|
35
|
+
*/
|
|
36
|
+
function useConfirm() {
|
|
37
|
+
const result = _temp;
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
function _temp(options) {
|
|
41
|
+
return confirm(options);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { useConfirm };
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -156,7 +156,6 @@ declare const widthMap: {
|
|
|
156
156
|
};
|
|
157
157
|
export type DialogWidth = keyof typeof widthMap | Exclude<CSSProperties['width'], undefined>;
|
|
158
158
|
export type DialogHeight = keyof typeof heightMap;
|
|
159
|
-
export declare const DialogContext: React.Context<object | undefined>;
|
|
160
159
|
export declare const Dialog: React.ForwardRefExoticComponent<DialogProps & {
|
|
161
160
|
children?: React.ReactNode | undefined;
|
|
162
161
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2C,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAA;AAC9G,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAU1C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2C,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAA;AAC9G,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAU1C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAiB/F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAC7D;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAExD;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,CAAC,E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C,CAAA;IAErD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAA;CAC5B;AAGD,QAAA,MAAM,SAAS;;;;CAIL,CAAA;AAEV,QAAA,MAAM,QAAQ;;;;;CAKJ,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAA;AAC5F,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,SAAS,CAAA;AAqWjD,eAAO,MAAM,MAAM;;;;;;;;;iBA9EuC,iBAAiB,EAAE;;;iBAoCf,MAAM,IAAI;oBAAc,KAAK,CAAC,oBAAoB;;CAkD9G,CAAA"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -11,6 +11,7 @@ import classes from './Dialog.module.css.js';
|
|
|
11
11
|
import { clsx } from 'clsx';
|
|
12
12
|
import { useSlots } from '../hooks/useSlots.js';
|
|
13
13
|
import { useResizeObserver } from '../hooks/useResizeObserver.js';
|
|
14
|
+
import { DialogContext } from './DialogContext.js';
|
|
14
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
16
|
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
16
17
|
import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
|
|
@@ -98,9 +99,6 @@ const defaultPosition = {
|
|
|
98
99
|
const defaultFooterButtons = [];
|
|
99
100
|
// Minimum room needed for body content before forcing footer buttons into horizontal scroll.
|
|
100
101
|
const MIN_BODY_HEIGHT = 48;
|
|
101
|
-
|
|
102
|
-
// useful to determine whether we're inside a Dialog from a nested component
|
|
103
|
-
const DialogContext = /*#__PURE__*/React.createContext(undefined);
|
|
104
102
|
const DIALOG_CONTEXT_VALUE = Object.freeze({});
|
|
105
103
|
const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
106
104
|
var _slots$header, _slots$body, _slots$footer;
|
|
@@ -408,4 +406,4 @@ const Dialog = Object.assign(_Dialog, {
|
|
|
408
406
|
CloseButton
|
|
409
407
|
});
|
|
410
408
|
|
|
411
|
-
export { Dialog
|
|
409
|
+
export { Dialog };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogContext.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,aAAa,mCAAqD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,kBAS9B,CAAA"}
|
|
@@ -6,6 +6,7 @@ const DefaultFeatureFlags = FeatureFlagScope.create({
|
|
|
6
6
|
primer_react_select_panel_order_selected_at_top: false,
|
|
7
7
|
primer_react_styled_react_use_primer_theme_providers: false,
|
|
8
8
|
primer_react_action_list_group_heading_trailing_action: false,
|
|
9
|
+
primer_react_action_list_item_gap: false,
|
|
9
10
|
primer_react_timeline_list_semantics: false,
|
|
10
11
|
primer_react_theme_provider_remove_ssr_handoff: false
|
|
11
12
|
});
|
|
@@ -7,7 +7,7 @@ import { useId } from '../hooks/useId.js';
|
|
|
7
7
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
8
8
|
import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
|
|
9
9
|
import useScrollFlash from '../hooks/useScrollFlash.js';
|
|
10
|
-
import {
|
|
10
|
+
import { FilteredActionListBodyLoader } from './FilteredActionListLoaders.js';
|
|
11
11
|
import classes from './FilteredActionList.module.css.js';
|
|
12
12
|
import { ActionListContainerContext } from '../ActionList/ActionListContainerContext.js';
|
|
13
13
|
import { isValidElementType } from 'react-is';
|
|
@@ -16,6 +16,7 @@ import { clsx } from 'clsx';
|
|
|
16
16
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
17
17
|
import { FilteredActionListInput } from './FilteredActionListInput.js';
|
|
18
18
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
19
|
+
import { FilteredActionListLoadingTypes } from './constants.js';
|
|
19
20
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
|
|
20
21
|
import Checkbox from '../Checkbox/Checkbox.js';
|
|
21
22
|
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
+
import { FilteredActionListLoadingType, FilteredActionListLoadingTypes } from './constants';
|
|
1
2
|
import type { JSX } from 'react';
|
|
2
|
-
export
|
|
3
|
-
name: string;
|
|
4
|
-
appearsInBody: boolean;
|
|
5
|
-
constructor(name: string, appearsInBody: boolean);
|
|
6
|
-
}
|
|
7
|
-
export declare const FilteredActionListLoadingTypes: {
|
|
8
|
-
bodySpinner: FilteredActionListLoadingType;
|
|
9
|
-
bodySkeleton: FilteredActionListLoadingType;
|
|
10
|
-
input: FilteredActionListLoadingType;
|
|
11
|
-
};
|
|
3
|
+
export { FilteredActionListLoadingType, FilteredActionListLoadingTypes };
|
|
12
4
|
export declare function FilteredActionListBodyLoader({ loadingType, height, }: {
|
|
13
5
|
loadingType: FilteredActionListLoadingType;
|
|
14
6
|
height: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilteredActionListLoaders.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/FilteredActionListLoaders.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilteredActionListLoaders.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/FilteredActionListLoaders.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,6BAA6B,EAAE,8BAA8B,EAAC,MAAM,aAAa,CAAA;AAEzF,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAC,6BAA6B,EAAE,8BAA8B,EAAC,CAAA;AAKtE,wBAAgB,4BAA4B,CAAC,EAC3C,WAAW,EACX,MAAM,GACP,EAAE;IACD,WAAW,EAAE,6BAA6B,CAAA;IAC1C,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,GAAG,CAAC,OAAO,CAWd"}
|
|
@@ -2,20 +2,11 @@ import { c } from 'react-compiler-runtime';
|
|
|
2
2
|
import { Stack } from '../Stack/Stack.js';
|
|
3
3
|
import { SkeletonBox } from '../Skeleton/SkeletonBox.js';
|
|
4
4
|
import classes from './FilteredActionListLoaders.module.css.js';
|
|
5
|
+
import { FilteredActionListLoadingTypes } from './constants.js';
|
|
6
|
+
export { FilteredActionListLoadingType } from './constants.js';
|
|
5
7
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
6
8
|
import Spinner from '../Spinner/Spinner.js';
|
|
7
9
|
|
|
8
|
-
class FilteredActionListLoadingType {
|
|
9
|
-
constructor(name, appearsInBody) {
|
|
10
|
-
this.name = name;
|
|
11
|
-
this.appearsInBody = appearsInBody;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const FilteredActionListLoadingTypes = {
|
|
15
|
-
bodySpinner: new FilteredActionListLoadingType('body-spinner', true),
|
|
16
|
-
bodySkeleton: new FilteredActionListLoadingType('body-skeleton', true),
|
|
17
|
-
input: new FilteredActionListLoadingType('input', false)
|
|
18
|
-
};
|
|
19
10
|
const SKELETON_ROW_HEIGHT = 24;
|
|
20
11
|
const SKELETON_MIN_ROWS = 3;
|
|
21
12
|
function FilteredActionListBodyLoader(t0) {
|
|
@@ -160,4 +151,4 @@ function _temp(_, i) {
|
|
|
160
151
|
}
|
|
161
152
|
_temp.displayName = "_temp";
|
|
162
153
|
|
|
163
|
-
export { FilteredActionListBodyLoader,
|
|
154
|
+
export { FilteredActionListBodyLoader, FilteredActionListLoadingTypes };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class FilteredActionListLoadingType {
|
|
2
|
+
name: string;
|
|
3
|
+
appearsInBody: boolean;
|
|
4
|
+
constructor(name: string, appearsInBody: boolean);
|
|
5
|
+
}
|
|
6
|
+
export declare const FilteredActionListLoadingTypes: {
|
|
7
|
+
bodySpinner: FilteredActionListLoadingType;
|
|
8
|
+
bodySkeleton: FilteredActionListLoadingType;
|
|
9
|
+
input: FilteredActionListLoadingType;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/constants.ts"],"names":[],"mappings":"AAAA,qBAAa,6BAA6B;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,OAAO,CAAA;gBAEjB,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO;CAIjD;AAED,eAAO,MAAM,8BAA8B;;;;CAI1C,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class FilteredActionListLoadingType {
|
|
2
|
+
constructor(name, appearsInBody) {
|
|
3
|
+
this.name = name;
|
|
4
|
+
this.appearsInBody = appearsInBody;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
const FilteredActionListLoadingTypes = {
|
|
8
|
+
bodySpinner: new FilteredActionListLoadingType('body-spinner', true),
|
|
9
|
+
bodySkeleton: new FilteredActionListLoadingType('body-skeleton', true),
|
|
10
|
+
input: new FilteredActionListLoadingType('input', false)
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { FilteredActionListLoadingType, FilteredActionListLoadingTypes };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FilteredActionList as FilteredActionList$1 } from './FilteredActionList.js';
|
|
2
2
|
import { FilteredActionListInput } from './FilteredActionListInput.js';
|
|
3
3
|
import { FilteredActionListBodyLoader } from './FilteredActionListLoaders.js';
|
|
4
|
-
export { FilteredActionListLoadingTypes } from './FilteredActionListLoaders.js';
|
|
5
4
|
|
|
6
5
|
const FilteredActionList = Object.assign(FilteredActionList$1, {
|
|
7
6
|
BodyLoader: FilteredActionListBodyLoader,
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
import type { KeybindingHintProps } from './props';
|
|
2
|
-
import type { Platform } from './platform';
|
|
3
2
|
/** Indicates the presence of an available keybinding. */
|
|
4
3
|
export declare const KeybindingHint: import("react").MemoExoticComponent<({ className, ...props }: KeybindingHintProps) => import("react").JSX.Element>;
|
|
5
|
-
/**
|
|
6
|
-
* AVOID: `KeybindingHint` is nearly always sufficient for providing both visible and accessible keyboard hints.
|
|
7
|
-
* However, there may be cases where we need a plain string version, such as when building `aria-label` or
|
|
8
|
-
* `aria-description`. In that case, this plain string builder can be used instead.
|
|
9
|
-
*
|
|
10
|
-
* NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
|
|
11
|
-
* visibly) and should nearly always also be paired with a visible hint for sighted users.
|
|
12
|
-
*
|
|
13
|
-
* The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
|
|
14
|
-
* backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` as
|
|
15
|
-
* `'other'`.
|
|
16
|
-
*/
|
|
17
|
-
export declare const getAccessibleKeybindingHintString: (sequence: string, platform: Platform | boolean) => string;
|
|
18
4
|
//# sourceMappingURL=KeybindingHint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeybindingHint.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/KeybindingHint.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"KeybindingHint.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/KeybindingHint.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAA;AAoBhD,yDAAyD;AAEzD,eAAO,MAAM,cAAc,gEAAgC,mBAAmB,iCAI5E,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
-
import { Sequence
|
|
3
|
+
import { Sequence } from './components/Sequence.js';
|
|
4
4
|
import classes from './KeybindingHint.module.css.js';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -82,18 +82,4 @@ const KeybindingHint = /*#__PURE__*/memo(t0 => {
|
|
|
82
82
|
});
|
|
83
83
|
KeybindingHint.displayName = 'KeybindingHint';
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
* AVOID: `KeybindingHint` is nearly always sufficient for providing both visible and accessible keyboard hints.
|
|
87
|
-
* However, there may be cases where we need a plain string version, such as when building `aria-label` or
|
|
88
|
-
* `aria-description`. In that case, this plain string builder can be used instead.
|
|
89
|
-
*
|
|
90
|
-
* NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
|
|
91
|
-
* visibly) and should nearly always also be paired with a visible hint for sighted users.
|
|
92
|
-
*
|
|
93
|
-
* The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
|
|
94
|
-
* backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` as
|
|
95
|
-
* `'other'`.
|
|
96
|
-
*/
|
|
97
|
-
const getAccessibleKeybindingHintString = (sequence, platform) => accessibleSequenceString(sequence, typeof platform === 'boolean' ? platform ? 'apple' : 'other' : platform);
|
|
98
|
-
|
|
99
|
-
export { KeybindingHint, getAccessibleKeybindingHintString };
|
|
85
|
+
export { KeybindingHint };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { KeybindingHintProps } from '../props';
|
|
2
|
-
import type { Platform } from '../platform';
|
|
3
2
|
export declare const Chord: ({ keys, format, variant, size }: KeybindingHintProps) => import("react").JSX.Element;
|
|
4
|
-
/** Plain string version of `Chord` for use in `aria` string attributes. */
|
|
5
|
-
export declare const accessibleChordString: (chord: string, platform: Platform) => string;
|
|
6
3
|
//# sourceMappingURL=Chord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chord.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/Chord.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"Chord.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/Chord.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AAMjD,eAAO,MAAM,KAAK,GAAI,iCAAmE,mBAAmB,gCAsB3G,CAAA"}
|
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
3
|
import { Key } from './Key.js';
|
|
4
|
-
import { accessibleKeyName } from '../key-names.js';
|
|
5
4
|
import { clsx } from 'clsx';
|
|
6
5
|
import classes from './Chord.module.css.js';
|
|
6
|
+
import { splitChord } from './utils.js';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
import Text from '../../Text/Text.js';
|
|
9
9
|
|
|
10
|
-
const keySortPriorities = {
|
|
11
|
-
control: 1,
|
|
12
|
-
meta: 2,
|
|
13
|
-
alt: 3,
|
|
14
|
-
option: 4,
|
|
15
|
-
shift: 5,
|
|
16
|
-
function: 6
|
|
17
|
-
};
|
|
18
|
-
const keySortPriority = priority => {
|
|
19
|
-
var _keySortPriorities$pr;
|
|
20
|
-
return (_keySortPriorities$pr = keySortPriorities[priority]) !== null && _keySortPriorities$pr !== void 0 ? _keySortPriorities$pr : Infinity;
|
|
21
|
-
};
|
|
22
|
-
const compareLowercaseKeys = (a, b) => keySortPriority(a) - keySortPriority(b);
|
|
23
|
-
|
|
24
|
-
/** Split and sort the chord keys in standard order. */
|
|
25
|
-
const splitChord = chord => chord.split('+').map(k => k.toLowerCase()).sort(compareLowercaseKeys);
|
|
26
10
|
const Chord = t0 => {
|
|
27
11
|
const $ = c(13);
|
|
28
12
|
const {
|
|
@@ -95,7 +79,4 @@ const Chord = t0 => {
|
|
|
95
79
|
return t10;
|
|
96
80
|
};
|
|
97
81
|
|
|
98
|
-
|
|
99
|
-
const accessibleChordString = (chord, platform) => splitChord(chord).map(key => accessibleKeyName(key, platform)).join(' ');
|
|
100
|
-
|
|
101
|
-
export { Chord, accessibleChordString };
|
|
82
|
+
export { Chord };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { KeybindingHintProps } from '../props';
|
|
2
|
-
import type { Platform } from '../platform';
|
|
3
2
|
export declare const Sequence: ({ keys, ...chordProps }: KeybindingHintProps) => import("react").JSX.Element[];
|
|
4
|
-
/** Plain string version of `Sequence` for use in `aria` string attributes. */
|
|
5
|
-
export declare const accessibleSequenceString: (sequence: string, platform: Platform) => string;
|
|
6
3
|
//# sourceMappingURL=Sequence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sequence.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/Sequence.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"Sequence.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/Sequence.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AAMjD,eAAO,MAAM,QAAQ,GAAI,yBAAuB,mBAAmB,kCAa/D,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import VisuallyHidden from '../../_VisuallyHidden.js';
|
|
3
|
-
import { Chord
|
|
3
|
+
import { Chord } from './Chord.js';
|
|
4
4
|
import { jsxs, Fragment as Fragment$1, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
const splitSequence = sequence => sequence.split(' ');
|
|
@@ -20,7 +20,4 @@ const Sequence = ({
|
|
|
20
20
|
})]
|
|
21
21
|
}, i));
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const accessibleSequenceString = (sequence, platform) => splitSequence(sequence).map(chord => accessibleChordString(chord, platform)).join(' then ');
|
|
25
|
-
|
|
26
|
-
export { Sequence, accessibleSequenceString };
|
|
23
|
+
export { Sequence };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Platform } from '../platform';
|
|
2
|
+
/** Split and sort the chord keys in standard order. */
|
|
3
|
+
export declare const splitChord: (chord: string) => string[];
|
|
4
|
+
/** Plain string version of `Chord` for use in `aria` string attributes. */
|
|
5
|
+
export declare const accessibleChordString: (chord: string, platform: Platform) => string;
|
|
6
|
+
/** Plain string version of `Sequence` for use in `aria` string attributes. */
|
|
7
|
+
export declare const accessibleSequenceString: (sequence: string, platform: Platform) => string;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAoBzC,uDAAuD;AACvD,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,aAIT,CAAA;AAI/B,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,UAAU,QAAQ,WAGzD,CAAA;AAEd,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,WAG1D,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { accessibleKeyName } from '../key-names.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Consistent sort order for modifier keys. There should never be more than one non-modifier
|
|
5
|
+
* key in a chord, so we don't need to worry about sorting those - we just put them at
|
|
6
|
+
* the end.
|
|
7
|
+
*/
|
|
8
|
+
const keySortPriorities = {
|
|
9
|
+
control: 1,
|
|
10
|
+
meta: 2,
|
|
11
|
+
alt: 3,
|
|
12
|
+
option: 4,
|
|
13
|
+
shift: 5,
|
|
14
|
+
function: 6
|
|
15
|
+
};
|
|
16
|
+
const keySortPriority = priority => {
|
|
17
|
+
var _keySortPriorities$pr;
|
|
18
|
+
return (_keySortPriorities$pr = keySortPriorities[priority]) !== null && _keySortPriorities$pr !== void 0 ? _keySortPriorities$pr : Infinity;
|
|
19
|
+
};
|
|
20
|
+
const compareLowercaseKeys = (a, b) => keySortPriority(a) - keySortPriority(b);
|
|
21
|
+
|
|
22
|
+
/** Split and sort the chord keys in standard order. */
|
|
23
|
+
const splitChord = chord => chord.split('+').map(k => k.toLowerCase()).sort(compareLowercaseKeys);
|
|
24
|
+
const splitSequence = sequence => sequence.split(' ');
|
|
25
|
+
|
|
26
|
+
/** Plain string version of `Chord` for use in `aria` string attributes. */
|
|
27
|
+
const accessibleChordString = (chord, platform) => splitChord(chord).map(key => accessibleKeyName(key, platform)).join(' ');
|
|
28
|
+
|
|
29
|
+
/** Plain string version of `Sequence` for use in `aria` string attributes. */
|
|
30
|
+
const accessibleSequenceString = (sequence, platform) => splitSequence(sequence).map(chord => accessibleChordString(chord, platform)).join(' then ');
|
|
31
|
+
|
|
32
|
+
export { accessibleChordString, accessibleSequenceString, splitChord };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,iCAAiC,EAAC,MAAM,SAAS,CAAA;AAEzD,YAAY,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Platform } from './platform';
|
|
2
|
+
/**
|
|
3
|
+
* AVOID: `KeybindingHint` is nearly always sufficient for providing both visible and accessible keyboard hints.
|
|
4
|
+
* However, there may be cases where we need a plain string version, such as when building `aria-label` or
|
|
5
|
+
* `aria-description`. In that case, this plain string builder can be used instead.
|
|
6
|
+
*
|
|
7
|
+
* NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
|
|
8
|
+
* visibly) and should nearly always also be paired with a visible hint for sighted users.
|
|
9
|
+
*
|
|
10
|
+
* The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
|
|
11
|
+
* backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` is
|
|
12
|
+
* treated as `'other'`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getAccessibleKeybindingHintString: (sequence: string, platform: Platform | boolean) => string;
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,GAAG,OAAO,WACe,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { accessibleSequenceString } from './components/utils.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AVOID: `KeybindingHint` is nearly always sufficient for providing both visible and accessible keyboard hints.
|
|
5
|
+
* However, there may be cases where we need a plain string version, such as when building `aria-label` or
|
|
6
|
+
* `aria-description`. In that case, this plain string builder can be used instead.
|
|
7
|
+
*
|
|
8
|
+
* NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
|
|
9
|
+
* visibly) and should nearly always also be paired with a visible hint for sighted users.
|
|
10
|
+
*
|
|
11
|
+
* The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
|
|
12
|
+
* backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` is
|
|
13
|
+
* treated as `'other'`.
|
|
14
|
+
*/
|
|
15
|
+
const getAccessibleKeybindingHintString = (sequence, platform) => accessibleSequenceString(sequence, typeof platform === 'boolean' ? platform ? 'apple' : 'other' : platform);
|
|
16
|
+
|
|
17
|
+
export { getAccessibleKeybindingHintString };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavList.d.ts","sourceRoot":"","sources":["../../src/NavList/NavList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAA;AAC3E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAuB,MAAM,OAAO,CAAA;AAE3C,OAAO,KAAK,EACV,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,eAAe,CAAA;AAUtB,OAAO,EAAkB,KAAK,gBAAgB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E,SAAS,KAAK,KAAK,CAAC,SAAS,CAAA;CAClD,CAAA;AAED,eAAO,MAAM,WAAW,mGAgFvB,CAAA;AAKD,MAAM,MAAM,wBAAwB,GAAG,2BAA2B,CAAA;AAqBlE,eAAO,MAAM,OAAO;;YA7WjB,EAAE,SAAS,KAAK,CAAC,WAAW;kBATjB,KAAK,CAAC,SAAS;sBACX,OAAO;eACd,MAAM;yBACI,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO;uBAC7E,MAAM;;kBAJX,KAAK,CAAC,SAAS;sBACX,OAAO;eACd,MAAM;yBACI,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO;uBAC7E,MAAM;;;;;;;;;;;;;;CA6XvB,CAAA"}
|
package/dist/NavList/NavList.js
CHANGED
|
@@ -57,6 +57,7 @@ const Root = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
57
57
|
t3 = /*#__PURE__*/jsx("nav", {
|
|
58
58
|
...props,
|
|
59
59
|
ref: ref,
|
|
60
|
+
"data-component": "NavList",
|
|
60
61
|
children: t2
|
|
61
62
|
});
|
|
62
63
|
$[6] = props;
|
|
@@ -120,6 +121,7 @@ const ItemComponent = fixedForwardRef(({
|
|
|
120
121
|
style: {
|
|
121
122
|
'--subitem-depth': depth
|
|
122
123
|
},
|
|
124
|
+
"data-component": "NavList.Item",
|
|
123
125
|
...props,
|
|
124
126
|
children: children
|
|
125
127
|
});
|
|
@@ -266,6 +268,7 @@ function ItemWithSubNav(t0) {
|
|
|
266
268
|
active: t5,
|
|
267
269
|
onSelect: t6,
|
|
268
270
|
style: style,
|
|
271
|
+
"data-component": "NavList.Item",
|
|
269
272
|
children: [children, t7, t9]
|
|
270
273
|
});
|
|
271
274
|
$[18] = buttonId;
|
|
@@ -341,6 +344,7 @@ const SubNav = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
341
344
|
id: subNavId,
|
|
342
345
|
"aria-labelledby": buttonId,
|
|
343
346
|
ref: forwardedRef,
|
|
347
|
+
"data-component": "NavList.SubNav",
|
|
344
348
|
children: children
|
|
345
349
|
});
|
|
346
350
|
$[2] = buttonId;
|
|
@@ -4,6 +4,7 @@ import type { AriaRole, Merge } from '../utils/types';
|
|
|
4
4
|
import type { TouchOrMouseEvent } from '../hooks';
|
|
5
5
|
import type { AnchorSide } from '@primer/behaviors';
|
|
6
6
|
import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
|
|
7
|
+
import type { heightMap, widthMap } from './constants';
|
|
7
8
|
type StyledOverlayProps = {
|
|
8
9
|
width?: keyof typeof widthMap;
|
|
9
10
|
height?: keyof typeof heightMap;
|
|
@@ -13,27 +14,10 @@ type StyledOverlayProps = {
|
|
|
13
14
|
overflow?: 'auto' | 'hidden' | 'scroll' | 'visible';
|
|
14
15
|
style?: React.CSSProperties;
|
|
15
16
|
};
|
|
16
|
-
export declare const heightMap: {
|
|
17
|
-
xsmall: string;
|
|
18
|
-
small: string;
|
|
19
|
-
medium: string;
|
|
20
|
-
large: string;
|
|
21
|
-
xlarge: string;
|
|
22
|
-
auto: string;
|
|
23
|
-
initial: string;
|
|
24
|
-
'fit-content': string;
|
|
25
|
-
};
|
|
26
|
-
export declare const widthMap: {
|
|
27
|
-
small: string;
|
|
28
|
-
medium: string;
|
|
29
|
-
large: string;
|
|
30
|
-
xlarge: string;
|
|
31
|
-
xxlarge: string;
|
|
32
|
-
auto: string;
|
|
33
|
-
};
|
|
34
17
|
type BaseOverlayProps = {
|
|
35
18
|
visibility?: 'visible' | 'hidden';
|
|
36
19
|
'data-test-id'?: unknown;
|
|
20
|
+
'data-component'?: string;
|
|
37
21
|
position?: React.CSSProperties['position'];
|
|
38
22
|
top?: React.CSSProperties['top'];
|
|
39
23
|
left?: React.CSSProperties['left'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,qBAAqB,EAAe,MAAM,OAAO,CAAA;AAC9D,OAAO,KAA0B,MAAM,OAAO,CAAA;AAE9C,OAAO,KAAK,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAA;AAG/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,qBAAqB,EAAe,MAAM,OAAO,CAAA;AAC9D,OAAO,KAA0B,MAAM,OAAO,CAAA;AAE9C,OAAO,KAAK,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAA;AAG/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAI/F,OAAO,KAAK,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAA;AAEpD,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAA;IAC7B,MAAM,CAAC,EAAE,MAAM,OAAO,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,QAAQ,EAAE,MAAM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C,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACrD,cAAc,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC9C,QAAQ,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CACpD,CAAA;AAED,KAAK,oBAAoB,GAAG,KAAK,CAAC,eAAe,EAAE,cAAc,CAAC,CAAA;AAElE;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,OAAO,EA6FR,8BAA8B,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAA;AAEhE,eAAe,OAAO,CAAA"}
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -9,25 +9,6 @@ import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
|
9
9
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
10
10
|
import { useOverlay } from '../hooks/useOverlay.js';
|
|
11
11
|
|
|
12
|
-
const heightMap = {
|
|
13
|
-
xsmall: '192px',
|
|
14
|
-
small: '256px',
|
|
15
|
-
medium: '320px',
|
|
16
|
-
large: '432px',
|
|
17
|
-
xlarge: '600px',
|
|
18
|
-
auto: 'auto',
|
|
19
|
-
initial: 'auto',
|
|
20
|
-
// Passing 'initial' initially applies 'auto'
|
|
21
|
-
'fit-content': 'fit-content'
|
|
22
|
-
};
|
|
23
|
-
const widthMap = {
|
|
24
|
-
small: '256px',
|
|
25
|
-
medium: '320px',
|
|
26
|
-
large: '480px',
|
|
27
|
-
xlarge: '640px',
|
|
28
|
-
xxlarge: '960px',
|
|
29
|
-
auto: 'auto'
|
|
30
|
-
};
|
|
31
12
|
const animationDuration = 200;
|
|
32
13
|
function getSlideAnimationStartingVector(anchorSide) {
|
|
33
14
|
if (anchorSide !== null && anchorSide !== void 0 && anchorSide.endsWith('bottom')) {
|
|
@@ -329,4 +310,4 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
329
310
|
return t13;
|
|
330
311
|
});
|
|
331
312
|
|
|
332
|
-
export { BaseOverlay, Overlay as default
|
|
313
|
+
export { BaseOverlay, Overlay as default };
|