@primer/react 38.29.0-rc.d7f442775 → 38.29.0-rc.dc2cb3e06
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/dist/AnchoredOverlay/AnchoredOverlay.js +2 -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/KeybindingHint/KeybindingHint.d.ts +0 -14
- package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
- package/dist/KeybindingHint/KeybindingHint.js +1 -16
- package/dist/KeybindingHint/components/Chord.d.ts +0 -2
- package/dist/KeybindingHint/components/Chord.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Chord.js +0 -1
- package/dist/KeybindingHint/components/Sequence.d.ts +0 -2
- package/dist/KeybindingHint/components/Sequence.d.ts.map +1 -1
- 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/Overlay/Overlay.d.ts +1 -2
- package/dist/Overlay/Overlay.d.ts.map +1 -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 -2
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Token/IssueLabelToken.d.ts.map +1 -1
- package/dist/Token/IssueLabelToken.js +2 -2
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +2 -2
- package/dist/Token/TokenBase.d.ts +1 -3
- package/dist/Token/TokenBase.d.ts.map +1 -1
- package/dist/Token/TokenBase.js +1 -1
- package/dist/Token/_RemoveTokenButton.js +1 -4
- package/dist/TooltipV2/Tooltip.js +2 -1
- package/dist/TreeView/TreeView.js +1 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts +0 -2
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +1 -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 +6 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- 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
|
@@ -6,13 +6,13 @@ import { IconButton } from '../Button/IconButton.js';
|
|
|
6
6
|
import { XIcon } from '@primer/octicons-react';
|
|
7
7
|
import classes from './AnchoredOverlay.module.css.js';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
|
-
import
|
|
9
|
+
import { widthMap } from '../Overlay/constants.js';
|
|
10
10
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
11
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
12
12
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
13
13
|
import { useRenderForcingRef } from '../hooks/useRenderForcingRef.js';
|
|
14
14
|
import { useAnchoredPosition } from '../hooks/useAnchoredPosition.js';
|
|
15
|
-
import
|
|
15
|
+
import Overlay from '../Overlay/Overlay.js';
|
|
16
16
|
|
|
17
17
|
const defaultVariant = {
|
|
18
18
|
regular: 'anchored',
|
|
@@ -68,13 +68,4 @@ export interface ConfirmationDialogProps {
|
|
|
68
68
|
* rendering capabilities are provided for ConfirmationDialog.
|
|
69
69
|
*/
|
|
70
70
|
export declare const ConfirmationDialog: React.FC<React.PropsWithChildren<ConfirmationDialogProps>>;
|
|
71
|
-
export type ConfirmOptions = Omit<ConfirmationDialogProps, 'onClose'> & {
|
|
72
|
-
content: React.ReactNode;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* This hook takes no parameters and returns an `async` function, `confirm`. When `confirm`
|
|
76
|
-
* is called, it shows the confirmation dialog. When the dialog is dismissed, a promise is
|
|
77
|
-
* resolved with `true` or `false` depending on whether or not the confirm button was used.
|
|
78
|
-
*/
|
|
79
|
-
export declare function useConfirm(): (options: ConfirmOptions) => Promise<boolean>;
|
|
80
71
|
//# sourceMappingURL=ConfirmationDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../../src/ConfirmationDialog/ConfirmationDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../../src/ConfirmationDialog/ConfirmationDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAoB,WAAW,EAAE,YAAY,EAAC,MAAM,WAAW,CAAA;AAG3E;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,cAAc,GAAG,QAAQ,GAAG,QAAQ,KAAK,IAAI,CAAA;IAE5E;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IAEtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAErC;;OAEG;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAEtC;;OAEG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;IAEnD;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAE9B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAE1C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,WAAW,CAAA;IAEnB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,YAAY,CAAA;CACtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAqDzF,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import BaseStyles from '../BaseStyles.js';
|
|
4
2
|
import { jsx } from 'react/jsx-runtime';
|
|
5
3
|
import { Dialog } from '../Dialog/Dialog.js';
|
|
6
4
|
|
|
@@ -60,44 +58,5 @@ const ConfirmationDialog = props => {
|
|
|
60
58
|
});
|
|
61
59
|
};
|
|
62
60
|
ConfirmationDialog.displayName = "ConfirmationDialog";
|
|
63
|
-
let hostElement = null;
|
|
64
|
-
async function confirm(options) {
|
|
65
|
-
const {
|
|
66
|
-
content,
|
|
67
|
-
...confirmationDialogProps
|
|
68
|
-
} = options;
|
|
69
|
-
return new Promise(resolve => {
|
|
70
|
-
hostElement ||= document.createElement('div');
|
|
71
|
-
if (!hostElement.isConnected) document.body.append(hostElement);
|
|
72
|
-
const root = createRoot(hostElement);
|
|
73
|
-
const onClose = gesture => {
|
|
74
|
-
root.unmount();
|
|
75
|
-
if (gesture === 'confirm') {
|
|
76
|
-
resolve(true);
|
|
77
|
-
} else {
|
|
78
|
-
resolve(false);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
root.render(/*#__PURE__*/jsx(BaseStyles, {
|
|
82
|
-
children: /*#__PURE__*/jsx(ConfirmationDialog, {
|
|
83
|
-
...confirmationDialogProps,
|
|
84
|
-
onClose: onClose,
|
|
85
|
-
children: content
|
|
86
|
-
})
|
|
87
|
-
}));
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* This hook takes no parameters and returns an `async` function, `confirm`. When `confirm`
|
|
93
|
-
* is called, it shows the confirmation dialog. When the dialog is dismissed, a promise is
|
|
94
|
-
* resolved with `true` or `false` depending on whether or not the confirm button was used.
|
|
95
|
-
*/
|
|
96
|
-
function useConfirm() {
|
|
97
|
-
const result = useCallback(options => {
|
|
98
|
-
return confirm(options);
|
|
99
|
-
}, []);
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
61
|
|
|
103
|
-
export { ConfirmationDialog
|
|
62
|
+
export { ConfirmationDialog };
|
|
@@ -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 };
|
|
@@ -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"}
|
|
@@ -4,7 +4,6 @@ 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';
|
|
7
|
-
import { accessibleSequenceString } from './components/utils.js';
|
|
8
7
|
import Text from '../Text/Text.js';
|
|
9
8
|
|
|
10
9
|
const Kbd = t0 => {
|
|
@@ -83,18 +82,4 @@ const KeybindingHint = /*#__PURE__*/memo(t0 => {
|
|
|
83
82
|
});
|
|
84
83
|
KeybindingHint.displayName = 'KeybindingHint';
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
* AVOID: `KeybindingHint` is nearly always sufficient for providing both visible and accessible keyboard hints.
|
|
88
|
-
* However, there may be cases where we need a plain string version, such as when building `aria-label` or
|
|
89
|
-
* `aria-description`. In that case, this plain string builder can be used instead.
|
|
90
|
-
*
|
|
91
|
-
* NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
|
|
92
|
-
* visibly) and should nearly always also be paired with a visible hint for sighted users.
|
|
93
|
-
*
|
|
94
|
-
* The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
|
|
95
|
-
* backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` as
|
|
96
|
-
* `'other'`.
|
|
97
|
-
*/
|
|
98
|
-
const getAccessibleKeybindingHintString = (sequence, platform) => accessibleSequenceString(sequence, typeof platform === 'boolean' ? platform ? 'apple' : 'other' : platform);
|
|
99
|
-
|
|
100
|
-
export { KeybindingHint, getAccessibleKeybindingHintString };
|
|
85
|
+
export { KeybindingHint };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { KeybindingHintProps } from '../props';
|
|
2
|
-
import { accessibleChordString } from './utils';
|
|
3
2
|
export declare const Chord: ({ keys, format, variant, size }: KeybindingHintProps) => import("react").JSX.Element;
|
|
4
|
-
export { accessibleChordString };
|
|
5
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"}
|
|
@@ -4,7 +4,6 @@ import { Key } from './Key.js';
|
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import classes from './Chord.module.css.js';
|
|
6
6
|
import { splitChord } from './utils.js';
|
|
7
|
-
export { accessibleChordString } from './utils.js';
|
|
8
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
8
|
import Text from '../../Text/Text.js';
|
|
10
9
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { KeybindingHintProps } from '../props';
|
|
2
|
-
import { accessibleSequenceString } from './utils';
|
|
3
2
|
export declare const Sequence: ({ keys, ...chordProps }: KeybindingHintProps) => import("react").JSX.Element[];
|
|
4
|
-
export { accessibleSequenceString };
|
|
5
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 +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 };
|
|
@@ -4,7 +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 { heightMap, widthMap } from './constants';
|
|
7
|
+
import type { heightMap, widthMap } from './constants';
|
|
8
8
|
type StyledOverlayProps = {
|
|
9
9
|
width?: keyof typeof widthMap;
|
|
10
10
|
height?: keyof typeof heightMap;
|
|
@@ -14,7 +14,6 @@ type StyledOverlayProps = {
|
|
|
14
14
|
overflow?: 'auto' | 'hidden' | 'scroll' | 'visible';
|
|
15
15
|
style?: React.CSSProperties;
|
|
16
16
|
};
|
|
17
|
-
export { heightMap, widthMap };
|
|
18
17
|
type BaseOverlayProps = {
|
|
19
18
|
visibility?: 'visible' | 'hidden';
|
|
20
19
|
'data-test-id'?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../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;IACvD,eAAe,CAAC,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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColorMode, ColorModeWithAuto, Theme } from './ThemeProvider';
|
|
3
|
+
export declare const ThemeContext: React.Context<{
|
|
4
|
+
theme?: Theme;
|
|
5
|
+
colorScheme?: string;
|
|
6
|
+
colorMode?: ColorModeWithAuto;
|
|
7
|
+
resolvedColorMode?: ColorMode;
|
|
8
|
+
resolvedColorScheme?: string;
|
|
9
|
+
dayScheme?: string;
|
|
10
|
+
nightScheme?: string;
|
|
11
|
+
setColorMode: React.Dispatch<React.SetStateAction<ColorModeWithAuto>>;
|
|
12
|
+
setDayScheme: React.Dispatch<React.SetStateAction<string>>;
|
|
13
|
+
setNightScheme: React.Dispatch<React.SetStateAction<string>>;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=ThemeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAC,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAA;AAExE,eAAO,MAAM,YAAY;YACf,KAAK;kBACC,MAAM;gBACR,iBAAiB;wBACT,SAAS;0BACP,MAAM;gBAChB,MAAM;kBACJ,MAAM;kBACN,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;kBACvD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;oBAC1C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;EAK5D,CAAA"}
|
package/dist/ThemeProvider.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const defaultColorMode = "day";
|
|
|
3
3
|
export type Theme = {
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
};
|
|
6
|
-
type ColorMode = 'day' | 'night' | 'light' | 'dark';
|
|
6
|
+
export type ColorMode = 'day' | 'night' | 'light' | 'dark';
|
|
7
7
|
export type ColorModeWithAuto = ColorMode | 'auto';
|
|
8
8
|
export type ThemeProviderProps = {
|
|
9
9
|
colorMode?: ColorModeWithAuto;
|
|
@@ -21,18 +21,5 @@ export type ThemeProviderProps = {
|
|
|
21
21
|
contextOnly?: boolean;
|
|
22
22
|
};
|
|
23
23
|
export declare const ThemeProvider: React.FC<React.PropsWithChildren<ThemeProviderProps>>;
|
|
24
|
-
export declare function useTheme(): {
|
|
25
|
-
theme?: Theme;
|
|
26
|
-
colorScheme?: string;
|
|
27
|
-
colorMode?: ColorModeWithAuto;
|
|
28
|
-
resolvedColorMode?: ColorMode;
|
|
29
|
-
resolvedColorScheme?: string;
|
|
30
|
-
dayScheme?: string;
|
|
31
|
-
nightScheme?: string;
|
|
32
|
-
setColorMode: React.Dispatch<React.SetStateAction<ColorModeWithAuto>>;
|
|
33
|
-
setDayScheme: React.Dispatch<React.SetStateAction<string>>;
|
|
34
|
-
setNightScheme: React.Dispatch<React.SetStateAction<string>>;
|
|
35
|
-
};
|
|
36
|
-
export declare function useColorSchemeVar(values: Partial<Record<string, string>>, fallback: string): string;
|
|
37
24
|
export default ThemeProvider;
|
|
38
25
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,eAAO,MAAM,gBAAgB,QAAQ,CAAA;AAKrC,MAAM,MAAM,KAAK,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,CAAA;AACxC,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;AAC1D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AA6BD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CA2F/E,CAAA;AAqED,eAAe,aAAa,CAAA"}
|
package/dist/ThemeProvider.js
CHANGED
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import theme from './theme.js';
|
|
4
4
|
import deepmerge from 'deepmerge';
|
|
5
5
|
import { useSyncedState } from './hooks/useSyncedState.js';
|
|
6
|
+
import { ThemeContext } from './ThemeContext.js';
|
|
7
|
+
import { useTheme } from './useTheme.js';
|
|
6
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
9
|
import { useFeatureFlag } from './FeatureFlags/useFeatureFlag.js';
|
|
8
10
|
import { useId } from './hooks/useId.js';
|
|
@@ -13,12 +15,6 @@ const defaultNightScheme = 'dark';
|
|
|
13
15
|
|
|
14
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
17
|
|
|
16
|
-
const ThemeContext = /*#__PURE__*/React.createContext({
|
|
17
|
-
setColorMode: () => null,
|
|
18
|
-
setDayScheme: () => null,
|
|
19
|
-
setNightScheme: () => null
|
|
20
|
-
});
|
|
21
|
-
|
|
22
18
|
// inspired from __NEXT_DATA__, we use application/json to avoid CSRF policy with inline scripts
|
|
23
19
|
const serverHandoffCache = new Map();
|
|
24
20
|
const emptyHandoff = {};
|
|
@@ -225,17 +221,6 @@ const ThemeProvider = t0 => {
|
|
|
225
221
|
}
|
|
226
222
|
return t10;
|
|
227
223
|
};
|
|
228
|
-
function useTheme() {
|
|
229
|
-
return React.useContext(ThemeContext);
|
|
230
|
-
}
|
|
231
|
-
function useColorSchemeVar(values, fallback) {
|
|
232
|
-
var _values$colorScheme;
|
|
233
|
-
const {
|
|
234
|
-
colorScheme: t0
|
|
235
|
-
} = useTheme();
|
|
236
|
-
const colorScheme = t0 === undefined ? "" : t0;
|
|
237
|
-
return (_values$colorScheme = values[colorScheme]) !== null && _values$colorScheme !== void 0 ? _values$colorScheme : fallback;
|
|
238
|
-
}
|
|
239
224
|
function subscribeToSystemColorMode(callback) {
|
|
240
225
|
var _window, _window$matchMedia;
|
|
241
226
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -298,4 +283,4 @@ function applyColorScheme(theme, colorScheme) {
|
|
|
298
283
|
};
|
|
299
284
|
}
|
|
300
285
|
|
|
301
|
-
export { ThemeProvider, ThemeProvider as default, defaultColorMode
|
|
286
|
+
export { ThemeProvider, ThemeProvider as default, defaultColorMode };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TimelineBadgeVariants } from './constants';
|
|
2
|
+
import type { TimelineBadgeVariants } from './constants';
|
|
3
3
|
type StyledTimelineProps = {
|
|
4
4
|
clipSidebar?: boolean | 'start' | 'end' | 'both';
|
|
5
5
|
className?: string;
|
|
@@ -14,7 +14,6 @@ type StyledTimelineItemProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
export type TimelineItemsProps = StyledTimelineItemProps & React.ComponentPropsWithoutRef<'li'>;
|
|
16
16
|
export type TimelineItemProps = StyledTimelineItemProps & React.ComponentPropsWithoutRef<'li'>;
|
|
17
|
-
export { TimelineBadgeVariants };
|
|
18
17
|
export type TimelineBadgeVariant = (typeof TimelineBadgeVariants)[number];
|
|
19
18
|
export type TimelineBadgeProps = {
|
|
20
19
|
children?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/Timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAC,qBAAqB,EAAC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/Timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,aAAa,CAAA;AAEtD,KAAK,mBAAmB,GAAG;IAAC,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,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BAAwB,CAAC,KAAK,CAAC,CAAA;AAQzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;;;;QAFvC,oCAAoC;oBACxB,MAAM;;;2CAlEmC,kBAAkB;;;;QAWvE,oCAAoC;oBACxB,MAAM;;;QAUlB,oCAAoC;oBACxB,MAAM;;;QA+BlB,oCAAoC;oBACxB,MAAM;;;AAoBpB,wBAOE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IssueLabelToken.d.ts","sourceRoot":"","sources":["../../src/Token/IssueLabelToken.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"IssueLabelToken.d.ts","sourceRoot":"","sources":["../../src/Token/IssueLabelToken.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAO/C,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAI/F,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,eAAe,EAsEf,8BAA8B,CAAC,MAAM,GAAG,GAAG,GAAG,QAAQ,EAAE,oBAAoB,CAAC,CAAA;AAEnF,eAAe,eAAe,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import TokenBase from './TokenBase.js';
|
|
4
|
+
import { defaultTokenSize } from './constants.js';
|
|
5
|
+
import { isTokenInteractive } from './utils.js';
|
|
4
6
|
import RemoveTokenButton from './_RemoveTokenButton.js';
|
|
5
7
|
import { parseToRgba, parseToHsla } from 'color2k';
|
|
6
8
|
import TokenTextContainer from './_TokenTextContainer.js';
|
|
7
9
|
import classes from './IssueLabelToken.module.css.js';
|
|
8
10
|
import { clsx } from 'clsx';
|
|
9
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
|
-
import { isTokenInteractive } from './utils.js';
|
|
11
|
-
import { defaultTokenSize } from './constants.js';
|
|
12
12
|
|
|
13
13
|
const IssueLabelToken = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
14
14
|
const $ = c(81);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/Token/Token.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/Token/Token.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAM/C,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAQ/F,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAClC;AAcD,QAAA,MAAM,KAAK,EA4DL,8BAA8B,CAAC,GAAG,GAAG,QAAQ,GAAG,MAAM,EAAE,UAAU,CAAC,CAAA;AAEzE,eAAe,KAAK,CAAA"}
|
package/dist/Token/Token.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import TokenBase from './TokenBase.js';
|
|
4
|
+
import { defaultTokenSize } from './constants.js';
|
|
5
|
+
import { isTokenInteractive } from './utils.js';
|
|
4
6
|
import RemoveTokenButton from './_RemoveTokenButton.js';
|
|
5
7
|
import TokenTextContainer from './_TokenTextContainer.js';
|
|
6
8
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
7
9
|
import classes from './Token.module.css.js';
|
|
8
10
|
import { clsx } from 'clsx';
|
|
9
11
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
-
import { isTokenInteractive } from './utils.js';
|
|
11
|
-
import { defaultTokenSize } from './constants.js';
|
|
12
12
|
|
|
13
13
|
const tokenBorderWidthPx = 1;
|
|
14
14
|
const LeadingVisualContainer = t0 => {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
|
|
3
|
-
import {
|
|
4
|
-
import { isTokenInteractive } from './utils';
|
|
5
|
-
export { defaultTokenSize, isTokenInteractive, tokenSizes };
|
|
3
|
+
import { type TokenSizeKeys } from './constants';
|
|
6
4
|
export type { TokenSizeKeys };
|
|
7
5
|
export interface TokenBaseProps extends Omit<React.HTMLProps<HTMLSpanElement | HTMLButtonElement | HTMLAnchorElement>, 'size' | 'id'> {
|
|
8
6
|
as?: 'button' | 'a' | 'span';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenBase.d.ts","sourceRoot":"","sources":["../../src/Token/TokenBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,OAAO,
|
|
1
|
+
{"version":3,"file":"TokenBase.d.ts","sourceRoot":"","sources":["../../src/Token/TokenBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,OAAO,EAAmB,KAAK,aAAa,EAAC,MAAM,aAAa,CAAA;AAGhE,YAAY,EAAC,aAAa,EAAC,CAAA;AAE3B,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,eAAe,GAAG,iBAAiB,GAAG,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrG,EAAE,CAAC,EAAE,QAAQ,GAAG,GAAG,GAAG,MAAM,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,QAAA,MAAM,SAAS,EA6CV,8BAA8B,CAAC,MAAM,GAAG,GAAG,GAAG,QAAQ,EAAE,cAAc,CAAC,CAAA;AAE5E,eAAe,SAAS,CAAA"}
|
package/dist/Token/TokenBase.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { XIcon } from '@primer/octicons-react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import 'react-compiler-runtime';
|
|
4
|
-
import 'react';
|
|
5
|
-
import './TokenBase.module.css.js';
|
|
6
3
|
import { defaultTokenSize } from './constants.js';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
4
|
import classes from './_RemoveTokenButton.module.css.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
6
|
|
|
10
7
|
const RemoveTokenButton = ({
|
|
11
8
|
'aria-label': ariaLabel,
|
|
@@ -13,7 +13,8 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
13
13
|
import { useId } from '../hooks/useId.js';
|
|
14
14
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
15
15
|
import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
|
|
16
|
-
import { getAccessibleKeybindingHintString
|
|
16
|
+
import { getAccessibleKeybindingHintString } from '../KeybindingHint/utils.js';
|
|
17
|
+
import { KeybindingHint } from '../KeybindingHint/KeybindingHint.js';
|
|
17
18
|
|
|
18
19
|
// map tooltip direction to anchoredPosition props
|
|
19
20
|
const directionToPosition = {
|
|
@@ -18,6 +18,7 @@ import { ActionList } from '../ActionList/index.js';
|
|
|
18
18
|
import { usePlatform } from '../KeybindingHint/platform.js';
|
|
19
19
|
import { isSlot } from '../utils/is-slot.js';
|
|
20
20
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
21
|
+
import { getAccessibleKeybindingHintString } from '../KeybindingHint/utils.js';
|
|
21
22
|
import { AriaStatus } from '../live-region/AriaStatus.js';
|
|
22
23
|
import Spinner from '../Spinner/Spinner.js';
|
|
23
24
|
import { Tooltip } from '../TooltipV2/Tooltip.js';
|
|
@@ -25,7 +26,6 @@ import { Dialog } from '../Dialog/Dialog.js';
|
|
|
25
26
|
import Text from '../Text/Text.js';
|
|
26
27
|
import { SkeletonAvatar } from '../SkeletonAvatar/SkeletonAvatar.js';
|
|
27
28
|
import { SkeletonText } from '../SkeletonText/SkeletonText.js';
|
|
28
|
-
import { getAccessibleKeybindingHintString } from '../KeybindingHint/KeybindingHint.js';
|
|
29
29
|
|
|
30
30
|
const RootContext = /*#__PURE__*/React.createContext({
|
|
31
31
|
announceUpdate: () => {},
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getValidChildren } from './utils';
|
|
3
2
|
export type UnderlineNavProps = {
|
|
4
3
|
children: React.ReactNode;
|
|
5
4
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
@@ -17,6 +16,5 @@ export type UnderlineNavProps = {
|
|
|
17
16
|
variant?: 'inset' | 'flush';
|
|
18
17
|
};
|
|
19
18
|
export declare const MORE_BTN_WIDTH = 86;
|
|
20
|
-
export { getValidChildren };
|
|
21
19
|
export declare const UnderlineNav: React.ForwardRefExoticComponent<UnderlineNavProps & React.RefAttributes<unknown>>;
|
|
22
20
|
//# sourceMappingURL=UnderlineNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAqBtE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,cAAc,KAAK,CAAA;AAsGhC,eAAO,MAAM,YAAY,mFA0SxB,CAAA"}
|