@primer/react 38.29.0-rc.23ae17b6c → 38.29.0-rc.282c30cdc
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 -1
- 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/Overlay/Overlay.d.ts +1 -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/SelectPanel/SelectPanel.js +2 -1
- 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/TooltipV2/Tooltip.js +2 -1
- 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/index.js +3 -2
- 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/utils/story-helpers.d.ts +70 -0
- package/dist/utils/story-helpers.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -6,12 +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 Overlay from '../Overlay/Overlay.js';
|
|
15
16
|
|
|
16
17
|
const defaultVariant = {
|
|
17
18
|
regular: 'anchored',
|
|
@@ -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 };
|
|
@@ -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,24 +14,6 @@ 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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/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,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 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const heightMap: {
|
|
2
|
+
xsmall: string;
|
|
3
|
+
small: string;
|
|
4
|
+
medium: string;
|
|
5
|
+
large: string;
|
|
6
|
+
xlarge: string;
|
|
7
|
+
auto: string;
|
|
8
|
+
initial: string;
|
|
9
|
+
'fit-content': string;
|
|
10
|
+
};
|
|
11
|
+
export declare const widthMap: {
|
|
12
|
+
small: string;
|
|
13
|
+
medium: string;
|
|
14
|
+
large: string;
|
|
15
|
+
xlarge: string;
|
|
16
|
+
xxlarge: string;
|
|
17
|
+
auto: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/Overlay/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const heightMap = {
|
|
2
|
+
xsmall: '192px',
|
|
3
|
+
small: '256px',
|
|
4
|
+
medium: '320px',
|
|
5
|
+
large: '432px',
|
|
6
|
+
xlarge: '600px',
|
|
7
|
+
auto: 'auto',
|
|
8
|
+
initial: 'auto',
|
|
9
|
+
'fit-content': 'fit-content'
|
|
10
|
+
};
|
|
11
|
+
const widthMap = {
|
|
12
|
+
small: '256px',
|
|
13
|
+
medium: '320px',
|
|
14
|
+
large: '480px',
|
|
15
|
+
xlarge: '640px',
|
|
16
|
+
xxlarge: '960px',
|
|
17
|
+
auto: 'auto'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { heightMap, widthMap };
|
|
@@ -8,7 +8,7 @@ import { ButtonComponent } from '../Button/Button.js';
|
|
|
8
8
|
import { useId } from '../hooks/useId.js';
|
|
9
9
|
import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
|
|
10
10
|
import useSafeTimeout from '../hooks/useSafeTimeout.js';
|
|
11
|
-
import
|
|
11
|
+
import '../FilteredActionList/FilteredActionListLoaders.js';
|
|
12
12
|
import { announceFromElement, announce } from '@primer/live-region-element';
|
|
13
13
|
import classes from './SelectPanel.module.css.js';
|
|
14
14
|
import { clsx } from 'clsx';
|
|
@@ -22,6 +22,7 @@ import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
|
22
22
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
23
23
|
import { AnchoredOverlay } from '../AnchoredOverlay/AnchoredOverlay.js';
|
|
24
24
|
import Heading from '../Heading/Heading.js';
|
|
25
|
+
import { FilteredActionListLoadingTypes } from '../FilteredActionList/constants.js';
|
|
25
26
|
|
|
26
27
|
const SHORT_DELAY_MS = 500;
|
|
27
28
|
const LONG_DELAY_MS = 1000;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { TimelineBadgeVariants } from './constants';
|
|
2
3
|
type StyledTimelineProps = {
|
|
3
4
|
clipSidebar?: boolean | 'start' | 'end' | 'both';
|
|
4
5
|
className?: string;
|
|
@@ -13,7 +14,6 @@ type StyledTimelineItemProps = {
|
|
|
13
14
|
*/
|
|
14
15
|
export type TimelineItemsProps = StyledTimelineItemProps & React.ComponentPropsWithoutRef<'li'>;
|
|
15
16
|
export type TimelineItemProps = StyledTimelineItemProps & React.ComponentPropsWithoutRef<'li'>;
|
|
16
|
-
export declare const TimelineBadgeVariants: readonly ["accent", "success", "attention", "severe", "danger", "done", "open", "closed", "sponsors"];
|
|
17
17
|
export type TimelineBadgeVariant = (typeof TimelineBadgeVariants)[number];
|
|
18
18
|
export type TimelineBadgeProps = {
|
|
19
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;
|
|
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,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAEjG,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;AAyCpG,KAAK,uBAAuB,GAAG;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAExE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAA;AAE/F,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAA;AA8B9F,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qCAAqC;IACrC,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAYzC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAQzC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;AA6BtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,wBAAwB,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/Timeline/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,uGAUxB,CAAA"}
|
|
@@ -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,6 +1,8 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import TokenBase
|
|
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';
|
|
@@ -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,6 +1,8 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import TokenBase
|
|
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';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export declare const defaultTokenSize: TokenSizeKeys;
|
|
3
|
+
import { type TokenSizeKeys } from './constants';
|
|
4
|
+
export type { TokenSizeKeys };
|
|
7
5
|
export interface TokenBaseProps extends Omit<React.HTMLProps<HTMLSpanElement | HTMLButtonElement | HTMLAnchorElement>, 'size' | 'id'> {
|
|
8
6
|
as?: 'button' | 'a' | 'span';
|
|
9
7
|
/**
|
|
@@ -35,7 +33,6 @@ export interface TokenBaseProps extends Omit<React.HTMLProps<HTMLSpanElement | H
|
|
|
35
33
|
*/
|
|
36
34
|
disabled?: boolean;
|
|
37
35
|
}
|
|
38
|
-
export declare const isTokenInteractive: ({ as, onClick, onFocus, tabIndex, disabled, }: Pick<ComponentProps<typeof TokenBase>, "disabled" | "as" | "onClick" | "onFocus" | "tabIndex">) => boolean;
|
|
39
36
|
declare const TokenBase: PolymorphicForwardRefComponent<"span" | "a" | "button", TokenBaseProps>;
|
|
40
37
|
export default TokenBase;
|
|
41
38
|
//# sourceMappingURL=TokenBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenBase.d.ts","sourceRoot":"","sources":["../../src/Token/TokenBase.tsx"],"names":[],"mappings":"
|
|
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
|
@@ -2,21 +2,10 @@ import { c } from 'react-compiler-runtime';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import classes from './TokenBase.module.css.js';
|
|
5
|
+
import { defaultTokenSize } from './constants.js';
|
|
6
|
+
import { isTokenInteractive } from './utils.js';
|
|
5
7
|
import { jsx } from 'react/jsx-runtime';
|
|
6
8
|
|
|
7
|
-
const defaultTokenSize = 'medium';
|
|
8
|
-
const isTokenInteractive = ({
|
|
9
|
-
as = 'span',
|
|
10
|
-
onClick,
|
|
11
|
-
onFocus,
|
|
12
|
-
tabIndex = -1,
|
|
13
|
-
disabled
|
|
14
|
-
}) => {
|
|
15
|
-
if (disabled) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return Boolean(onFocus || onClick || tabIndex > -1 || ['a', 'button'].includes(as));
|
|
19
|
-
};
|
|
20
9
|
const TokenBase = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
21
10
|
const $ = c(25);
|
|
22
11
|
let Component;
|
|
@@ -126,4 +115,4 @@ const TokenBase = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
126
115
|
return t7;
|
|
127
116
|
});
|
|
128
117
|
|
|
129
|
-
export { TokenBase as default
|
|
118
|
+
export { TokenBase as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XIcon } from '@primer/octicons-react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { defaultTokenSize } from './
|
|
3
|
+
import { defaultTokenSize } from './constants.js';
|
|
4
4
|
import classes from './_RemoveTokenButton.module.css.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/Token/constants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEnE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAKpD,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,aAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/Token/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAE/C,eAAO,MAAM,kBAAkB,GAAI,+CAMhC,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,YAK9E,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const isTokenInteractive = ({
|
|
2
|
+
as = 'span',
|
|
3
|
+
onClick,
|
|
4
|
+
onFocus,
|
|
5
|
+
tabIndex = -1,
|
|
6
|
+
disabled
|
|
7
|
+
}) => {
|
|
8
|
+
if (disabled) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return Boolean(onFocus || onClick || tabIndex > -1 || ['a', 'button'].includes(as));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { isTokenInteractive };
|
|
@@ -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: () => {},
|
|
@@ -16,6 +16,5 @@ export type UnderlineNavProps = {
|
|
|
16
16
|
variant?: 'inset' | 'flush';
|
|
17
17
|
};
|
|
18
18
|
export declare const MORE_BTN_WIDTH = 86;
|
|
19
|
-
export declare const getValidChildren: (children: React.ReactNode) => React.ReactElement<any>[];
|
|
20
19
|
export declare const UnderlineNav: React.ForwardRefExoticComponent<UnderlineNavProps & React.RefAttributes<unknown>>;
|
|
21
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"}
|
|
@@ -13,6 +13,7 @@ import { ActionList } from '../ActionList/index.js';
|
|
|
13
13
|
import { invariant } from '../utils/invariant.js';
|
|
14
14
|
import classes from './UnderlineNav.module.css.js';
|
|
15
15
|
import { getAnchoredPosition } from '@primer/behaviors';
|
|
16
|
+
import { getValidChildren } from './utils.js';
|
|
16
17
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
17
18
|
import { ButtonComponent } from '../Button/Button.js';
|
|
18
19
|
import CounterLabel from '../CounterLabel/CounterLabel.js';
|
|
@@ -82,10 +83,6 @@ const overflowEffect = (navWidth, moreMenuWidth, childArray, childWidthArray, no
|
|
|
82
83
|
menuItems
|
|
83
84
|
}, iconsVisible, true);
|
|
84
85
|
};
|
|
85
|
-
const getValidChildren = children => {
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
-
return React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child));
|
|
88
|
-
};
|
|
89
86
|
const calculatePossibleItems = (childWidthArray, navWidth, moreMenuWidth = 0) => {
|
|
90
87
|
const widthToFit = navWidth - moreMenuWidth;
|
|
91
88
|
let breakpoint = childWidthArray.length; // assume all items will fit
|
|
@@ -378,4 +375,4 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
378
375
|
});
|
|
379
376
|
UnderlineNav.displayName = 'UnderlineNav';
|
|
380
377
|
|
|
381
|
-
export { MORE_BTN_WIDTH, UnderlineNav
|
|
378
|
+
export { MORE_BTN_WIDTH, UnderlineNav };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,gBAAgB,GAAI,UAAU,KAAK,CAAC,SAAS,KAEgC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAChH,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const getValidChildren = children => {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
return React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child));
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { getValidChildren };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPanel.d.ts","sourceRoot":"","sources":["../../../src/experimental/SelectPanel2/SelectPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAGvE,OAAO,KAAK,EAAC,WAAW,EAAE,cAAc,EAAmB,SAAS,EAAE,aAAa,EAAC,MAAM,aAAa,CAAA;AAevG,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"SelectPanel.d.ts","sourceRoot":"","sources":["../../../src/experimental/SelectPanel2/SelectPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAGvE,OAAO,KAAK,EAAC,WAAW,EAAE,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,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAydD,MAAM,MAAM,+BAA+B,GAAG;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,GAAG,CACxE,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,GAC7D,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,GACxC,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,aAAa,CAAC,CACvD,CAAA;AAwBD,MAAM,MAAM,uBAAuB,GAAG;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,GAAG,CAChE;IACE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;CACvC,GACD;IACE,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,OAAO,EAAE,SAAS,GAAG,OAAO,CAAA;CAC7B,CACJ,CAAA;AAqCD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;iBAtRoE,MAAM,IAAI;;;;;;;;;4BA6NxC,KAAK,CAAC,iBAAiB;;;CAiEnF,CAAA"}
|
|
@@ -2,7 +2,8 @@ import React, { useState, useEffect } from 'react';
|
|
|
2
2
|
import { AlertIcon, SearchIcon, XCircleFillIcon, ArrowLeftIcon, FilterRemoveIcon, XIcon } from '@primer/octicons-react';
|
|
3
3
|
import { ActionListContainerContext } from '../../ActionList/ActionListContainerContext.js';
|
|
4
4
|
import { useSlots } from '../../hooks/useSlots.js';
|
|
5
|
-
import { BaseOverlay
|
|
5
|
+
import { BaseOverlay } from '../../Overlay/Overlay.js';
|
|
6
|
+
import { heightMap } from '../../Overlay/constants.js';
|
|
6
7
|
import { InputLabel } from '../../internal/components/InputLabel.js';
|
|
7
8
|
import { invariant } from '../../utils/invariant.js';
|
|
8
9
|
import { useResponsiveValue } from '../../hooks/useResponsiveValue.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/experimental/SelectPanel2/index.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/experimental/SelectPanel2/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,YAAY,EAAC,uBAAuB,EAAE,gBAAgB,EAAE,+BAA+B,EAAC,MAAM,eAAe,CAAA"}
|
|
@@ -14,11 +14,11 @@ export { DataTable } from '../DataTable/DataTable.js';
|
|
|
14
14
|
export { DefaultFeatureFlags } from '../FeatureFlags/DefaultFeatureFlags.js';
|
|
15
15
|
export { Dialog } from '../Dialog/Dialog.js';
|
|
16
16
|
export { FeatureFlags } from '../FeatureFlags/FeatureFlags.js';
|
|
17
|
-
export { FilteredActionListLoadingTypes } from '../FilteredActionList/
|
|
17
|
+
export { FilteredActionListLoadingTypes } from '../FilteredActionList/constants.js';
|
|
18
18
|
export { Hidden } from '../Hidden/Hidden.js';
|
|
19
19
|
export { InlineMessage } from '../InlineMessage/InlineMessage.js';
|
|
20
20
|
export { IssueLabel } from './IssueLabel/IssueLabel.js';
|
|
21
|
-
export { KeybindingHint
|
|
21
|
+
export { KeybindingHint } from '../KeybindingHint/KeybindingHint.js';
|
|
22
22
|
export { NavList } from '../NavList/NavList.js';
|
|
23
23
|
export { PageHeader } from '../PageHeader/PageHeader.js';
|
|
24
24
|
export { ScrollableRegion } from '../ScrollableRegion/ScrollableRegion.js';
|
|
@@ -30,6 +30,7 @@ export { Tabs, useTab, useTabList, useTabPanel } from './Tabs/Tabs.js';
|
|
|
30
30
|
export { Tooltip } from '../TooltipV2/Tooltip.js';
|
|
31
31
|
export { default as UnderlinePanels } from './UnderlinePanels/UnderlinePanels.js';
|
|
32
32
|
export { createColumnHelper } from '../DataTable/column.js';
|
|
33
|
+
export { getAccessibleKeybindingHintString } from '../KeybindingHint/utils.js';
|
|
33
34
|
export { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
34
35
|
export { useOverflow } from '../hooks/useOverflow.js';
|
|
35
36
|
export { useSlots } from '../hooks/useSlots.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type MediaQueryFeatures } from './MatchMediaContext';
|
|
3
|
+
type MatchMediaProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
features?: MediaQueryFeatures;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Use `MatchMedia` to emulate media conditions by passing in feature
|
|
9
|
+
* queries to the `features` prop. If a component uses `useMedia` with the
|
|
10
|
+
* feature passed in to `MatchMedia` it will force its value to match what is
|
|
11
|
+
* provided to `MatchMedia`
|
|
12
|
+
*
|
|
13
|
+
* This should be used for development and documentation only in situations
|
|
14
|
+
* where devtools cannot emulate this feature
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <MatchMedia features={{ "(pointer: coarse)": true}}>
|
|
18
|
+
* <Children />
|
|
19
|
+
* </MatchMedia>
|
|
20
|
+
*/
|
|
21
|
+
export declare function MatchMedia({ children, features }: MatchMediaProps): React.JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=MatchMedia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchMedia.d.ts","sourceRoot":"","sources":["../../src/hooks/MatchMedia.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAoB,KAAK,kBAAkB,EAAC,MAAM,qBAAqB,CAAA;AAE9E,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B,CAAA;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EAAC,QAAQ,EAAE,QAA0B,EAAC,EAAE,eAAe,qBAGjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchMediaContext.d.ts","sourceRoot":"","sources":["../../src/hooks/MatchMediaContext.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CACnC,CAAA;AAKD,eAAO,MAAM,iBAAiB,6CAAwC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
// Used to keep track of overrides to specific media query features, this should
|
|
4
|
+
// be used for development and demo purposes to emulate specific features if
|
|
5
|
+
// unavailable through devtools
|
|
6
|
+
const MatchMediaContext = /*#__PURE__*/createContext({});
|
|
7
|
+
|
|
8
|
+
export { MatchMediaContext };
|
package/dist/hooks/useMedia.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* `useMedia` will use the given `mediaQueryString` with `matchMedia` to
|
|
4
3
|
* determine if the document matches the media query string.
|
|
@@ -13,27 +12,5 @@ import React from 'react';
|
|
|
13
12
|
* }
|
|
14
13
|
*/
|
|
15
14
|
export declare function useMedia(mediaQueryString: string, defaultState?: boolean): boolean;
|
|
16
|
-
|
|
17
|
-
[key: string]: boolean | undefined;
|
|
18
|
-
};
|
|
19
|
-
type MatchMediaProps = {
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
features?: MediaQueryFeatures;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Use `MatchMedia` to emulate media conditions by passing in feature
|
|
25
|
-
* queries to the `features` prop. If a component uses `useMedia` with the
|
|
26
|
-
* feature passed in to `MatchMedia` it will force its value to match what is
|
|
27
|
-
* provided to `MatchMedia`
|
|
28
|
-
*
|
|
29
|
-
* This should be used for development and documentation only in situations
|
|
30
|
-
* where devtools cannot emulate this feature
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* <MatchMedia features={{ "(pointer: coarse)": true}}>
|
|
34
|
-
* <Children />
|
|
35
|
-
* </MatchMedia>
|
|
36
|
-
*/
|
|
37
|
-
export declare function MatchMedia({ children, features }: MatchMediaProps): React.JSX.Element;
|
|
38
|
-
export {};
|
|
15
|
+
export { MatchMedia } from './MatchMedia';
|
|
39
16
|
//# sourceMappingURL=useMedia.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../src/hooks/useMedia.
|
|
1
|
+
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../src/hooks/useMedia.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,WAmExE;AAED,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA"}
|
package/dist/hooks/useMedia.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React, { useContext, useEffect
|
|
3
|
-
import '
|
|
2
|
+
import React, { useContext, useEffect } from 'react';
|
|
3
|
+
import { MatchMediaContext } from './MatchMediaContext.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* `useMedia` will use the given `mediaQueryString` with `matchMedia` to
|
|
7
|
+
* determine if the document matches the media query string.
|
|
8
|
+
*
|
|
9
|
+
* If `MatchMedia` is used as an ancestor, `useMedia` will instead use the
|
|
10
|
+
* value of the media query string, if available
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* function Example() {
|
|
14
|
+
* const coarsePointer = useMedia('(pointer: coarse)');
|
|
15
|
+
* // ...
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
5
18
|
function useMedia(mediaQueryString, defaultState) {
|
|
6
19
|
const $ = c(8);
|
|
7
20
|
const features = useContext(MatchMediaContext);
|
|
@@ -63,9 +76,5 @@ function useMedia(mediaQueryString, defaultState) {
|
|
|
63
76
|
useEffect(t1, t2);
|
|
64
77
|
return matches;
|
|
65
78
|
}
|
|
66
|
-
// Used to keep track of overrides to specific media query features, this should
|
|
67
|
-
// be used for development and demo purposes to emulate specific features if
|
|
68
|
-
// unavailable through devtools
|
|
69
|
-
const MatchMediaContext = /*#__PURE__*/createContext({});
|
|
70
79
|
|
|
71
80
|
export { useMedia };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { CheckboxGroup, FormControl } from '../index';
|
|
3
|
+
import type { ComponentProps } from './types';
|
|
4
|
+
import type { ArgTypes } from '@storybook/react';
|
|
5
|
+
import type { InputType } from 'storybook/internal/csf';
|
|
6
|
+
import type { Icon } from '@primer/octicons-react';
|
|
7
|
+
type CheckboxOrRadioGroupWrapperArgs = ComponentProps<typeof CheckboxGroup>;
|
|
8
|
+
type CheckboxOrRadioGroupLabelArgs = ComponentProps<typeof CheckboxGroup.Label> & {
|
|
9
|
+
labelChildren?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
type CheckboxOrRadioGroupCaptionArgs = ComponentProps<typeof CheckboxGroup.Caption> & {
|
|
12
|
+
captionChildren?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
type CheckboxOrRadioGroupValidationMessageArgs = ComponentProps<typeof CheckboxGroup.Validation> & {
|
|
15
|
+
validationChildren?: React.ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export type CheckboxOrRadioGroupArgs = CheckboxOrRadioGroupWrapperArgs & CheckboxOrRadioGroupLabelArgs & CheckboxOrRadioGroupCaptionArgs & CheckboxOrRadioGroupValidationMessageArgs;
|
|
18
|
+
type FormControlParentArgs = Pick<ComponentProps<typeof FormControl>, 'required' | 'disabled'>;
|
|
19
|
+
type FormControlLabelArgs = Omit<ComponentProps<typeof FormControl.Label>, 'as'> & {
|
|
20
|
+
labelChildren?: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
type FormControlCaptionArgs = ComponentProps<typeof FormControl.Caption> & {
|
|
23
|
+
captionChildren?: React.ReactNode;
|
|
24
|
+
};
|
|
25
|
+
type FormControlValidationMessageArgs = ComponentProps<typeof FormControl.Validation> & {
|
|
26
|
+
validationChildren?: React.ReactNode;
|
|
27
|
+
};
|
|
28
|
+
export type FormControlArgs<TInputProps = unknown> = FormControlParentArgs & FormControlLabelArgs & FormControlCaptionArgs & Partial<FormControlValidationMessageArgs> & // partial because we don't pass use validation for checkbox or radio
|
|
29
|
+
TInputProps;
|
|
30
|
+
export declare const inputWrapperArgTypes: ArgTypes;
|
|
31
|
+
export declare const getTextInputArgTypes: (category?: string) => Record<string, unknown>;
|
|
32
|
+
export declare const textInputExcludedControlKeys: string[];
|
|
33
|
+
export declare const textInputWithTokensArgTypes: ArgTypes;
|
|
34
|
+
export declare const formControlArgs: {
|
|
35
|
+
required: boolean;
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
labelChildren: string;
|
|
38
|
+
visuallyHidden: boolean;
|
|
39
|
+
captionChildren: string;
|
|
40
|
+
validationChildren: string;
|
|
41
|
+
variant: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const formControlArgTypes: ArgTypes;
|
|
44
|
+
export declare const formControlArgTypesWithoutValidation: Partial<Record<string | number, InputType>>;
|
|
45
|
+
export declare const getFormControlArgsByChildComponent: ({ captionChildren, disabled, labelChildren, required, validationChildren, variant, visuallyHidden, }: FormControlArgs) => {
|
|
46
|
+
parentArgs: {
|
|
47
|
+
disabled: boolean | undefined;
|
|
48
|
+
required: boolean | undefined;
|
|
49
|
+
};
|
|
50
|
+
labelArgs: {
|
|
51
|
+
visuallyHidden: boolean | undefined;
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
};
|
|
54
|
+
captionArgs: {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
};
|
|
57
|
+
validationArgs: {
|
|
58
|
+
children: React.ReactNode;
|
|
59
|
+
variant: import("./types/FormValidationStatus").FormValidationStatus | undefined;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const OcticonArgType: (iconList: Icon[]) => {
|
|
63
|
+
options: string[];
|
|
64
|
+
control: {
|
|
65
|
+
type: "select";
|
|
66
|
+
};
|
|
67
|
+
mapping: Record<string, Icon>;
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=story-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"story-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/story-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,UAAU,CAAA;AACxD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAC3C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAA;AAEhD,KAAK,+BAA+B,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAA;AAC3E,KAAK,6BAA6B,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG;IAChF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAChC,CAAA;AACD,KAAK,+BAA+B,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,G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