@primer/react 0.0.0-20260609233759 → 0.0.0-20260610115408
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 +56 -4
- package/dist/ActionList/ActionList-1940009e.css +2 -0
- package/dist/ActionList/ActionList-1940009e.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +2 -2
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +125 -118
- package/dist/ActionList/TrailingAction.d.ts.map +1 -1
- package/dist/ActionList/TrailingAction.js +1 -0
- package/dist/ActionList/Visuals.js +6 -4
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts +4 -8
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +2 -32
- package/dist/Autocomplete/AutocompleteInput.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +14 -2
- package/dist/Card/Card-59b77d05.css +2 -0
- package/dist/Card/Card-59b77d05.css.map +1 -0
- package/dist/Card/Card.d.ts +18 -0
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +165 -154
- package/dist/Card/Card.module.css.js +1 -1
- package/dist/Card/index.d.ts +2 -0
- package/dist/Card/index.d.ts.map +1 -1
- package/dist/Dialog/Dialog.d.ts +1 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +16 -2
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -1
- package/dist/InlineMessage/InlineMessage-cd1e4c93.css +2 -0
- package/dist/InlineMessage/InlineMessage-cd1e4c93.css.map +1 -0
- package/dist/InlineMessage/InlineMessage.d.ts +1 -1
- package/dist/InlineMessage/InlineMessage.d.ts.map +1 -1
- package/dist/InlineMessage/InlineMessage.js +34 -19
- package/dist/InlineMessage/InlineMessage.module.css.js +1 -1
- package/dist/KeybindingHint/KeybindingHint.d.ts +6 -1
- package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
- package/dist/KeybindingHint/KeybindingHint.js +6 -2
- package/dist/KeybindingHint/components/Chord.d.ts +2 -1
- package/dist/KeybindingHint/components/Chord.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Chord.js +1 -1
- package/dist/KeybindingHint/components/Key.js +10 -10
- package/dist/KeybindingHint/components/Sequence.d.ts +2 -1
- package/dist/KeybindingHint/components/Sequence.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Sequence.js +2 -2
- package/dist/KeybindingHint/key-names.d.ts +4 -3
- package/dist/KeybindingHint/key-names.d.ts.map +1 -1
- package/dist/KeybindingHint/key-names.js +15 -14
- package/dist/KeybindingHint/platform.d.ts +22 -0
- package/dist/KeybindingHint/platform.d.ts.map +1 -0
- package/dist/KeybindingHint/platform.js +61 -0
- package/dist/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/PageHeader/PageHeader.js +6 -0
- package/dist/PageLayout/PageLayout.d.ts +24 -6
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +16 -2
- package/dist/Pagehead/Pagehead.js +1 -0
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +2 -0
- package/dist/Portal/Portal.d.ts.map +1 -1
- package/dist/Portal/Portal.js +1 -0
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +2 -0
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +6 -1
- package/dist/Text/{Text-ca7603b7.css → Text-d649cda5.css} +2 -2
- package/dist/Text/Text-d649cda5.css.map +1 -0
- package/dist/Text/Text.d.ts +3 -0
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +20 -14
- package/dist/Text/Text.module.css.js +1 -1
- package/dist/Timeline/Timeline-ff81db92.css +2 -0
- package/dist/Timeline/Timeline-ff81db92.css.map +1 -0
- package/dist/Timeline/Timeline.d.ts +9 -8
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Timeline/Timeline.js +156 -61
- package/dist/Timeline/Timeline.module.css.js +1 -1
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +3 -3
- package/dist/TreeView/TreeView-1bf45a33.css +2 -0
- package/dist/TreeView/TreeView-1bf45a33.css.map +1 -0
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +25 -12
- package/dist/TreeView/TreeView.module.css.js +2 -2
- package/generated/components.json +57 -10
- package/package.json +9 -9
- package/dist/ActionList/ActionList-2a35a40c.css +0 -2
- package/dist/ActionList/ActionList-2a35a40c.css.map +0 -1
- package/dist/Card/Card-d8a02dd9.css +0 -2
- package/dist/Card/Card-d8a02dd9.css.map +0 -1
- package/dist/InlineMessage/InlineMessage-80d97643.css +0 -2
- package/dist/InlineMessage/InlineMessage-80d97643.css.map +0 -1
- package/dist/Text/Text-ca7603b7.css.map +0 -1
- package/dist/Timeline/Timeline-0c88f21b.css +0 -2
- package/dist/Timeline/Timeline-0c88f21b.css.map +0 -1
- package/dist/TreeView/TreeView-0fe09f34.css +0 -2
- package/dist/TreeView/TreeView-0fe09f34.css.map +0 -1
- package/dist/hooks/useIsMacOS.js +0 -32
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { KeybindingHintProps } from './props';
|
|
2
|
+
import type { Platform } from './platform';
|
|
2
3
|
/** Indicates the presence of an available keybinding. */
|
|
3
4
|
export declare const KeybindingHint: import("react").MemoExoticComponent<({ className, ...props }: KeybindingHintProps) => import("react").JSX.Element>;
|
|
4
5
|
/**
|
|
@@ -8,6 +9,10 @@ export declare const KeybindingHint: import("react").MemoExoticComponent<({ clas
|
|
|
8
9
|
*
|
|
9
10
|
* NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
|
|
10
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'`.
|
|
11
16
|
*/
|
|
12
|
-
export declare const getAccessibleKeybindingHintString: (sequence: string,
|
|
17
|
+
export declare const getAccessibleKeybindingHintString: (sequence: string, platform: Platform | boolean) => string;
|
|
13
18
|
//# 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;AAEhD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAmBxC,yDAAyD;AAEzD,eAAO,MAAM,cAAc,gEAAgC,mBAAmB,iCAI5E,CAAA;AAGF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,GAAG,OAAO,WACe,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Sequence, accessibleSequenceString } 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';
|
|
@@ -89,7 +89,11 @@ KeybindingHint.displayName = 'KeybindingHint';
|
|
|
89
89
|
*
|
|
90
90
|
* NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
|
|
91
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'`.
|
|
92
96
|
*/
|
|
93
|
-
const getAccessibleKeybindingHintString = accessibleSequenceString;
|
|
97
|
+
const getAccessibleKeybindingHintString = (sequence, platform) => accessibleSequenceString(sequence, typeof platform === 'boolean' ? platform ? 'apple' : 'other' : platform);
|
|
94
98
|
|
|
95
99
|
export { KeybindingHint, getAccessibleKeybindingHintString };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KeybindingHintProps } from '../props';
|
|
2
|
+
import type { Platform } from '../platform';
|
|
2
3
|
export declare const Chord: ({ keys, format, variant, size }: KeybindingHintProps) => import("react").JSX.Element;
|
|
3
4
|
/** Plain string version of `Chord` for use in `aria` string attributes. */
|
|
4
|
-
export declare const accessibleChordString: (chord: string,
|
|
5
|
+
export declare const accessibleChordString: (chord: string, platform: Platform) => string;
|
|
5
6
|
//# 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;AAGjD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AA6BzC,eAAO,MAAM,KAAK,GAAI,iCAAmE,mBAAmB,gCAsB3G,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,UAAU,QAAQ,WAGzD,CAAA"}
|
|
@@ -96,6 +96,6 @@ const Chord = t0 => {
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
/** Plain string version of `Chord` for use in `aria` string attributes. */
|
|
99
|
-
const accessibleChordString = (chord,
|
|
99
|
+
const accessibleChordString = (chord, platform) => splitChord(chord).map(key => accessibleKeyName(key, platform)).join(' ');
|
|
100
100
|
|
|
101
101
|
export { Chord, accessibleChordString };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import VisuallyHidden from '../../_VisuallyHidden.js';
|
|
3
3
|
import { accessibleKeyName, condensedKeyName, fullKeyName } from '../key-names.js';
|
|
4
|
-
import {
|
|
4
|
+
import { usePlatform } from '../platform.js';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
/** Renders a single key with accessible alternative text. */
|
|
@@ -11,12 +11,12 @@ const Key = t0 => {
|
|
|
11
11
|
name,
|
|
12
12
|
format
|
|
13
13
|
} = t0;
|
|
14
|
-
const
|
|
14
|
+
const platform = usePlatform();
|
|
15
15
|
let t1;
|
|
16
|
-
if ($[0] !==
|
|
17
|
-
t1 = accessibleKeyName(name,
|
|
18
|
-
$[0] =
|
|
19
|
-
$[1] =
|
|
16
|
+
if ($[0] !== name || $[1] !== platform) {
|
|
17
|
+
t1 = accessibleKeyName(name, platform);
|
|
18
|
+
$[0] = name;
|
|
19
|
+
$[1] = platform;
|
|
20
20
|
$[2] = t1;
|
|
21
21
|
} else {
|
|
22
22
|
t1 = $[2];
|
|
@@ -32,11 +32,11 @@ const Key = t0 => {
|
|
|
32
32
|
t2 = $[4];
|
|
33
33
|
}
|
|
34
34
|
let t3;
|
|
35
|
-
if ($[5] !== format || $[6] !==
|
|
36
|
-
t3 = format === "condensed" ? condensedKeyName(name,
|
|
35
|
+
if ($[5] !== format || $[6] !== name || $[7] !== platform) {
|
|
36
|
+
t3 = format === "condensed" ? condensedKeyName(name, platform) : fullKeyName(name, platform);
|
|
37
37
|
$[5] = format;
|
|
38
|
-
$[6] =
|
|
39
|
-
$[7] =
|
|
38
|
+
$[6] = name;
|
|
39
|
+
$[7] = platform;
|
|
40
40
|
$[8] = t3;
|
|
41
41
|
} else {
|
|
42
42
|
t3 = $[8];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KeybindingHintProps } from '../props';
|
|
2
|
+
import type { Platform } from '../platform';
|
|
2
3
|
export declare const Sequence: ({ keys, ...chordProps }: KeybindingHintProps) => import("react").JSX.Element[];
|
|
3
4
|
/** Plain string version of `Sequence` for use in `aria` string attributes. */
|
|
4
|
-
export declare const accessibleSequenceString: (sequence: string,
|
|
5
|
+
export declare const accessibleSequenceString: (sequence: string, platform: Platform) => string;
|
|
5
6
|
//# 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;AAGjD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAIzC,eAAO,MAAM,QAAQ,GAAI,yBAAuB,mBAAmB,kCAa/D,CAAA;AAEJ,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,WAG1D,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import VisuallyHidden from '../../_VisuallyHidden.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Chord, accessibleChordString } 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(' ');
|
|
@@ -21,6 +21,6 @@ const Sequence = ({
|
|
|
21
21
|
}, i));
|
|
22
22
|
|
|
23
23
|
/** Plain string version of `Sequence` for use in `aria` string attributes. */
|
|
24
|
-
const accessibleSequenceString = (sequence,
|
|
24
|
+
const accessibleSequenceString = (sequence, platform) => splitSequence(sequence).map(chord => accessibleChordString(chord, platform)).join(' then ');
|
|
25
25
|
|
|
26
26
|
export { Sequence, accessibleSequenceString };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import type { Platform } from './platform';
|
|
1
2
|
/**
|
|
2
3
|
* Short-form iconic versions of keys. These should be intuitive (not archaic) and match icons on keyboards.
|
|
3
4
|
*/
|
|
4
|
-
export declare const condensedKeyName: (key: string,
|
|
5
|
+
export declare const condensedKeyName: (key: string, platform: Platform) => string;
|
|
5
6
|
/**
|
|
6
7
|
* Specific key displays for 'full' format. We still do show some icons (ie punctuation)
|
|
7
8
|
* because that's more intuitive, but for the rest of keys we show the standard key name.
|
|
8
9
|
*/
|
|
9
|
-
export declare const fullKeyName: (key: string,
|
|
10
|
+
export declare const fullKeyName: (key: string, platform: Platform) => string;
|
|
10
11
|
/**
|
|
11
12
|
* Accessible key names intended to be read by a screen reader. This prevents screen
|
|
12
13
|
* readers from expressing punctuation in speech, ie, reading a long pause instead of the
|
|
13
14
|
* word "period".
|
|
14
15
|
*/
|
|
15
|
-
export declare const accessibleKeyName: (key: string,
|
|
16
|
+
export declare const accessibleKeyName: (key: string, platform: Platform) => string;
|
|
16
17
|
//# sourceMappingURL=key-names.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-names.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/key-names.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"key-names.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/key-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAUxC;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,EAAE,UAAU,QAAQ,WAwBpC,CAAA;AAE5B;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,UAAU,QAAQ,WAc/B,CAAA;AAE5B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,EAAE,UAAU,QAAQ,WAmDnC,CAAA"}
|
|
@@ -12,15 +12,15 @@ const capitalize = ([first, ...rest]) => {
|
|
|
12
12
|
/**
|
|
13
13
|
* Short-form iconic versions of keys. These should be intuitive (not archaic) and match icons on keyboards.
|
|
14
14
|
*/
|
|
15
|
-
const condensedKeyName = (key,
|
|
15
|
+
const condensedKeyName = (key, platform) => {
|
|
16
16
|
var _alt$control$shift$me;
|
|
17
17
|
return (_alt$control$shift$me = {
|
|
18
|
-
alt:
|
|
18
|
+
alt: platform === 'apple' ? '⌥' : 'Alt',
|
|
19
19
|
// the alt key _is_ the option key on MacOS - in the browser there is no "option" key
|
|
20
20
|
control: '⌃',
|
|
21
21
|
shift: '⇧',
|
|
22
|
-
meta:
|
|
23
|
-
mod:
|
|
22
|
+
meta: platform === 'apple' ? '⌘' : platform === 'windows' ? 'Win' : 'Meta',
|
|
23
|
+
mod: platform === 'apple' ? '⌘' : '⌃',
|
|
24
24
|
pageup: 'PgUp',
|
|
25
25
|
pagedown: 'PgDn',
|
|
26
26
|
arrowup: '↑',
|
|
@@ -47,11 +47,12 @@ const condensedKeyName = (key, isMacOS) => {
|
|
|
47
47
|
* Specific key displays for 'full' format. We still do show some icons (ie punctuation)
|
|
48
48
|
* because that's more intuitive, but for the rest of keys we show the standard key name.
|
|
49
49
|
*/
|
|
50
|
-
const fullKeyName = (key,
|
|
51
|
-
var _alt$mod$$
|
|
52
|
-
return (_alt$mod$$
|
|
53
|
-
alt:
|
|
54
|
-
|
|
50
|
+
const fullKeyName = (key, platform) => {
|
|
51
|
+
var _alt$meta$mod$$pageu;
|
|
52
|
+
return (_alt$meta$mod$$pageu = {
|
|
53
|
+
alt: platform === 'apple' ? 'Option' : 'Alt',
|
|
54
|
+
meta: platform === 'apple' ? 'Command' : platform === 'windows' ? 'Windows' : 'Meta',
|
|
55
|
+
mod: platform === 'apple' ? 'Command' : 'Control',
|
|
55
56
|
'+': 'Plus',
|
|
56
57
|
pageup: 'Page Up',
|
|
57
58
|
pagedown: 'Page Down',
|
|
@@ -61,7 +62,7 @@ const fullKeyName = (key, isMacOS) => {
|
|
|
61
62
|
arrowright: 'Right Arrow',
|
|
62
63
|
capslock: 'Caps Lock',
|
|
63
64
|
printscreen: 'Print Screen'
|
|
64
|
-
}[key]) !== null && _alt$mod$$
|
|
65
|
+
}[key]) !== null && _alt$meta$mod$$pageu !== void 0 ? _alt$meta$mod$$pageu : capitalize(key);
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
/**
|
|
@@ -69,12 +70,12 @@ const fullKeyName = (key, isMacOS) => {
|
|
|
69
70
|
* readers from expressing punctuation in speech, ie, reading a long pause instead of the
|
|
70
71
|
* word "period".
|
|
71
72
|
*/
|
|
72
|
-
const accessibleKeyName = (key,
|
|
73
|
+
const accessibleKeyName = (key, platform) => {
|
|
73
74
|
var _alt$meta$mod$pageup$;
|
|
74
75
|
return (_alt$meta$mod$pageup$ = {
|
|
75
|
-
alt:
|
|
76
|
-
meta:
|
|
77
|
-
mod:
|
|
76
|
+
alt: platform === 'apple' ? 'option' : 'alt',
|
|
77
|
+
meta: platform === 'apple' ? 'command' : platform === 'windows' ? 'Windows' : 'meta',
|
|
78
|
+
mod: platform === 'apple' ? 'command' : 'control',
|
|
78
79
|
// Screen readers may not be able to pronounce concatenated words - this provides a better experience
|
|
79
80
|
pageup: 'page up',
|
|
80
81
|
pagedown: 'page down',
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform categories that affect how keyboard shortcut keys are displayed.
|
|
3
|
+
*
|
|
4
|
+
* - `apple`: Apple platforms (macOS and iOS/iPadOS), which use the Command and Option keys.
|
|
5
|
+
* - `windows`: Windows, which uses the Windows (Meta) key.
|
|
6
|
+
* - `other`: Any other platform (e.g. Linux, Android), where the Meta key does not map to a
|
|
7
|
+
* consistent label.
|
|
8
|
+
*/
|
|
9
|
+
export type Platform = 'apple' | 'windows' | 'other';
|
|
10
|
+
export declare const PlatformOverrideProvider: import("react").Provider<Platform | null>;
|
|
11
|
+
/**
|
|
12
|
+
* SSR-safe hook for determining the current platform category used when displaying
|
|
13
|
+
* keyboard shortcut keys.
|
|
14
|
+
*
|
|
15
|
+
* Mirrors the approach of `useIsMacOS`: on the client it reads the real value immediately,
|
|
16
|
+
* and on the server it returns a safe default (`'other'`).
|
|
17
|
+
*
|
|
18
|
+
* If a `PlatformOverrideProvider` is present with a non-null value, that value is used
|
|
19
|
+
* instead of the detected platform.
|
|
20
|
+
*/
|
|
21
|
+
export declare function usePlatform(): Platform;
|
|
22
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/platform.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAkCpD,eAAO,MAAM,wBAAwB,2CAAmC,CAAA;AAExE;;;;;;;;;GASG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAItC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { isMacOS } from '@primer/behaviors/utils';
|
|
2
|
+
import { useContext, useSyncExternalStore, createContext } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The platform categories that affect how keyboard shortcut keys are displayed.
|
|
6
|
+
*
|
|
7
|
+
* - `apple`: Apple platforms (macOS and iOS/iPadOS), which use the Command and Option keys.
|
|
8
|
+
* - `windows`: Windows, which uses the Windows (Meta) key.
|
|
9
|
+
* - `other`: Any other platform (e.g. Linux, Android), where the Meta key does not map to a
|
|
10
|
+
* consistent label.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// No-op. The platform never changes at runtime, so there is nothing to
|
|
14
|
+
// subscribe to. Hoisted to avoid creating a new function on every call.
|
|
15
|
+
const subscribe = () => () => {};
|
|
16
|
+
|
|
17
|
+
/** SSR-unsafe detection of iOS/iPadOS (in addition to macOS, which is detected separately). */
|
|
18
|
+
const ssrUnsafeIsIOS = () => {
|
|
19
|
+
if (typeof navigator === 'undefined') return false;
|
|
20
|
+
return /iphone|ipad|ipod/i.test(navigator.platform) || /iphone|ipad|ipod/i.test(navigator.userAgent);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** SSR-unsafe detection of Windows. */
|
|
24
|
+
const ssrUnsafeIsWindows = () => {
|
|
25
|
+
if (typeof navigator === 'undefined') return false;
|
|
26
|
+
return /^win/i.test(navigator.platform);
|
|
27
|
+
};
|
|
28
|
+
const getSnapshot = () => {
|
|
29
|
+
if (isMacOS() || ssrUnsafeIsIOS()) return 'apple';
|
|
30
|
+
if (ssrUnsafeIsWindows()) return 'windows';
|
|
31
|
+
return 'other';
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Safe default for SSR since we can't detect the platform on the server.
|
|
35
|
+
const getServerSnapshot = () => 'other';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Allows overriding the detected platform. This is primarily intended for testing and
|
|
39
|
+
* Storybook, where we want to preview how keyboard hints render on platforms other than the
|
|
40
|
+
* one actually running. A `null` value (the default) means "use the detected platform".
|
|
41
|
+
*/
|
|
42
|
+
const PlatformOverrideContext = /*#__PURE__*/createContext(null);
|
|
43
|
+
PlatformOverrideContext.Provider;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* SSR-safe hook for determining the current platform category used when displaying
|
|
47
|
+
* keyboard shortcut keys.
|
|
48
|
+
*
|
|
49
|
+
* Mirrors the approach of `useIsMacOS`: on the client it reads the real value immediately,
|
|
50
|
+
* and on the server it returns a safe default (`'other'`).
|
|
51
|
+
*
|
|
52
|
+
* If a `PlatformOverrideProvider` is present with a non-null value, that value is used
|
|
53
|
+
* instead of the detected platform.
|
|
54
|
+
*/
|
|
55
|
+
function usePlatform() {
|
|
56
|
+
const override = useContext(PlatformOverrideContext);
|
|
57
|
+
const detected = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
58
|
+
return override !== null && override !== void 0 ? override : detected;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { usePlatform };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAIhE,OAAO,KAAK,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,SAAS,CAAA;AAIvD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAI/F,OAAO,KAAK,EAAC,QAAQ,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAO9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;CAC5C,CAAA;AAkBD,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EA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,CAC1G,GAAG;IACF,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;CAClD,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;AAgEpF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,eAAe,CAAC,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAA;CAC7F,GAAG,iBAAiB,CAAA;AAsErB,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC7C,GAAG,iBAAiB,CAAA;AAiDrB,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;AAuBrE,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC5D,GAAG,iBAAiB,CAAA;AAsFrB,eAAO,MAAM,UAAU;;;;;;;;;;;;+CA/GiC,YAAY;;;CA8HlE,CAAA"}
|
|
@@ -94,6 +94,7 @@ const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
94
94
|
t6 = /*#__PURE__*/jsx(BaseComponent, {
|
|
95
95
|
ref: rootRef,
|
|
96
96
|
className: t4,
|
|
97
|
+
"data-component": "PageHeader",
|
|
97
98
|
"data-has-border": t5,
|
|
98
99
|
"aria-label": ariaLabel,
|
|
99
100
|
role: role,
|
|
@@ -145,6 +146,7 @@ const ContextArea = t0 => {
|
|
|
145
146
|
if ($[4] !== children || $[5] !== t2 || $[6] !== t3) {
|
|
146
147
|
t4 = /*#__PURE__*/jsx("div", {
|
|
147
148
|
className: t2,
|
|
149
|
+
"data-component": "PageHeader.ContextArea",
|
|
148
150
|
...t3,
|
|
149
151
|
children: children
|
|
150
152
|
});
|
|
@@ -213,6 +215,7 @@ const ParentLink = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
213
215
|
"aria-label": ariaLabel,
|
|
214
216
|
muted: true,
|
|
215
217
|
className: t3,
|
|
218
|
+
"data-component": "PageHeader.ParentLink",
|
|
216
219
|
...t4,
|
|
217
220
|
href: href,
|
|
218
221
|
children: [t5, t6]
|
|
@@ -265,6 +268,7 @@ const ContextBar = t0 => {
|
|
|
265
268
|
if ($[4] !== children || $[5] !== t2 || $[6] !== t3) {
|
|
266
269
|
t4 = /*#__PURE__*/jsx("div", {
|
|
267
270
|
className: t2,
|
|
271
|
+
"data-component": "PageHeader.ContextBar",
|
|
268
272
|
...t3,
|
|
269
273
|
children: children
|
|
270
274
|
});
|
|
@@ -308,6 +312,7 @@ const ContextAreaActions = t0 => {
|
|
|
308
312
|
if ($[4] !== children || $[5] !== t2 || $[6] !== t3) {
|
|
309
313
|
t4 = /*#__PURE__*/jsx("div", {
|
|
310
314
|
className: t2,
|
|
315
|
+
"data-component": "PageHeader.ContextAreaActions",
|
|
311
316
|
...t3,
|
|
312
317
|
children: children
|
|
313
318
|
});
|
|
@@ -714,6 +719,7 @@ const Description = t0 => {
|
|
|
714
719
|
if ($[4] !== children || $[5] !== t2 || $[6] !== t3) {
|
|
715
720
|
t4 = /*#__PURE__*/jsx("div", {
|
|
716
721
|
className: t2,
|
|
722
|
+
"data-component": "PageHeader.Description",
|
|
717
723
|
...t3,
|
|
718
724
|
children: children
|
|
719
725
|
});
|
|
@@ -160,7 +160,7 @@ export type PageLayoutPaneProps = PageLayoutPaneBaseProps & ({
|
|
|
160
160
|
currentWidth?: never;
|
|
161
161
|
});
|
|
162
162
|
declare const Pane: React.ForwardRefExoticComponent<React.PropsWithChildren<PageLayoutPaneProps> & React.RefAttributes<HTMLDivElement>>;
|
|
163
|
-
export type
|
|
163
|
+
export type PageLayoutSidebarBaseProps = {
|
|
164
164
|
/**
|
|
165
165
|
* A unique label for the sidebar region
|
|
166
166
|
*/
|
|
@@ -175,7 +175,10 @@ export type PageLayoutSidebarProps = {
|
|
|
175
175
|
*/
|
|
176
176
|
position?: 'start' | 'end';
|
|
177
177
|
/**
|
|
178
|
-
* Width configuration for the sidebar
|
|
178
|
+
* Width configuration for the sidebar.
|
|
179
|
+
*
|
|
180
|
+
* When `resizable` is enabled, this defines the default width and constraints
|
|
181
|
+
* (min/max bounds for dragging). Use `currentWidth` to control the displayed width.
|
|
179
182
|
*/
|
|
180
183
|
width?: PaneWidth | CustomWidthOptions;
|
|
181
184
|
/**
|
|
@@ -190,7 +193,7 @@ export type PageLayoutSidebarProps = {
|
|
|
190
193
|
resizable?: boolean;
|
|
191
194
|
/**
|
|
192
195
|
* localStorage key used to persist the sidebar width across sessions.
|
|
193
|
-
* Only applies when `resizable` is `true
|
|
196
|
+
* Only applies when `resizable` is `true` and no `onResizeEnd` callback is provided.
|
|
194
197
|
* When omitted, localStorage is not used.
|
|
195
198
|
*/
|
|
196
199
|
widthStorageKey?: string;
|
|
@@ -226,9 +229,24 @@ export type PageLayoutSidebarProps = {
|
|
|
226
229
|
className?: string;
|
|
227
230
|
style?: React.CSSProperties;
|
|
228
231
|
};
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
+
export type PageLayoutSidebarProps = PageLayoutSidebarBaseProps & ({
|
|
233
|
+
/**
|
|
234
|
+
* Callback fired when a resize operation ends (drag release or keyboard key up).
|
|
235
|
+
* When provided, this callback is used instead of localStorage persistence.
|
|
236
|
+
*/
|
|
237
|
+
onResizeEnd: (width: number) => void;
|
|
238
|
+
/**
|
|
239
|
+
* Current/controlled width value in pixels.
|
|
240
|
+
* When provided, this is used as the current sidebar width instead of internal state.
|
|
241
|
+
* The `width` prop still defines the default used when resetting (e.g., double-click).
|
|
242
|
+
* Pass `undefined` when the persisted value has not loaded yet (e.g., async fetch).
|
|
243
|
+
*/
|
|
244
|
+
currentWidth: number | undefined;
|
|
245
|
+
} | {
|
|
246
|
+
onResizeEnd?: never;
|
|
247
|
+
currentWidth?: never;
|
|
248
|
+
});
|
|
249
|
+
declare const Sidebar: React.ForwardRefExoticComponent<React.PropsWithChildren<PageLayoutSidebarProps> & React.RefAttributes<HTMLDivElement>>;
|
|
232
250
|
export type PageLayoutFooterProps = {
|
|
233
251
|
/**
|
|
234
252
|
* A unique label for the rendered contentinfo landmark
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../src/PageLayout/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAQhE,OAAO,KAAK,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAA;AACpE,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAA;AAQvB,QAAA,MAAM,WAAW;;;;CAIhB,CAAA;AAuBD,MAAM,MAAM,eAAe,GAAG;IAC5B,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;IACvD,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,OAAO,WAAW,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,OAAO,WAAW,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,OAAO,WAAW,CAAA;IAEpC,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,GAAG,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;IACzE,SAAS,CAAC,EAAE,MAAM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H,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAC3D,OAAO,CAAC,EAAE,MAAM,OAAO,WAAW,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,eAAe,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAA;IACxF;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;IAC1D,MAAM,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,CAAA;AA8DD,eAAO,MAAM,UAAU;;;UAGP,cAAc,CAAC,OAAO,IAAI,CAAC;aACrB,cAAc,CAAC,OAAO,OAAO,CAAC;;CAElD,CAAA"}
|
|
@@ -99,6 +99,7 @@ const RootWrapper = /*#__PURE__*/memo(({
|
|
|
99
99
|
...style
|
|
100
100
|
},
|
|
101
101
|
className: clsx(classes.PageLayoutRoot, className),
|
|
102
|
+
"data-component": "PageLayout",
|
|
102
103
|
"data-has-sidebar": hasSidebar || undefined,
|
|
103
104
|
children: children
|
|
104
105
|
});
|
|
@@ -119,6 +120,7 @@ const HorizontalDivider = /*#__PURE__*/memo(({
|
|
|
119
120
|
} = React.useContext(PageLayoutContext);
|
|
120
121
|
return /*#__PURE__*/jsx("div", {
|
|
121
122
|
className: clsx(classes.HorizontalDivider, className),
|
|
123
|
+
"data-component": "PageLayout.HorizontalDivider",
|
|
122
124
|
...getResponsiveAttributes('variant', variant),
|
|
123
125
|
...getResponsiveAttributes('position', position),
|
|
124
126
|
style: {
|
|
@@ -137,6 +139,7 @@ const VerticalDivider = /*#__PURE__*/memo(({
|
|
|
137
139
|
}) => {
|
|
138
140
|
return /*#__PURE__*/jsx("div", {
|
|
139
141
|
className: clsx(classes.VerticalDivider, className),
|
|
142
|
+
"data-component": "PageLayout.VerticalDivider",
|
|
140
143
|
...getResponsiveAttributes('variant', variant),
|
|
141
144
|
...getResponsiveAttributes('position', position),
|
|
142
145
|
style: style,
|
|
@@ -396,6 +399,7 @@ const DragHandle = /*#__PURE__*/memo(function DragHandle({
|
|
|
396
399
|
return /*#__PURE__*/jsx("div", {
|
|
397
400
|
ref: handleRef,
|
|
398
401
|
className: classes.DraggableHandle,
|
|
402
|
+
"data-component": "PageLayout.DragHandle",
|
|
399
403
|
role: "slider",
|
|
400
404
|
"aria-label": "Draggable pane splitter",
|
|
401
405
|
"aria-valuemin": ariaValueMin,
|
|
@@ -438,6 +442,7 @@ const Header = ({
|
|
|
438
442
|
return /*#__PURE__*/jsxs("header", {
|
|
439
443
|
"aria-label": label,
|
|
440
444
|
"aria-labelledby": labelledBy,
|
|
445
|
+
"data-component": "PageLayout.Header",
|
|
441
446
|
...getResponsiveAttributes('hidden', hidden),
|
|
442
447
|
className: clsx(classes.Header, className),
|
|
443
448
|
style: {
|
|
@@ -485,6 +490,7 @@ const Content = ({
|
|
|
485
490
|
ref: contentWrapperRef,
|
|
486
491
|
"aria-label": label,
|
|
487
492
|
"aria-labelledby": labelledBy,
|
|
493
|
+
"data-component": "PageLayout.Content",
|
|
488
494
|
style: style,
|
|
489
495
|
className: clsx(classes.ContentWrapper, className),
|
|
490
496
|
...getResponsiveAttributes('is-hidden', hidden),
|
|
@@ -627,6 +633,7 @@ const Pane = /*#__PURE__*/React.forwardRef(({
|
|
|
627
633
|
id: paneId
|
|
628
634
|
}),
|
|
629
635
|
className: classes.Pane,
|
|
636
|
+
"data-component": "PageLayout.Pane",
|
|
630
637
|
"data-resizable": resizable || undefined,
|
|
631
638
|
style: {
|
|
632
639
|
'--spacing': `var(--spacing-${padding})`,
|
|
@@ -742,6 +749,8 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
|
|
|
742
749
|
position = 'start',
|
|
743
750
|
width = 'medium',
|
|
744
751
|
minWidth = 256,
|
|
752
|
+
currentWidth: controlledWidth,
|
|
753
|
+
onResizeEnd,
|
|
745
754
|
padding = 'none',
|
|
746
755
|
resizable = false,
|
|
747
756
|
widthStorageKey,
|
|
@@ -783,7 +792,9 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
|
|
|
783
792
|
paneRef: sidebarRef,
|
|
784
793
|
handleRef,
|
|
785
794
|
contentWrapperRef: sidebarContentWrapperRef,
|
|
786
|
-
constrainToViewport: true
|
|
795
|
+
constrainToViewport: true,
|
|
796
|
+
onResizeEnd,
|
|
797
|
+
currentWidth: controlledWidth
|
|
787
798
|
});
|
|
788
799
|
const mergedSidebarRef = useMergedRefs(forwardRef, sidebarRef);
|
|
789
800
|
const hasOverflow = useOverflow(sidebarRef);
|
|
@@ -827,14 +838,16 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
|
|
|
827
838
|
ref: mergedSidebarRef
|
|
828
839
|
// Suppress hydration mismatch for --pane-width when localStorage
|
|
829
840
|
// provides a width that differs from the server-rendered default.
|
|
841
|
+
// Not needed when onResizeEnd is provided (localStorage isn't read).
|
|
830
842
|
,
|
|
831
|
-
suppressHydrationWarning: resizable === true && !!widthStorageKey,
|
|
843
|
+
suppressHydrationWarning: resizable === true && !!widthStorageKey && !onResizeEnd,
|
|
832
844
|
...(hasOverflow ? overflowProps : {}),
|
|
833
845
|
...labelProp,
|
|
834
846
|
...(id && {
|
|
835
847
|
id: sidebarId
|
|
836
848
|
}),
|
|
837
849
|
className: classes.Sidebar,
|
|
850
|
+
"data-component": "PageLayout.Sidebar",
|
|
838
851
|
"data-resizable": resizable || undefined,
|
|
839
852
|
style: {
|
|
840
853
|
'--spacing': `var(--spacing-${padding})`,
|
|
@@ -891,6 +904,7 @@ const Footer = ({
|
|
|
891
904
|
return /*#__PURE__*/jsxs("footer", {
|
|
892
905
|
"aria-label": label,
|
|
893
906
|
"aria-labelledby": labelledBy,
|
|
907
|
+
"data-component": "PageLayout.Footer",
|
|
894
908
|
...getResponsiveAttributes('hidden', hidden),
|
|
895
909
|
className: clsx(classes.FooterWrapper, className),
|
|
896
910
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../src/Popover/Popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AACpC,OAAO,KAAe,MAAM,OAAO,CAAA;AAMnC,KAAK,aAAa,GACd,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,aAAa,GACb,UAAU,GACV,cAAc,GACd,WAAW,CAAA;AAEf,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,kBAAkB,GACpB,SAAS,CAAC,cAAc,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../src/Popover/Popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AACpC,OAAO,KAAe,MAAM,OAAO,CAAA;AAMnC,KAAK,aAAa,GACd,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,aAAa,GACb,UAAU,GACV,cAAc,GACd,WAAW,CAAA;AAEf,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,kBAAkB,GACpB,SAAS,CAAC,cAAc,CAAC,CAAA;AAoB3B,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAA;IACnE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAA;IACzE,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IAInD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAA;IAIzD,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAA;CACjD,GAAG,SAAS,CAAC,cAAc,CAAC,CAAA;;;;AAkC7B,wBAAgE"}
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -50,6 +50,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(t0, forwardRef) {
|
|
|
50
50
|
t5 = /*#__PURE__*/jsx("div", {
|
|
51
51
|
...props,
|
|
52
52
|
ref: forwardRef,
|
|
53
|
+
"data-component": "Popover",
|
|
53
54
|
"data-open": t2,
|
|
54
55
|
"data-relative": t3,
|
|
55
56
|
"data-caret": caret,
|
|
@@ -132,6 +133,7 @@ const PopoverContent = t0 => {
|
|
|
132
133
|
if ($[12] !== height || $[13] !== props || $[14] !== t5 || $[15] !== width) {
|
|
133
134
|
t6 = /*#__PURE__*/jsx("div", {
|
|
134
135
|
ref: divRef,
|
|
136
|
+
"data-component": "Popover.Content",
|
|
135
137
|
"data-width": width,
|
|
136
138
|
"data-height": height,
|
|
137
139
|
className: t5,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../src/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AASvC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAgC,GAAG,IAAI,CAE5F;AA4BD;;;GAGG;AACH,eAAO,MAAM,aAAa;0BACF,MAAM;EACxB,CAAA;AAEN,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../src/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AASvC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAgC,GAAG,IAAI,CAE5F;AA4BD;;;GAGG;AACH,eAAO,MAAM,aAAa;0BACF,MAAM;EACxB,CAAA;AAEN,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CA6CjE,CAAA"}
|
package/dist/Portal/Portal.js
CHANGED
|
@@ -62,6 +62,7 @@ const Portal = ({
|
|
|
62
62
|
// eslint-disable-next-line react-hooks/refs
|
|
63
63
|
if (!elementRef.current) {
|
|
64
64
|
const div = document.createElement('div');
|
|
65
|
+
div.setAttribute('data-component', 'Portal');
|
|
65
66
|
// Portaled content should get their own stacking context so they don't interfere
|
|
66
67
|
// with each other in unexpected ways. One should never find themselves tempted
|
|
67
68
|
// to change the zIndex to a value other than "1".
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,KAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GAAG;IACzE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,YAAY,CAAA;AAEhB,eAAO,MAAM,IAAI;mBAJA,MAAM;gBACT,MAAM;
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,KAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAA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