@primer/components 0.0.0-2021116165050 → 0.0.0-202111616587

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.
Files changed (135) hide show
  1. package/dist/browser.esm.js +2 -2
  2. package/dist/browser.esm.js.map +1 -1
  3. package/dist/browser.umd.js +2 -2
  4. package/dist/browser.umd.js.map +1 -1
  5. package/lib/ActionList/Item.js +3 -3
  6. package/lib/ActionList/List.js +2 -2
  7. package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +1 -1
  8. package/lib/Autocomplete/AutocompleteMenu.js +23 -11
  9. package/lib/Dialog/ConfirmationDialog.js +2 -2
  10. package/lib/Dialog/Dialog.js +2 -2
  11. package/lib/FilteredActionList/FilteredActionList.js +10 -3
  12. package/lib/Overlay.d.ts +1 -1
  13. package/lib/TextInputWithTokens.js +4 -4
  14. package/lib/hooks/useAnchoredPosition.d.ts +1 -1
  15. package/lib/hooks/useAnchoredPosition.js +2 -2
  16. package/lib/hooks/useFocusTrap.js +2 -2
  17. package/lib/hooks/useFocusZone.d.ts +1 -1
  18. package/lib/hooks/useFocusZone.js +2 -2
  19. package/lib/hooks/useOpenAndCloseFocus.js +2 -2
  20. package/lib/index.d.ts +0 -3
  21. package/lib/index.js +0 -24
  22. package/lib-esm/ActionList/Item.js +1 -1
  23. package/lib-esm/ActionList/List.js +1 -1
  24. package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +1 -1
  25. package/lib-esm/Autocomplete/AutocompleteMenu.js +22 -7
  26. package/lib-esm/Dialog/ConfirmationDialog.js +1 -1
  27. package/lib-esm/Dialog/Dialog.js +1 -1
  28. package/lib-esm/FilteredActionList/FilteredActionList.js +9 -3
  29. package/lib-esm/Overlay.d.ts +1 -1
  30. package/lib-esm/TextInputWithTokens.js +2 -2
  31. package/lib-esm/hooks/useAnchoredPosition.d.ts +1 -1
  32. package/lib-esm/hooks/useAnchoredPosition.js +1 -1
  33. package/lib-esm/hooks/useFocusTrap.js +1 -1
  34. package/lib-esm/hooks/useFocusZone.d.ts +1 -1
  35. package/lib-esm/hooks/useFocusZone.js +1 -1
  36. package/lib-esm/hooks/useOpenAndCloseFocus.js +1 -1
  37. package/lib-esm/index.d.ts +0 -3
  38. package/lib-esm/index.js +0 -3
  39. package/package.json +3 -6
  40. package/lib/CheckboxInputField.d.ts +0 -10
  41. package/lib/CheckboxInputField.js +0 -73
  42. package/lib/RadioInputField.d.ts +0 -9
  43. package/lib/RadioInputField.js +0 -74
  44. package/lib/TextInputField.d.ts +0 -583
  45. package/lib/TextInputField.js +0 -66
  46. package/lib/_InputCaption.d.ts +0 -13
  47. package/lib/_InputCaption.js +0 -26
  48. package/lib/_InputField/InputField.d.ts +0 -39
  49. package/lib/_InputField/InputField.js +0 -90
  50. package/lib/_InputField/InputFieldCaption.d.ts +0 -3
  51. package/lib/_InputField/InputFieldCaption.js +0 -30
  52. package/lib/_InputField/InputFieldLabel.d.ts +0 -9
  53. package/lib/_InputField/InputFieldLabel.js +0 -34
  54. package/lib/_InputField/InputFieldValidation.d.ts +0 -6
  55. package/lib/_InputField/InputFieldValidation.js +0 -17
  56. package/lib/_InputField/ToggleInputField.d.ts +0 -13
  57. package/lib/_InputField/ToggleInputField.js +0 -71
  58. package/lib/_InputField/ToggleInputLeadingVisual.d.ts +0 -3
  59. package/lib/_InputField/ToggleInputLeadingVisual.js +0 -22
  60. package/lib/_InputField/ValidationAnimationContainer.d.ts +0 -6
  61. package/lib/_InputField/ValidationAnimationContainer.js +0 -48
  62. package/lib/_InputField/index.d.ts +0 -1
  63. package/lib/_InputField/index.js +0 -15
  64. package/lib/_InputField/slots.d.ts +0 -13
  65. package/lib/_InputField/slots.js +0 -17
  66. package/lib/_InputLabel.d.ts +0 -8
  67. package/lib/_InputLabel.js +0 -44
  68. package/lib/_InputValidation.d.ts +0 -8
  69. package/lib/_InputValidation.js +0 -56
  70. package/lib/_VisuallyHidden.d.ts +0 -6
  71. package/lib/_VisuallyHidden.js +0 -39
  72. package/lib/behaviors/anchoredPosition.d.ts +0 -89
  73. package/lib/behaviors/anchoredPosition.js +0 -316
  74. package/lib/behaviors/focusTrap.d.ts +0 -12
  75. package/lib/behaviors/focusTrap.js +0 -179
  76. package/lib/behaviors/focusZone.d.ts +0 -137
  77. package/lib/behaviors/focusZone.js +0 -578
  78. package/lib/behaviors/scrollIntoViewingArea.d.ts +0 -1
  79. package/lib/behaviors/scrollIntoViewingArea.js +0 -39
  80. package/lib/utils/iterateFocusableElements.d.ts +0 -42
  81. package/lib/utils/iterateFocusableElements.js +0 -113
  82. package/lib/utils/types/FormValidationStatus.d.ts +0 -1
  83. package/lib/utils/types/FormValidationStatus.js +0 -1
  84. package/lib/utils/uniqueId.d.ts +0 -1
  85. package/lib/utils/uniqueId.js +0 -12
  86. package/lib/utils/userAgent.d.ts +0 -1
  87. package/lib/utils/userAgent.js +0 -15
  88. package/lib-esm/CheckboxInputField.d.ts +0 -10
  89. package/lib-esm/CheckboxInputField.js +0 -56
  90. package/lib-esm/RadioInputField.d.ts +0 -9
  91. package/lib-esm/RadioInputField.js +0 -56
  92. package/lib-esm/TextInputField.d.ts +0 -583
  93. package/lib-esm/TextInputField.js +0 -50
  94. package/lib-esm/_InputCaption.d.ts +0 -13
  95. package/lib-esm/_InputCaption.js +0 -15
  96. package/lib-esm/_InputField/InputField.d.ts +0 -39
  97. package/lib-esm/_InputField/InputField.js +0 -70
  98. package/lib-esm/_InputField/InputFieldCaption.d.ts +0 -3
  99. package/lib-esm/_InputField/InputFieldCaption.js +0 -18
  100. package/lib-esm/_InputField/InputFieldLabel.d.ts +0 -9
  101. package/lib-esm/_InputField/InputFieldLabel.js +0 -22
  102. package/lib-esm/_InputField/InputFieldValidation.d.ts +0 -6
  103. package/lib-esm/_InputField/InputFieldValidation.js +0 -7
  104. package/lib-esm/_InputField/ToggleInputField.d.ts +0 -13
  105. package/lib-esm/_InputField/ToggleInputField.js +0 -54
  106. package/lib-esm/_InputField/ToggleInputLeadingVisual.d.ts +0 -3
  107. package/lib-esm/_InputField/ToggleInputLeadingVisual.js +0 -11
  108. package/lib-esm/_InputField/ValidationAnimationContainer.d.ts +0 -6
  109. package/lib-esm/_InputField/ValidationAnimationContainer.js +0 -33
  110. package/lib-esm/_InputField/index.d.ts +0 -1
  111. package/lib-esm/_InputField/index.js +0 -1
  112. package/lib-esm/_InputField/slots.d.ts +0 -13
  113. package/lib-esm/_InputField/slots.js +0 -5
  114. package/lib-esm/_InputLabel.d.ts +0 -8
  115. package/lib-esm/_InputLabel.js +0 -32
  116. package/lib-esm/_InputValidation.d.ts +0 -8
  117. package/lib-esm/_InputValidation.js +0 -43
  118. package/lib-esm/_VisuallyHidden.d.ts +0 -6
  119. package/lib-esm/_VisuallyHidden.js +0 -26
  120. package/lib-esm/behaviors/anchoredPosition.d.ts +0 -89
  121. package/lib-esm/behaviors/anchoredPosition.js +0 -309
  122. package/lib-esm/behaviors/focusTrap.d.ts +0 -12
  123. package/lib-esm/behaviors/focusTrap.js +0 -170
  124. package/lib-esm/behaviors/focusZone.d.ts +0 -137
  125. package/lib-esm/behaviors/focusZone.js +0 -560
  126. package/lib-esm/behaviors/scrollIntoViewingArea.d.ts +0 -1
  127. package/lib-esm/behaviors/scrollIntoViewingArea.js +0 -30
  128. package/lib-esm/utils/iterateFocusableElements.d.ts +0 -42
  129. package/lib-esm/utils/iterateFocusableElements.js +0 -102
  130. package/lib-esm/utils/types/FormValidationStatus.d.ts +0 -1
  131. package/lib-esm/utils/types/FormValidationStatus.js +0 -1
  132. package/lib-esm/utils/uniqueId.d.ts +0 -1
  133. package/lib-esm/utils/uniqueId.js +0 -5
  134. package/lib-esm/utils/userAgent.d.ts +0 -1
  135. package/lib-esm/utils/userAgent.js +0 -8
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react';
2
- import { iterateFocusableElements } from '../utils/iterateFocusableElements';
2
+ import { iterateFocusableElements } from '@primer/behaviors/utils';
3
3
  export function useOpenAndCloseFocus({
4
4
  initialFocusRef,
5
5
  returnFocusRef,
@@ -48,7 +48,6 @@ export { default as CircleBadge } from './CircleBadge';
48
48
  export type { CircleBadgeProps, CircleBadgeIconProps } from './CircleBadge';
49
49
  export { default as CircleOcticon } from './CircleOcticon';
50
50
  export type { CircleOcticonProps } from './CircleOcticon';
51
- export { default as CheckboxInputField } from './CheckboxInputField';
52
51
  export { default as CounterLabel } from './CounterLabel';
53
52
  export type { CounterLabelProps } from './CounterLabel';
54
53
  export { default as Details } from './Details';
@@ -89,7 +88,6 @@ export { default as Popover } from './Popover';
89
88
  export type { PopoverProps, PopoverContentProps } from './Popover';
90
89
  export { default as ProgressBar } from './ProgressBar';
91
90
  export type { ProgressBarProps } from './ProgressBar';
92
- export { default as RadioInputField } from './RadioInputField';
93
91
  export { default as SelectMenu } from './SelectMenu';
94
92
  export type { SelectMenuProps, SelectMenuDividerProps, SelectMenuFilterProps, SelectMenuFooterProps, SelectMenuItemProps, SelectMenuListProps, SelectMenuModalProps, SelectMenuTabsProps, SelectMenuHeaderProps, SelectMenuTabProps, SelectMenuTabPanelProps, SelectMenuLoadingAnimationProps } from './SelectMenu';
95
93
  export { default as SideNav } from './SideNav';
@@ -106,7 +104,6 @@ export { default as TabNav } from './TabNav';
106
104
  export type { TabNavProps, TabNavLinkProps } from './TabNav';
107
105
  export { default as TextInput } from './TextInput';
108
106
  export type { TextInputProps } from './TextInput';
109
- export { default as TextInputField } from './TextInputField';
110
107
  export { default as TextInputWithTokens } from './TextInputWithTokens';
111
108
  export type { TextInputWithTokensProps } from './TextInputWithTokens';
112
109
  export { default as Text } from './Text';
package/lib-esm/index.js CHANGED
@@ -31,7 +31,6 @@ export { NewButton } from './NewButton';
31
31
  export { default as Caret } from './Caret';
32
32
  export { default as CircleBadge } from './CircleBadge';
33
33
  export { default as CircleOcticon } from './CircleOcticon';
34
- export { default as CheckboxInputField } from './CheckboxInputField';
35
34
  export { default as CounterLabel } from './CounterLabel';
36
35
  export { default as Details } from './Details';
37
36
  export { default as Dialog } from './Dialog';
@@ -57,7 +56,6 @@ export { default as Popover } from './Popover';
57
56
  // export {default as Portal, registerPortalRoot} from './Portal'
58
57
  // export type {PortalProps} from './Portal'
59
58
  export { default as ProgressBar } from './ProgressBar';
60
- export { default as RadioInputField } from './RadioInputField';
61
59
  export { default as SelectMenu } from './SelectMenu';
62
60
  export { default as SideNav } from './SideNav';
63
61
  export { default as Spinner } from './Spinner';
@@ -66,7 +64,6 @@ export { default as StyledOcticon } from './StyledOcticon';
66
64
  export { default as SubNav } from './SubNav';
67
65
  export { default as TabNav } from './TabNav';
68
66
  export { default as TextInput } from './TextInput';
69
- export { default as TextInputField } from './TextInputField';
70
67
  export { default as TextInputWithTokens } from './TextInputWithTokens';
71
68
  export { default as Text } from './Text';
72
69
  export { default as Timeline } from './Timeline';
package/package.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-2021116165050",
3
+ "version": "0.0.0-202111616587",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
7
7
  "typings": "lib/index.d.ts",
8
- "sideEffects": [
9
- "(lib|lib-esm)/behaviors/focusZone.js",
10
- "(lib|lib-esm)/behaviors/focusTrap.js"
11
- ],
12
8
  "scripts": {
13
9
  "setup": "./script/setup",
14
10
  "build": "./script/build",
@@ -43,7 +39,8 @@
43
39
  "author": "GitHub, Inc.",
44
40
  "license": "MIT",
45
41
  "dependencies": {
46
- "@primer/octicons-react": "16.1.1",
42
+ "@primer/behaviors": "^1.0.2",
43
+ "@primer/octicons-react": "^16.1.0",
47
44
  "@primer/primitives": "7.1.1",
48
45
  "@radix-ui/react-polymorphic": "0.0.14",
49
46
  "@react-aria/ssr": "3.1.0",
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- declare const _default: React.FC<import("./_InputField/ToggleInputField").Props> & {
3
- Input: React.FC<Omit<React.HTMLProps<HTMLInputElement>, "ref"> & {
4
- ref?: React.Ref<HTMLInputElement> | undefined;
5
- }>;
6
- Caption: React.FC<{}>;
7
- Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
8
- LeadingVisual: React.FC<{}>;
9
- };
10
- export default _default;
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _ = require(".");
11
-
12
- var _InputField = _interopRequireDefault(require("./_InputField/InputField"));
13
-
14
- var _slots = require("./_InputField/slots");
15
-
16
- var _ToggleInputField = _interopRequireDefault(require("./_InputField/ToggleInputField"));
17
-
18
- var _ToggleInputLeadingVisual = _interopRequireDefault(require("./_InputField/ToggleInputLeadingVisual"));
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
-
24
- const Input = ({
25
- id: idProp,
26
- required: requiredProp,
27
- disabled: disabledProp,
28
- ...rest
29
- }) => {
30
- if (idProp) {
31
- // eslint-disable-next-line no-console
32
- console.warn("instead of passing the 'id' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
33
- }
34
-
35
- if (disabledProp) {
36
- // eslint-disable-next-line no-console
37
- console.warn("instead of passing the 'disabled' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
38
- }
39
-
40
- if (requiredProp) {
41
- // eslint-disable-next-line no-console
42
- console.warn("instead of passing the 'required' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
43
- }
44
-
45
- return /*#__PURE__*/_react.default.createElement(_slots.Slot, {
46
- name: "Input"
47
- }, ({
48
- disabled,
49
- id,
50
- required,
51
- captionId
52
- }) => /*#__PURE__*/_react.default.createElement(_.Checkbox, _extends({
53
- "aria-describedby": captionId,
54
- id: id,
55
- required: required,
56
- disabled: disabled
57
- }, rest)));
58
- };
59
-
60
- Input.displayName = "Input";
61
-
62
- const CheckboxInputField = props => /*#__PURE__*/_react.default.createElement(_ToggleInputField.default, props);
63
-
64
- CheckboxInputField.displayName = "CheckboxInputField";
65
-
66
- var _default = Object.assign(CheckboxInputField, {
67
- Input,
68
- Caption: _InputField.default.Caption,
69
- Label: _InputField.default.Label,
70
- LeadingVisual: _ToggleInputLeadingVisual.default
71
- });
72
-
73
- exports.default = _default;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { RadioProps } from '.';
3
- declare const _default: React.FC<import("./_InputField/ToggleInputField").Props> & {
4
- Input: React.FC<RadioProps>;
5
- Caption: React.FC<{}>;
6
- Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
7
- LeadingVisual: React.FC<{}>;
8
- };
9
- export default _default;
@@ -1,74 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _ = require(".");
11
-
12
- var _InputField = _interopRequireDefault(require("./_InputField/InputField"));
13
-
14
- var _slots = require("./_InputField/slots");
15
-
16
- var _ToggleInputField = _interopRequireDefault(require("./_InputField/ToggleInputField"));
17
-
18
- var _ToggleInputLeadingVisual = _interopRequireDefault(require("./_InputField/ToggleInputLeadingVisual"));
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
-
24
- // pulling out `id`, `disabled`, and `required` because those should come from the parent TextInputField component
25
- const Input = ({
26
- id: idProp,
27
- required: requiredProp,
28
- disabled: disabledProp,
29
- ...rest
30
- }) => {
31
- if (idProp) {
32
- // eslint-disable-next-line no-console
33
- console.warn("instead of passing the 'id' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
34
- }
35
-
36
- if (disabledProp) {
37
- // eslint-disable-next-line no-console
38
- console.warn("instead of passing the 'disabled' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
39
- }
40
-
41
- if (requiredProp) {
42
- // eslint-disable-next-line no-console
43
- console.warn("instead of passing the 'required' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
44
- }
45
-
46
- return /*#__PURE__*/_react.default.createElement(_slots.Slot, {
47
- name: "Input"
48
- }, ({
49
- disabled,
50
- id,
51
- required,
52
- captionId
53
- }) => /*#__PURE__*/_react.default.createElement(_.Radio, _extends({
54
- "aria-describedby": captionId,
55
- id: id,
56
- required: required,
57
- disabled: disabled
58
- }, rest)));
59
- };
60
-
61
- Input.displayName = "Input";
62
-
63
- const RadioInputField = props => /*#__PURE__*/_react.default.createElement(_ToggleInputField.default, props);
64
-
65
- RadioInputField.displayName = "RadioInputField";
66
-
67
- var _default = Object.assign(RadioInputField, {
68
- Input,
69
- Caption: _InputField.default.Caption,
70
- Label: _InputField.default.Label,
71
- LeadingVisual: _ToggleInputLeadingVisual.default
72
- });
73
-
74
- exports.default = _default;