@primer/components 0.0.0-2021116181214 → 0.0.0-2021116201150

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 (143) 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/ActionList2/Item.js +6 -4
  6. package/lib/ActionList2/List.js +2 -2
  7. package/lib/ActionList2/{ActionListContainerContext.d.ts → MenuContext.d.ts} +3 -3
  8. package/lib/ActionList2/{ActionListContainerContext.js → MenuContext.js} +3 -3
  9. package/lib/ActionList2/Selection.js +4 -4
  10. package/lib/ActionMenu2.d.ts +9 -13
  11. package/lib/ActionMenu2.js +29 -63
  12. package/lib/Autocomplete/AutocompleteMenu.js +13 -6
  13. package/lib/Checkbox.d.ts +1 -1
  14. package/lib/hooks/index.d.ts +0 -1
  15. package/lib/hooks/index.js +1 -9
  16. package/lib/index.d.ts +0 -6
  17. package/lib/index.js +0 -46
  18. package/lib-esm/ActionList2/Item.js +6 -4
  19. package/lib-esm/ActionList2/List.js +2 -2
  20. package/lib-esm/ActionList2/{ActionListContainerContext.d.ts → MenuContext.d.ts} +3 -3
  21. package/lib-esm/ActionList2/{ActionListContainerContext.js → MenuContext.js} +1 -1
  22. package/lib-esm/ActionList2/Selection.js +4 -4
  23. package/lib-esm/ActionMenu2.d.ts +9 -13
  24. package/lib-esm/ActionMenu2.js +27 -60
  25. package/lib-esm/Autocomplete/AutocompleteMenu.js +13 -3
  26. package/lib-esm/Checkbox.d.ts +1 -1
  27. package/lib-esm/hooks/index.d.ts +0 -1
  28. package/lib-esm/hooks/index.js +1 -2
  29. package/lib-esm/index.d.ts +0 -6
  30. package/lib-esm/index.js +0 -5
  31. package/package.json +2 -2
  32. package/lib/CheckboxInputField.d.ts +0 -11
  33. package/lib/CheckboxInputField.js +0 -73
  34. package/lib/ChoiceFieldset/ChoiceFieldCaption.d.ts +0 -3
  35. package/lib/ChoiceFieldset/ChoiceFieldCaption.js +0 -35
  36. package/lib/ChoiceFieldset/ChoiceFieldLabel.d.ts +0 -3
  37. package/lib/ChoiceFieldset/ChoiceFieldLabel.js +0 -35
  38. package/lib/ChoiceFieldset/ChoiceFieldset.d.ts +0 -65
  39. package/lib/ChoiceFieldset/ChoiceFieldset.js +0 -95
  40. package/lib/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +0 -3
  41. package/lib/ChoiceFieldset/ChoiceFieldsetDescription.js +0 -29
  42. package/lib/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +0 -9
  43. package/lib/ChoiceFieldset/ChoiceFieldsetLegend.js +0 -44
  44. package/lib/ChoiceFieldset/ChoiceFieldsetList.d.ts +0 -9
  45. package/lib/ChoiceFieldset/ChoiceFieldsetList.js +0 -69
  46. package/lib/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +0 -19
  47. package/lib/ChoiceFieldset/ChoiceFieldsetListContext.js +0 -15
  48. package/lib/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +0 -25
  49. package/lib/ChoiceFieldset/ChoiceFieldsetListItem.js +0 -75
  50. package/lib/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +0 -6
  51. package/lib/ChoiceFieldset/ChoiceFieldsetValidation.js +0 -17
  52. package/lib/ChoiceFieldset/index.d.ts +0 -3
  53. package/lib/ChoiceFieldset/index.js +0 -23
  54. package/lib/Radio.d.ts +0 -38
  55. package/lib/Radio.js +0 -55
  56. package/lib/RadioInputField.d.ts +0 -10
  57. package/lib/RadioInputField.js +0 -74
  58. package/lib/TextInputField.d.ts +0 -583
  59. package/lib/TextInputField.js +0 -66
  60. package/lib/_InputCaption.d.ts +0 -13
  61. package/lib/_InputCaption.js +0 -27
  62. package/lib/_InputField/InputField.d.ts +0 -39
  63. package/lib/_InputField/InputField.js +0 -90
  64. package/lib/_InputField/InputFieldCaption.d.ts +0 -3
  65. package/lib/_InputField/InputFieldCaption.js +0 -30
  66. package/lib/_InputField/InputFieldLabel.d.ts +0 -9
  67. package/lib/_InputField/InputFieldLabel.js +0 -34
  68. package/lib/_InputField/InputFieldValidation.d.ts +0 -6
  69. package/lib/_InputField/InputFieldValidation.js +0 -17
  70. package/lib/_InputField/ToggleInputField.d.ts +0 -13
  71. package/lib/_InputField/ToggleInputField.js +0 -71
  72. package/lib/_InputField/ToggleInputLeadingVisual.d.ts +0 -3
  73. package/lib/_InputField/ToggleInputLeadingVisual.js +0 -22
  74. package/lib/_InputField/ValidationAnimationContainer.d.ts +0 -6
  75. package/lib/_InputField/ValidationAnimationContainer.js +0 -48
  76. package/lib/_InputField/index.d.ts +0 -1
  77. package/lib/_InputField/index.js +0 -15
  78. package/lib/_InputField/slots.d.ts +0 -13
  79. package/lib/_InputField/slots.js +0 -17
  80. package/lib/_InputLabel.d.ts +0 -8
  81. package/lib/_InputLabel.js +0 -44
  82. package/lib/_InputValidation.d.ts +0 -8
  83. package/lib/_InputValidation.js +0 -56
  84. package/lib/_VisuallyHidden.d.ts +0 -6
  85. package/lib/_VisuallyHidden.js +0 -39
  86. package/lib/utils/types/FormValidationStatus.d.ts +0 -1
  87. package/lib/utils/types/FormValidationStatus.js +0 -1
  88. package/lib-esm/CheckboxInputField.d.ts +0 -11
  89. package/lib-esm/CheckboxInputField.js +0 -56
  90. package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.d.ts +0 -3
  91. package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.js +0 -20
  92. package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.d.ts +0 -3
  93. package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.js +0 -20
  94. package/lib-esm/ChoiceFieldset/ChoiceFieldset.d.ts +0 -65
  95. package/lib-esm/ChoiceFieldset/ChoiceFieldset.js +0 -72
  96. package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +0 -3
  97. package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.js +0 -17
  98. package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +0 -9
  99. package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.js +0 -31
  100. package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.d.ts +0 -9
  101. package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.js +0 -52
  102. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +0 -19
  103. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.js +0 -5
  104. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +0 -25
  105. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.js +0 -51
  106. package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +0 -6
  107. package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.js +0 -7
  108. package/lib-esm/ChoiceFieldset/index.d.ts +0 -3
  109. package/lib-esm/ChoiceFieldset/index.js +0 -2
  110. package/lib-esm/Radio.d.ts +0 -38
  111. package/lib-esm/Radio.js +0 -40
  112. package/lib-esm/RadioInputField.d.ts +0 -10
  113. package/lib-esm/RadioInputField.js +0 -56
  114. package/lib-esm/TextInputField.d.ts +0 -583
  115. package/lib-esm/TextInputField.js +0 -50
  116. package/lib-esm/_InputCaption.d.ts +0 -13
  117. package/lib-esm/_InputCaption.js +0 -16
  118. package/lib-esm/_InputField/InputField.d.ts +0 -39
  119. package/lib-esm/_InputField/InputField.js +0 -70
  120. package/lib-esm/_InputField/InputFieldCaption.d.ts +0 -3
  121. package/lib-esm/_InputField/InputFieldCaption.js +0 -18
  122. package/lib-esm/_InputField/InputFieldLabel.d.ts +0 -9
  123. package/lib-esm/_InputField/InputFieldLabel.js +0 -22
  124. package/lib-esm/_InputField/InputFieldValidation.d.ts +0 -6
  125. package/lib-esm/_InputField/InputFieldValidation.js +0 -7
  126. package/lib-esm/_InputField/ToggleInputField.d.ts +0 -13
  127. package/lib-esm/_InputField/ToggleInputField.js +0 -54
  128. package/lib-esm/_InputField/ToggleInputLeadingVisual.d.ts +0 -3
  129. package/lib-esm/_InputField/ToggleInputLeadingVisual.js +0 -11
  130. package/lib-esm/_InputField/ValidationAnimationContainer.d.ts +0 -6
  131. package/lib-esm/_InputField/ValidationAnimationContainer.js +0 -33
  132. package/lib-esm/_InputField/index.d.ts +0 -1
  133. package/lib-esm/_InputField/index.js +0 -1
  134. package/lib-esm/_InputField/slots.d.ts +0 -13
  135. package/lib-esm/_InputField/slots.js +0 -5
  136. package/lib-esm/_InputLabel.d.ts +0 -8
  137. package/lib-esm/_InputLabel.js +0 -32
  138. package/lib-esm/_InputValidation.d.ts +0 -8
  139. package/lib-esm/_InputValidation.js +0 -43
  140. package/lib-esm/_VisuallyHidden.d.ts +0 -6
  141. package/lib-esm/_VisuallyHidden.js +0 -26
  142. package/lib-esm/utils/types/FormValidationStatus.d.ts +0 -1
  143. package/lib-esm/utils/types/FormValidationStatus.js +0 -1
@@ -1,38 +0,0 @@
1
- import React, { InputHTMLAttributes } from 'react';
2
- import { SxProp } from './sx';
3
- export declare type RadioProps = {
4
- /**
5
- * A unique value that is never shown to the user.
6
- * Used during form submission and to identify which radio button in a group is selected
7
- */
8
- value: string;
9
- /**
10
- * Name attribute of the input element. Required for grouping radio inputs
11
- */
12
- name: string;
13
- /**
14
- * Apply inactive visual appearance to the radio button
15
- */
16
- disabled?: boolean;
17
- /**
18
- * Indicates whether the radio button is selected
19
- */
20
- checked?: boolean;
21
- /**
22
- * Forward a ref to the underlying input element
23
- */
24
- ref?: React.RefObject<HTMLInputElement>;
25
- /**
26
- * Indicates whether the radio button must be checked before the form can be submitted
27
- */
28
- required?: boolean;
29
- /**
30
- * Indicates whether the radio button validation state is non-standard
31
- */
32
- validationStatus?: 'error' | 'success';
33
- } & InputHTMLAttributes<HTMLInputElement> & SxProp;
34
- /**
35
- * An accessible, native radio component for selecting one option from a list.
36
- */
37
- declare const Radio: React.ForwardRefExoticComponent<Pick<RadioProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "validationStatus"> & React.RefAttributes<HTMLInputElement>>;
38
- export default Radio;
package/lib-esm/Radio.js DELETED
@@ -1,40 +0,0 @@
1
- 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); }
2
-
3
- import styled from 'styled-components';
4
- import React from 'react';
5
- import sx from './sx';
6
- const StyledRadio = styled.input.withConfig({
7
- displayName: "Radio__StyledRadio",
8
- componentId: "sc-1ak1fjg-0"
9
- })(["cursor:pointer;", " ", ""], props => props.disabled && `cursor: not-allowed;`, sx);
10
- /**
11
- * An accessible, native radio component for selecting one option from a list.
12
- */
13
-
14
- const Radio = /*#__PURE__*/React.forwardRef(({
15
- checked,
16
- disabled,
17
- sx: sxProp,
18
- required,
19
- validationStatus,
20
- value,
21
- name,
22
- ...rest
23
- }, ref) => {
24
- return /*#__PURE__*/React.createElement(StyledRadio, _extends({
25
- type: "radio",
26
- value: value,
27
- name: name,
28
- ref: ref,
29
- disabled: disabled,
30
- "aria-disabled": disabled ? 'true' : 'false',
31
- checked: checked,
32
- "aria-checked": checked ? 'true' : 'false',
33
- required: required,
34
- "aria-required": required ? 'true' : 'false',
35
- "aria-invalid": validationStatus === 'error' ? 'true' : 'false',
36
- sx: sxProp
37
- }, rest));
38
- });
39
- Radio.displayName = 'Radio';
40
- export default Radio;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { RadioProps } from '.';
3
- import { ToggleInputFieldProps } from './_InputField/ToggleInputField';
4
- declare const _default: React.FC<ToggleInputFieldProps> & {
5
- Input: React.FC<RadioProps>;
6
- Caption: React.FC<{}>;
7
- Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
8
- LeadingVisual: React.FC<{}>;
9
- };
10
- export default _default;
@@ -1,56 +0,0 @@
1
- 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); }
2
-
3
- import React from 'react';
4
- import { Radio } from '.';
5
- import InputField from './_InputField/InputField';
6
- import { Slot } from './_InputField/slots';
7
- import ToggleInputField from './_InputField/ToggleInputField';
8
- import ToggleInputLeadingVisual from './_InputField/ToggleInputLeadingVisual'; // pulling out `id`, `disabled`, and `required` because those should come from the parent TextInputField component
9
-
10
- const Input = ({
11
- id: idProp,
12
- required: requiredProp,
13
- disabled: disabledProp,
14
- ...rest
15
- }) => {
16
- if (idProp) {
17
- // eslint-disable-next-line no-console
18
- console.warn("instead of passing the 'id' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
19
- }
20
-
21
- if (disabledProp) {
22
- // eslint-disable-next-line no-console
23
- console.warn("instead of passing the 'disabled' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
24
- }
25
-
26
- if (requiredProp) {
27
- // eslint-disable-next-line no-console
28
- console.warn("instead of passing the 'required' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
29
- }
30
-
31
- return /*#__PURE__*/React.createElement(Slot, {
32
- name: "Input"
33
- }, ({
34
- disabled,
35
- id,
36
- required,
37
- captionId
38
- }) => /*#__PURE__*/React.createElement(Radio, _extends({
39
- "aria-describedby": captionId,
40
- id: id,
41
- required: required,
42
- disabled: disabled
43
- }, rest)));
44
- };
45
-
46
- Input.displayName = "Input";
47
-
48
- const RadioInputField = props => /*#__PURE__*/React.createElement(ToggleInputField, props);
49
-
50
- RadioInputField.displayName = "RadioInputField";
51
- export default Object.assign(RadioInputField, {
52
- Input,
53
- Caption: InputField.Caption,
54
- Label: InputField.Label,
55
- LeadingVisual: ToggleInputLeadingVisual
56
- });