@primer/components 0.0.0-202182720420 → 0.0.0-202182722258
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 +2 -40
- package/dist/browser.esm.js +627 -670
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +389 -432
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Divider.js +1 -1
- package/lib/ActionList/Header.js +2 -2
- package/lib/ActionList/Item.js +13 -13
- package/lib/ActionList/List.js +1 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.js +2 -2
- package/lib/Autocomplete/Autocomplete.d.ts +26 -0
- package/lib/Autocomplete/Autocomplete.js +55 -0
- package/lib/Autocomplete/AutocompleteContext.d.ts +13 -0
- package/lib/Autocomplete/AutocompleteContext.js +15 -0
- package/lib/Autocomplete/AutocompleteInput.d.ts +9 -0
- package/lib/Autocomplete/AutocompleteInput.js +139 -0
- package/lib/Autocomplete/AutocompleteMenu.d.ts +67 -0
- package/lib/Autocomplete/AutocompleteMenu.js +284 -0
- package/lib/Autocomplete/index.d.ts +2 -0
- package/lib/Autocomplete/index.js +15 -0
- package/lib/Avatar.d.ts +0 -4
- package/lib/AvatarPair.js +1 -1
- package/lib/AvatarStack.d.ts +8 -4
- package/lib/AvatarStack.js +7 -6
- package/lib/Badge/Badge.d.ts +8 -0
- package/lib/Badge/Badge.js +59 -0
- package/lib/Badge/BadgeState.d.ts +13 -0
- package/lib/Badge/BadgeState.js +51 -0
- package/lib/Badge/_badgeStyleUtils.d.ts +3 -0
- package/lib/Badge/_badgeStyleUtils.js +39 -0
- package/lib/BranchName.js +1 -1
- package/lib/Breadcrumb.d.ts +23 -0
- package/lib/{Breadcrumbs.js → Breadcrumb.js} +23 -33
- package/lib/Button/Button.d.ts +1 -0
- package/lib/Button/Button.js +1 -1
- package/lib/Button/ButtonClose.d.ts +2 -1
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonDanger.d.ts +1 -0
- package/lib/Button/ButtonInvisible.d.ts +1 -0
- package/lib/Button/ButtonInvisible.js +1 -1
- package/lib/Button/ButtonOutline.d.ts +1 -0
- package/lib/Button/ButtonPrimary.d.ts +1 -0
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleOcticon.d.ts +1 -0
- package/lib/CircleOcticon.js +1 -1
- package/lib/CounterLabel.js +2 -2
- package/lib/Dialog/ConfirmationDialog.js +1 -1
- package/lib/Dialog/Dialog.js +9 -9
- package/lib/Dialog.d.ts +3 -2
- package/lib/Dialog.js +4 -4
- package/lib/Dropdown.d.ts +4 -0
- package/lib/Dropdown.js +2 -2
- package/lib/DropdownMenu/DropdownButton.d.ts +2 -1
- package/lib/DropdownStyles.js +6 -6
- package/lib/FilterList.d.ts +1 -0
- package/lib/FilterList.js +1 -1
- package/lib/FilteredActionList/FilteredActionList.js +8 -34
- package/lib/Flash.js +1 -1
- package/lib/Label.js +2 -2
- package/lib/Link.js +1 -1
- package/lib/Overlay.d.ts +2 -1
- package/lib/Overlay.js +11 -6
- package/lib/Pagehead.js +1 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Popover.js +1 -1
- package/lib/Position.d.ts +4 -4
- package/lib/ProgressBar.js +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +344 -15
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.js +2 -2
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectPanel/SelectPanel.js +2 -3
- package/lib/SideNav.js +5 -5
- package/lib/StateLabel.js +1 -1
- package/lib/SubNav.js +1 -1
- package/lib/TabNav.js +2 -2
- package/lib/TextInput.d.ts +10 -7
- package/lib/TextInput.js +24 -29
- package/lib/TextInputTokens.d.ts +43 -0
- package/lib/TextInputTokens.js +227 -0
- package/lib/TextInputWithTokens.d.ts +41 -0
- package/lib/TextInputWithTokens.js +396 -0
- package/lib/Timeline.d.ts +1 -0
- package/lib/Timeline.js +19 -16
- package/lib/Token/Token.d.ts +7 -0
- package/lib/Token/Token.js +63 -0
- package/lib/Token/TokenBase.d.ts +16 -0
- package/lib/Token/TokenBase.js +76 -0
- package/lib/Token/TokenLabel.d.ts +10 -0
- package/lib/Token/TokenLabel.js +115 -0
- package/lib/Token/TokenProfile.d.ts +7 -0
- package/lib/Token/TokenProfile.js +45 -0
- package/lib/Token/_RemoveTokenButton.d.ts +3 -0
- package/lib/Token/_RemoveTokenButton.js +43 -0
- package/lib/Token/_tokenButtonUtils.d.ts +9 -0
- package/lib/Token/_tokenButtonUtils.js +42 -0
- package/lib/Tooltip.js +1 -1
- package/lib/UnderlineNav.js +2 -2
- package/lib/_UnstyledTextInput.d.ts +2 -0
- package/lib/_UnstyledTextInput.js +20 -0
- package/lib/hooks/useOverlay.d.ts +2 -1
- package/lib/hooks/useOverlay.js +11 -6
- package/lib/index.d.ts +2 -3
- package/lib/index.js +2 -22
- package/lib/theme-preval.d.ts +6 -12
- package/lib/theme-preval.js +0 -940
- package/lib/utils/scrollIntoViewingArea.d.ts +1 -0
- package/lib/utils/scrollIntoViewingArea.js +39 -0
- package/lib/utils/testing.d.ts +0 -1854
- package/lib/utils/types.d.ts +3 -0
- package/lib/utils/uniqueId.js +0 -1
- package/lib-esm/ActionList/Divider.js +1 -1
- package/lib-esm/ActionList/Header.js +2 -2
- package/lib-esm/ActionList/Item.js +14 -14
- package/lib-esm/ActionList/List.js +1 -1
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +3 -3
- package/lib-esm/Autocomplete/Autocomplete.d.ts +26 -0
- package/lib-esm/Autocomplete/Autocomplete.js +36 -0
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +13 -0
- package/lib-esm/Autocomplete/AutocompleteContext.js +6 -0
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +9 -0
- package/lib-esm/Autocomplete/AutocompleteInput.js +120 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +67 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.js +258 -0
- package/lib-esm/Autocomplete/index.d.ts +2 -0
- package/lib-esm/Autocomplete/index.js +1 -0
- package/lib-esm/Avatar.d.ts +0 -4
- package/lib-esm/AvatarPair.js +1 -1
- package/lib-esm/AvatarStack.d.ts +8 -4
- package/lib-esm/AvatarStack.js +8 -7
- package/lib-esm/Badge/Badge.d.ts +8 -0
- package/lib-esm/Badge/Badge.js +44 -0
- package/lib-esm/Badge/BadgeState.d.ts +13 -0
- package/lib-esm/Badge/BadgeState.js +40 -0
- package/lib-esm/Badge/_badgeStyleUtils.d.ts +3 -0
- package/lib-esm/Badge/_badgeStyleUtils.js +29 -0
- package/lib-esm/BranchName.js +1 -1
- package/lib-esm/Breadcrumb.d.ts +23 -0
- package/lib-esm/{Breadcrumbs.js → Breadcrumb.js} +21 -30
- package/lib-esm/Button/Button.d.ts +1 -0
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +2 -1
- package/lib-esm/Button/ButtonClose.js +1 -1
- package/lib-esm/Button/ButtonDanger.d.ts +1 -0
- package/lib-esm/Button/ButtonInvisible.d.ts +1 -0
- package/lib-esm/Button/ButtonInvisible.js +1 -1
- package/lib-esm/Button/ButtonOutline.d.ts +1 -0
- package/lib-esm/Button/ButtonPrimary.d.ts +1 -0
- package/lib-esm/Button/ButtonTableList.js +1 -1
- package/lib-esm/CircleBadge.js +1 -1
- package/lib-esm/CircleOcticon.d.ts +1 -0
- package/lib-esm/CircleOcticon.js +1 -1
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog/ConfirmationDialog.js +1 -1
- package/lib-esm/Dialog/Dialog.js +8 -8
- package/lib-esm/Dialog.d.ts +3 -2
- package/lib-esm/Dialog.js +4 -4
- package/lib-esm/Dropdown.d.ts +4 -0
- package/lib-esm/Dropdown.js +2 -2
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +2 -1
- package/lib-esm/DropdownStyles.js +6 -6
- package/lib-esm/FilterList.d.ts +1 -0
- package/lib-esm/FilterList.js +1 -1
- package/lib-esm/FilteredActionList/FilteredActionList.js +6 -34
- package/lib-esm/Flash.js +1 -1
- package/lib-esm/Label.js +2 -2
- package/lib-esm/Link.js +1 -1
- package/lib-esm/Overlay.d.ts +2 -1
- package/lib-esm/Overlay.js +9 -6
- package/lib-esm/Pagehead.js +1 -1
- package/lib-esm/Pagination/Pagination.js +1 -1
- package/lib-esm/Popover.js +1 -1
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/ProgressBar.js +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +344 -15
- package/lib-esm/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuItem.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuList.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib-esm/SelectPanel/SelectPanel.js +2 -3
- package/lib-esm/SideNav.js +5 -5
- package/lib-esm/StateLabel.js +1 -1
- package/lib-esm/SubNav.js +1 -1
- package/lib-esm/TabNav.js +2 -2
- package/lib-esm/TextInput.d.ts +10 -7
- package/lib-esm/TextInput.js +23 -29
- package/lib-esm/TextInputTokens.d.ts +43 -0
- package/lib-esm/TextInputTokens.js +200 -0
- package/lib-esm/TextInputWithTokens.d.ts +41 -0
- package/lib-esm/TextInputWithTokens.js +361 -0
- package/lib-esm/Timeline.d.ts +1 -0
- package/lib-esm/Timeline.js +17 -12
- package/lib-esm/Token/Token.d.ts +7 -0
- package/lib-esm/Token/Token.js +44 -0
- package/lib-esm/Token/TokenBase.d.ts +16 -0
- package/lib-esm/Token/TokenBase.js +56 -0
- package/lib-esm/Token/TokenLabel.d.ts +10 -0
- package/lib-esm/Token/TokenLabel.js +99 -0
- package/lib-esm/Token/TokenProfile.d.ts +7 -0
- package/lib-esm/Token/TokenProfile.js +28 -0
- package/lib-esm/Token/_RemoveTokenButton.d.ts +3 -0
- package/lib-esm/Token/_RemoveTokenButton.js +28 -0
- package/lib-esm/Token/_tokenButtonUtils.d.ts +9 -0
- package/lib-esm/Token/_tokenButtonUtils.js +26 -0
- package/lib-esm/Tooltip.js +1 -1
- package/lib-esm/UnderlineNav.js +2 -2
- package/lib-esm/_UnstyledTextInput.d.ts +2 -0
- package/lib-esm/_UnstyledTextInput.js +7 -0
- package/lib-esm/hooks/useOverlay.d.ts +2 -1
- package/lib-esm/hooks/useOverlay.js +11 -6
- package/lib-esm/index.d.ts +2 -3
- package/lib-esm/index.js +2 -3
- package/lib-esm/theme-preval.d.ts +6 -12
- package/lib-esm/theme-preval.js +0 -940
- package/lib-esm/utils/scrollIntoViewingArea.d.ts +1 -0
- package/lib-esm/utils/scrollIntoViewingArea.js +30 -0
- package/lib-esm/utils/testing.d.ts +0 -1854
- package/lib-esm/utils/types.d.ts +3 -0
- package/lib-esm/utils/uniqueId.js +0 -1
- package/package.json +14 -14
- package/lib/Breadcrumbs.d.ts +0 -40
- package/lib/utils/ssr.d.ts +0 -1
- package/lib/utils/ssr.js +0 -19
- package/lib-esm/Breadcrumbs.d.ts +0 -40
- package/lib-esm/utils/ssr.d.ts +0 -1
- package/lib-esm/utils/ssr.js +0 -1
package/lib/hooks/useOverlay.js
CHANGED
@@ -19,14 +19,19 @@ const useOverlay = ({
|
|
19
19
|
initialFocusRef,
|
20
20
|
onEscape,
|
21
21
|
ignoreClickRefs,
|
22
|
-
onClickOutside
|
22
|
+
onClickOutside,
|
23
|
+
preventFocusOnOpen
|
23
24
|
}) => {
|
24
25
|
const overlayRef = (0, _useProvidedRefOrCreate.useProvidedRefOrCreate)(_overlayRef);
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
|
27
|
+
if (!preventFocusOnOpen) {
|
28
|
+
(0, _useOpenAndCloseFocus.useOpenAndCloseFocus)({
|
29
|
+
containerRef: overlayRef,
|
30
|
+
returnFocusRef,
|
31
|
+
initialFocusRef
|
32
|
+
});
|
33
|
+
}
|
34
|
+
|
30
35
|
(0, _useOnOutsideClick.useOnOutsideClick)({
|
31
36
|
containerRef: overlayRef,
|
32
37
|
ignoreClickRefs,
|
package/lib/index.d.ts
CHANGED
@@ -32,8 +32,8 @@ export { default as AvatarStack } from './AvatarStack';
|
|
32
32
|
export type { AvatarStackProps } from './AvatarStack';
|
33
33
|
export { default as BranchName } from './BranchName';
|
34
34
|
export type { BranchNameProps } from './BranchName';
|
35
|
-
export { default as
|
36
|
-
export type {
|
35
|
+
export { default as Breadcrumb } from './Breadcrumb';
|
36
|
+
export type { BreadcrumbProps, BreadcrumbItemProps } from './Breadcrumb';
|
37
37
|
export { default as Button, ButtonDanger, ButtonOutline, ButtonPrimary, ButtonInvisible, ButtonTableList, ButtonClose, ButtonGroup } from './Button';
|
38
38
|
export type { ButtonProps, ButtonDangerProps, ButtonOutlineProps, ButtonPrimaryProps, ButtonInvisibleProps, ButtonTableListProps, ButtonCloseProps, ButtonGroupProps } from './Button';
|
39
39
|
export { default as Caret } from './Caret';
|
@@ -108,4 +108,3 @@ export { default as Truncate } from './Truncate';
|
|
108
108
|
export type { TruncateProps } from './Truncate';
|
109
109
|
export { default as UnderlineNav } from './UnderlineNav';
|
110
110
|
export type { UnderlineNavProps, UnderlineNavLinkProps } from './UnderlineNav';
|
111
|
-
export { SSRProvider, useSSRSafeId } from './utils/ssr';
|
package/lib/index.js
CHANGED
@@ -177,16 +177,10 @@ Object.defineProperty(exports, "BranchName", {
|
|
177
177
|
return _BranchName.default;
|
178
178
|
}
|
179
179
|
});
|
180
|
-
Object.defineProperty(exports, "Breadcrumbs", {
|
181
|
-
enumerable: true,
|
182
|
-
get: function () {
|
183
|
-
return _Breadcrumbs.default;
|
184
|
-
}
|
185
|
-
});
|
186
180
|
Object.defineProperty(exports, "Breadcrumb", {
|
187
181
|
enumerable: true,
|
188
182
|
get: function () {
|
189
|
-
return
|
183
|
+
return _Breadcrumb.default;
|
190
184
|
}
|
191
185
|
});
|
192
186
|
Object.defineProperty(exports, "Button", {
|
@@ -459,18 +453,6 @@ Object.defineProperty(exports, "UnderlineNav", {
|
|
459
453
|
return _UnderlineNav.default;
|
460
454
|
}
|
461
455
|
});
|
462
|
-
Object.defineProperty(exports, "SSRProvider", {
|
463
|
-
enumerable: true,
|
464
|
-
get: function () {
|
465
|
-
return _ssr.SSRProvider;
|
466
|
-
}
|
467
|
-
});
|
468
|
-
Object.defineProperty(exports, "useSSRSafeId", {
|
469
|
-
enumerable: true,
|
470
|
-
get: function () {
|
471
|
-
return _ssr.useSSRSafeId;
|
472
|
-
}
|
473
|
-
});
|
474
456
|
|
475
457
|
var _theme = _interopRequireDefault(require("./theme"));
|
476
458
|
|
@@ -516,7 +498,7 @@ var _AvatarStack = _interopRequireDefault(require("./AvatarStack"));
|
|
516
498
|
|
517
499
|
var _BranchName = _interopRequireDefault(require("./BranchName"));
|
518
500
|
|
519
|
-
var
|
501
|
+
var _Breadcrumb = _interopRequireDefault(require("./Breadcrumb"));
|
520
502
|
|
521
503
|
var _Button = _interopRequireWildcard(require("./Button"));
|
522
504
|
|
@@ -592,8 +574,6 @@ var _Truncate = _interopRequireDefault(require("./Truncate"));
|
|
592
574
|
|
593
575
|
var _UnderlineNav = _interopRequireDefault(require("./UnderlineNav"));
|
594
576
|
|
595
|
-
var _ssr = require("./utils/ssr");
|
596
|
-
|
597
577
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
598
578
|
|
599
579
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/lib/theme-preval.d.ts
CHANGED
@@ -22,10 +22,6 @@ export namespace theme {
|
|
22
22
|
export { darkDimmedColors as colors };
|
23
23
|
export { darkDimmedShadows as shadows };
|
24
24
|
}
|
25
|
-
namespace dark_high_contrast {
|
26
|
-
export { darkHighContrastColors as colors };
|
27
|
-
export { darkHighContrastShadows as shadows };
|
28
|
-
}
|
29
25
|
}
|
30
26
|
}
|
31
27
|
declare namespace animation {
|
@@ -83,21 +79,19 @@ declare const darkDimmedColors: Partial<typeof primitives.colors.dark_dimmed>;
|
|
83
79
|
* @type Partial<typeof primitives.colors.dark_dimmed>
|
84
80
|
*/
|
85
81
|
declare const darkDimmedShadows: Partial<typeof primitives.colors.dark_dimmed>;
|
86
|
-
/**
|
87
|
-
* @type Partial<typeof primitives.colors.dark_dimmed>
|
88
|
-
*/
|
89
|
-
declare const darkHighContrastColors: Partial<typeof primitives.colors.dark_dimmed>;
|
90
|
-
/**
|
91
|
-
* @type Partial<typeof primitives.colors.dark_high_contrast>
|
92
|
-
*/
|
93
|
-
declare const darkHighContrastShadows: Partial<typeof primitives.colors.dark_high_contrast>;
|
94
82
|
import { default as primitives } from "@primer/primitives";
|
95
83
|
declare const light_2: {
|
96
84
|
colors: {};
|
85
|
+
/**
|
86
|
+
* @type Partial<typeof primitives.colors.light>
|
87
|
+
*/
|
97
88
|
shadows: {};
|
98
89
|
};
|
99
90
|
declare const dark_1: {
|
100
91
|
colors: {};
|
92
|
+
/**
|
93
|
+
* @type Partial<typeof primitives.colors.light>
|
94
|
+
*/
|
101
95
|
shadows: {};
|
102
96
|
};
|
103
97
|
export {};
|