@primer/components 0.0.0-2021113194429 → 0.0.0-2021113204024

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 (277) hide show
  1. package/CHANGELOG.md +986 -0
  2. package/dist/browser.esm.js +2227 -2
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +2227 -2
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/ActionList/Header.js +1 -1
  7. package/lib/ActionList/Item.js +10 -10
  8. package/lib/ActionList/List.js +1 -1
  9. package/lib/ActionList2/Divider.d.ts +2 -3
  10. package/lib/ActionList2/Divider.js +5 -10
  11. package/lib/ActionList2/Item.js +6 -22
  12. package/lib/ActionList2/List.js +2 -12
  13. package/lib/ActionList2/Selection.js +0 -11
  14. package/lib/ActionList2/index.d.ts +2 -1
  15. package/lib/Autocomplete/Autocomplete.d.ts +1 -2
  16. package/lib/Autocomplete/AutocompleteInput.d.ts +1 -2
  17. package/lib/Autocomplete/AutocompleteMenu.js +6 -13
  18. package/lib/Avatar.d.ts +2 -1
  19. package/lib/Avatar.js +1 -1
  20. package/lib/BaseStyles.js +20 -2
  21. package/lib/BorderBox.js +1 -1
  22. package/lib/Box.js +1 -1
  23. package/lib/BranchName.d.ts +2 -1
  24. package/lib/BranchName.js +1 -1
  25. package/lib/Breadcrumbs.js +3 -3
  26. package/lib/Button/Button.d.ts +2 -2
  27. package/lib/Button/Button.js +1 -1
  28. package/lib/Button/ButtonClose.d.ts +2 -2
  29. package/lib/Button/ButtonDanger.d.ts +2 -2
  30. package/lib/Button/ButtonGroup.js +1 -1
  31. package/lib/Button/ButtonInvisible.d.ts +2 -2
  32. package/lib/Button/ButtonOutline.d.ts +2 -2
  33. package/lib/Button/ButtonPrimary.d.ts +2 -2
  34. package/lib/Checkbox.d.ts +1 -1
  35. package/lib/Checkbox.js +1 -1
  36. package/lib/CheckboxInputField.d.ts +11 -0
  37. package/lib/CheckboxInputField.js +73 -0
  38. package/lib/ChoiceFieldset/ChoiceFieldCaption.d.ts +3 -0
  39. package/lib/ChoiceFieldset/ChoiceFieldCaption.js +35 -0
  40. package/lib/ChoiceFieldset/ChoiceFieldLabel.d.ts +3 -0
  41. package/lib/ChoiceFieldset/ChoiceFieldLabel.js +35 -0
  42. package/lib/ChoiceFieldset/ChoiceFieldset.d.ts +65 -0
  43. package/lib/ChoiceFieldset/ChoiceFieldset.js +95 -0
  44. package/lib/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +3 -0
  45. package/lib/ChoiceFieldset/ChoiceFieldsetDescription.js +29 -0
  46. package/lib/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +9 -0
  47. package/lib/ChoiceFieldset/ChoiceFieldsetLegend.js +44 -0
  48. package/lib/ChoiceFieldset/ChoiceFieldsetList.d.ts +9 -0
  49. package/lib/ChoiceFieldset/ChoiceFieldsetList.js +80 -0
  50. package/lib/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +19 -0
  51. package/lib/ChoiceFieldset/ChoiceFieldsetListContext.js +15 -0
  52. package/lib/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +25 -0
  53. package/lib/ChoiceFieldset/ChoiceFieldsetListItem.js +75 -0
  54. package/lib/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +6 -0
  55. package/lib/ChoiceFieldset/ChoiceFieldsetValidation.js +17 -0
  56. package/lib/ChoiceFieldset/index.d.ts +3 -0
  57. package/lib/ChoiceFieldset/index.js +23 -0
  58. package/lib/CircleOcticon.d.ts +35 -35
  59. package/lib/Details.d.ts +2 -1
  60. package/lib/Details.js +4 -2
  61. package/lib/Dialog.d.ts +37 -37
  62. package/lib/Dropdown.d.ts +72 -8
  63. package/lib/DropdownMenu/DropdownButton.d.ts +3 -6
  64. package/lib/FilterList.d.ts +1 -1
  65. package/lib/FilteredActionList/FilteredActionList.js +1 -1
  66. package/lib/Flex.js +1 -1
  67. package/lib/Heading.d.ts +2 -1
  68. package/lib/Heading.js +6 -1
  69. package/lib/LabelGroup.js +1 -1
  70. package/lib/Overlay.js +1 -1
  71. package/lib/Pagination/Pagination.js +2 -2
  72. package/lib/Position.d.ts +4 -4
  73. package/lib/Position.js +1 -1
  74. package/lib/ProgressBar.d.ts +11 -16
  75. package/lib/ProgressBar.js +10 -6
  76. package/lib/RadioInputField.d.ts +9 -0
  77. package/lib/RadioInputField.js +82 -0
  78. package/lib/SelectMenu/SelectMenu.d.ts +10 -11
  79. package/lib/SelectMenu/SelectMenu.js +1 -1
  80. package/lib/SelectMenu/SelectMenuFilter.js +1 -1
  81. package/lib/SelectMenu/SelectMenuFooter.js +1 -1
  82. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  83. package/lib/SelectMenu/SelectMenuItem.js +1 -1
  84. package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
  85. package/lib/SelectMenu/SelectMenuTab.js +1 -1
  86. package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
  87. package/lib/SelectMenu/SelectMenuTabs.js +1 -1
  88. package/lib/Spinner.d.ts +2 -1
  89. package/lib/Spinner.js +3 -1
  90. package/lib/StateLabel.js +1 -1
  91. package/lib/StyledOcticon.js +1 -1
  92. package/lib/SubNav.js +3 -3
  93. package/lib/TextInputField.d.ts +581 -0
  94. package/lib/TextInputField.js +66 -0
  95. package/lib/TextInputWithTokens.d.ts +1 -2
  96. package/lib/ThemeProvider.d.ts +0 -1
  97. package/lib/ThemeProvider.js +4 -17
  98. package/lib/Timeline.js +4 -4
  99. package/lib/Token/AvatarToken.d.ts +1 -1
  100. package/lib/Token/AvatarToken.js +1 -1
  101. package/lib/Token/IssueLabelToken.d.ts +1 -1
  102. package/lib/Token/Token.d.ts +1 -1
  103. package/lib/Token/TokenBase.js +1 -1
  104. package/lib/Tooltip.js +1 -1
  105. package/lib/UnderlineNav.js +2 -2
  106. package/lib/_InputCaption.d.ts +13 -0
  107. package/lib/_InputCaption.js +27 -0
  108. package/lib/_InputField/InputField.d.ts +39 -0
  109. package/lib/_InputField/InputField.js +90 -0
  110. package/lib/_InputField/InputFieldCaption.d.ts +3 -0
  111. package/lib/_InputField/InputFieldCaption.js +30 -0
  112. package/lib/_InputField/InputFieldLabel.d.ts +9 -0
  113. package/lib/_InputField/InputFieldLabel.js +34 -0
  114. package/lib/_InputField/InputFieldValidation.d.ts +6 -0
  115. package/lib/{ActionList2/MenuContext.js → _InputField/InputFieldValidation.js} +6 -4
  116. package/lib/_InputField/ToggleInputField.d.ts +13 -0
  117. package/lib/_InputField/ToggleInputField.js +71 -0
  118. package/lib/_InputField/ToggleInputLeadingVisual.d.ts +3 -0
  119. package/lib/_InputField/ToggleInputLeadingVisual.js +22 -0
  120. package/lib/_InputField/ValidationAnimationContainer.d.ts +6 -0
  121. package/lib/_InputField/ValidationAnimationContainer.js +48 -0
  122. package/lib/_InputField/index.d.ts +1 -0
  123. package/lib/_InputField/index.js +15 -0
  124. package/lib/_InputField/slots.d.ts +13 -0
  125. package/lib/_InputField/slots.js +17 -0
  126. package/lib/_InputLabel.d.ts +8 -0
  127. package/lib/_InputLabel.js +44 -0
  128. package/lib/_InputValidation.d.ts +8 -0
  129. package/lib/_InputValidation.js +56 -0
  130. package/lib/_VisuallyHidden.d.ts +6 -0
  131. package/lib/_VisuallyHidden.js +39 -0
  132. package/lib/drafts.d.ts +0 -1
  133. package/lib/drafts.js +0 -13
  134. package/lib/index.d.ts +4 -0
  135. package/lib/index.js +38 -0
  136. package/lib/utils/types/FormValidationStatus.d.ts +1 -0
  137. package/lib/utils/types/FormValidationStatus.js +1 -0
  138. package/lib-esm/ActionList/Header.js +1 -1
  139. package/lib-esm/ActionList/Item.js +10 -10
  140. package/lib-esm/ActionList/List.js +1 -1
  141. package/lib-esm/ActionList2/Divider.d.ts +2 -3
  142. package/lib-esm/ActionList2/Divider.js +5 -8
  143. package/lib-esm/ActionList2/Item.js +6 -20
  144. package/lib-esm/ActionList2/List.js +2 -10
  145. package/lib-esm/ActionList2/Selection.js +0 -9
  146. package/lib-esm/ActionList2/index.d.ts +2 -1
  147. package/lib-esm/Autocomplete/Autocomplete.d.ts +1 -2
  148. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +1 -2
  149. package/lib-esm/Autocomplete/AutocompleteMenu.js +3 -13
  150. package/lib-esm/Avatar.d.ts +2 -1
  151. package/lib-esm/Avatar.js +2 -2
  152. package/lib-esm/BaseStyles.js +20 -2
  153. package/lib-esm/BorderBox.js +1 -1
  154. package/lib-esm/Box.js +1 -1
  155. package/lib-esm/BranchName.d.ts +2 -1
  156. package/lib-esm/BranchName.js +2 -2
  157. package/lib-esm/Breadcrumbs.js +3 -3
  158. package/lib-esm/Button/Button.d.ts +2 -2
  159. package/lib-esm/Button/Button.js +1 -1
  160. package/lib-esm/Button/ButtonClose.d.ts +2 -2
  161. package/lib-esm/Button/ButtonDanger.d.ts +2 -2
  162. package/lib-esm/Button/ButtonGroup.js +1 -1
  163. package/lib-esm/Button/ButtonInvisible.d.ts +2 -2
  164. package/lib-esm/Button/ButtonOutline.d.ts +2 -2
  165. package/lib-esm/Button/ButtonPrimary.d.ts +2 -2
  166. package/lib-esm/Checkbox.d.ts +1 -1
  167. package/lib-esm/Checkbox.js +1 -1
  168. package/lib-esm/CheckboxInputField.d.ts +11 -0
  169. package/lib-esm/CheckboxInputField.js +56 -0
  170. package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.d.ts +3 -0
  171. package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.js +20 -0
  172. package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.d.ts +3 -0
  173. package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.js +20 -0
  174. package/lib-esm/ChoiceFieldset/ChoiceFieldset.d.ts +65 -0
  175. package/lib-esm/ChoiceFieldset/ChoiceFieldset.js +72 -0
  176. package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +3 -0
  177. package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.js +17 -0
  178. package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +9 -0
  179. package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.js +31 -0
  180. package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.d.ts +9 -0
  181. package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.js +63 -0
  182. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +19 -0
  183. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.js +5 -0
  184. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +25 -0
  185. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.js +51 -0
  186. package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +6 -0
  187. package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.js +7 -0
  188. package/lib-esm/ChoiceFieldset/index.d.ts +3 -0
  189. package/lib-esm/ChoiceFieldset/index.js +2 -0
  190. package/lib-esm/CircleOcticon.d.ts +35 -35
  191. package/lib-esm/Details.d.ts +2 -1
  192. package/lib-esm/Details.js +3 -2
  193. package/lib-esm/Dialog.d.ts +37 -37
  194. package/lib-esm/Dropdown.d.ts +72 -8
  195. package/lib-esm/DropdownMenu/DropdownButton.d.ts +3 -6
  196. package/lib-esm/FilterList.d.ts +1 -1
  197. package/lib-esm/FilteredActionList/FilteredActionList.js +1 -1
  198. package/lib-esm/Flex.js +1 -1
  199. package/lib-esm/Heading.d.ts +2 -1
  200. package/lib-esm/Heading.js +6 -2
  201. package/lib-esm/LabelGroup.js +1 -1
  202. package/lib-esm/Overlay.js +1 -1
  203. package/lib-esm/Pagination/Pagination.js +2 -2
  204. package/lib-esm/Position.d.ts +4 -4
  205. package/lib-esm/Position.js +1 -1
  206. package/lib-esm/ProgressBar.d.ts +11 -16
  207. package/lib-esm/ProgressBar.js +11 -7
  208. package/lib-esm/RadioInputField.d.ts +9 -0
  209. package/lib-esm/RadioInputField.js +65 -0
  210. package/lib-esm/SelectMenu/SelectMenu.d.ts +10 -11
  211. package/lib-esm/SelectMenu/SelectMenu.js +1 -1
  212. package/lib-esm/SelectMenu/SelectMenuFilter.js +1 -1
  213. package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
  214. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  215. package/lib-esm/SelectMenu/SelectMenuItem.js +1 -1
  216. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
  217. package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
  218. package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
  219. package/lib-esm/SelectMenu/SelectMenuTabs.js +1 -1
  220. package/lib-esm/Spinner.d.ts +2 -1
  221. package/lib-esm/Spinner.js +2 -1
  222. package/lib-esm/StateLabel.js +1 -1
  223. package/lib-esm/StyledOcticon.js +1 -1
  224. package/lib-esm/SubNav.js +3 -3
  225. package/lib-esm/TextInputField.d.ts +581 -0
  226. package/lib-esm/TextInputField.js +50 -0
  227. package/lib-esm/TextInputWithTokens.d.ts +1 -2
  228. package/lib-esm/ThemeProvider.d.ts +0 -1
  229. package/lib-esm/ThemeProvider.js +4 -17
  230. package/lib-esm/Timeline.js +4 -4
  231. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  232. package/lib-esm/Token/AvatarToken.js +1 -1
  233. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  234. package/lib-esm/Token/Token.d.ts +1 -1
  235. package/lib-esm/Token/TokenBase.js +1 -1
  236. package/lib-esm/Tooltip.js +1 -1
  237. package/lib-esm/UnderlineNav.js +2 -2
  238. package/lib-esm/_InputCaption.d.ts +13 -0
  239. package/lib-esm/_InputCaption.js +16 -0
  240. package/lib-esm/_InputField/InputField.d.ts +39 -0
  241. package/lib-esm/_InputField/InputField.js +70 -0
  242. package/lib-esm/_InputField/InputFieldCaption.d.ts +3 -0
  243. package/lib-esm/_InputField/InputFieldCaption.js +18 -0
  244. package/lib-esm/_InputField/InputFieldLabel.d.ts +9 -0
  245. package/lib-esm/_InputField/InputFieldLabel.js +22 -0
  246. package/lib-esm/_InputField/InputFieldValidation.d.ts +6 -0
  247. package/lib-esm/_InputField/InputFieldValidation.js +7 -0
  248. package/lib-esm/_InputField/ToggleInputField.d.ts +13 -0
  249. package/lib-esm/_InputField/ToggleInputField.js +54 -0
  250. package/lib-esm/_InputField/ToggleInputLeadingVisual.d.ts +3 -0
  251. package/lib-esm/_InputField/ToggleInputLeadingVisual.js +11 -0
  252. package/lib-esm/_InputField/ValidationAnimationContainer.d.ts +6 -0
  253. package/lib-esm/_InputField/ValidationAnimationContainer.js +33 -0
  254. package/lib-esm/_InputField/index.d.ts +1 -0
  255. package/lib-esm/_InputField/index.js +1 -0
  256. package/lib-esm/_InputField/slots.d.ts +13 -0
  257. package/lib-esm/_InputField/slots.js +5 -0
  258. package/lib-esm/_InputLabel.d.ts +8 -0
  259. package/lib-esm/_InputLabel.js +32 -0
  260. package/lib-esm/_InputValidation.d.ts +8 -0
  261. package/lib-esm/_InputValidation.js +43 -0
  262. package/lib-esm/_VisuallyHidden.d.ts +6 -0
  263. package/lib-esm/_VisuallyHidden.js +26 -0
  264. package/lib-esm/drafts.d.ts +0 -1
  265. package/lib-esm/drafts.js +1 -2
  266. package/lib-esm/index.d.ts +4 -0
  267. package/lib-esm/index.js +4 -0
  268. package/lib-esm/utils/types/FormValidationStatus.d.ts +1 -0
  269. package/lib-esm/utils/types/FormValidationStatus.js +1 -0
  270. package/package.json +9 -15
  271. package/lib/ActionList2/MenuContext.d.ts +0 -10
  272. package/lib/ActionMenu2.d.ts +0 -313
  273. package/lib/ActionMenu2.js +0 -91
  274. package/lib-esm/ActionList2/MenuContext.d.ts +0 -10
  275. package/lib-esm/ActionList2/MenuContext.js +0 -3
  276. package/lib-esm/ActionMenu2.d.ts +0 -313
  277. package/lib-esm/ActionMenu2.js +0 -67
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ show?: boolean;
4
+ }
5
+ declare const ValidationAnimationContainer: React.FC<Props>;
6
+ export default ValidationAnimationContainer;
@@ -0,0 +1,33 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import styled, { keyframes, css } from 'styled-components';
3
+ import { Box } from '..';
4
+ const fadeIn = keyframes(["0%{opacity:0;transform:translateY(-100%);}100%{opacity:1;transform:translateY(0);}"]); // using easeOutQuint easing fn https://easings.net/#easeOutQuint
5
+
6
+ const AnimatedElement = styled.div.withConfig({
7
+ displayName: "ValidationAnimationContainer__AnimatedElement",
8
+ componentId: "sc-1grmoaz-0"
9
+ })(["animation:", ";"], props => props.show && css(["170ms ", " cubic-bezier(0.44,0.74,0.36,1);"], fadeIn));
10
+
11
+ const ValidationAnimationContainer = ({
12
+ show,
13
+ children
14
+ }) => {
15
+ const [shouldRender, setRender] = useState(show);
16
+ useEffect(() => {
17
+ if (show) setRender(true);
18
+ }, [show]);
19
+
20
+ const onAnimationEnd = () => {
21
+ if (!show) setRender(false);
22
+ };
23
+
24
+ return shouldRender ? /*#__PURE__*/React.createElement(Box, {
25
+ height: show ? 'auto' : 0,
26
+ overflow: "hidden"
27
+ }, /*#__PURE__*/React.createElement(AnimatedElement, {
28
+ show: show,
29
+ onAnimationEnd: onAnimationEnd
30
+ }, children)) : null;
31
+ };
32
+
33
+ export default ValidationAnimationContainer;
@@ -0,0 +1 @@
1
+ export { default } from './InputField';
@@ -0,0 +1 @@
1
+ export { default } from './InputField';
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export declare const Slots: import("react").FC<{
3
+ context?: Record<string, unknown> | undefined;
4
+ children: (slots: {
5
+ LeadingVisual?: import("react").ReactNode;
6
+ Caption?: import("react").ReactNode;
7
+ Input?: import("react").ReactNode;
8
+ Label?: import("react").ReactNode;
9
+ }) => import("react").ReactNode;
10
+ }>, Slot: import("react").FC<{
11
+ name: "LeadingVisual" | "Caption" | "Input" | "Label";
12
+ children: import("react").ReactNode;
13
+ }>;
@@ -0,0 +1,5 @@
1
+ import createSlots from '../utils/create-slots';
2
+ export const {
3
+ Slots,
4
+ Slot
5
+ } = createSlots(['Caption', 'Input', 'Label', 'LeadingVisual']);
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface Props extends React.HTMLProps<HTMLLabelElement> {
3
+ disabled?: boolean;
4
+ required?: boolean;
5
+ visuallyHidden?: boolean;
6
+ }
7
+ declare const InputLabel: React.FC<Props>;
8
+ export default InputLabel;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { Box } from '.';
3
+ import VisuallyHidden from './_VisuallyHidden';
4
+
5
+ const InputLabel = ({
6
+ children,
7
+ disabled,
8
+ required,
9
+ visuallyHidden,
10
+ htmlFor
11
+ }) => {
12
+ return /*#__PURE__*/React.createElement(VisuallyHidden, {
13
+ isVisible: !visuallyHidden,
14
+ as: "label",
15
+ htmlFor: htmlFor,
16
+ title: required ? 'required field' : undefined,
17
+ sx: {
18
+ fontWeight: 'bold',
19
+ fontSize: 1,
20
+ display: 'block',
21
+ color: disabled ? 'fg.muted' : 'fg.default'
22
+ }
23
+ }, required ? /*#__PURE__*/React.createElement(Box, {
24
+ display: "flex",
25
+ as: "span"
26
+ }, /*#__PURE__*/React.createElement(Box, {
27
+ mr: 1
28
+ }, children), /*#__PURE__*/React.createElement("span", null, "*")) : children);
29
+ };
30
+
31
+ InputLabel.displayName = "InputLabel";
32
+ export default InputLabel;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { FormValidationStatus } from './utils/types/FormValidationStatus';
3
+ interface Props {
4
+ id: string;
5
+ validationStatus?: FormValidationStatus;
6
+ }
7
+ declare const InputValidation: React.FC<Props>;
8
+ export default InputValidation;
@@ -0,0 +1,43 @@
1
+ import { AlertFillIcon, CheckCircleFillIcon } from '@primer/octicons-react';
2
+ import React from 'react';
3
+ import { Box, Text } from '.';
4
+ const validationIconMap = {
5
+ success: CheckCircleFillIcon,
6
+ error: AlertFillIcon
7
+ };
8
+ const validationColorMap = {
9
+ success: 'success.fg',
10
+ error: 'danger.fg'
11
+ };
12
+
13
+ const InputValidation = ({
14
+ children,
15
+ id,
16
+ validationStatus
17
+ }) => {
18
+ const IconComponent = validationStatus ? validationIconMap[validationStatus] : undefined;
19
+ const fgColor = validationStatus ? validationColorMap[validationStatus] : undefined;
20
+ return /*#__PURE__*/React.createElement(Text, {
21
+ display: "flex",
22
+ color: fgColor,
23
+ fontSize: 0,
24
+ sx: {
25
+ alignItems: 'baseline',
26
+ a: {
27
+ color: 'currentColor',
28
+ textDecoration: 'underline'
29
+ }
30
+ }
31
+ }, IconComponent && /*#__PURE__*/React.createElement(Box, {
32
+ as: "span",
33
+ mr: 1
34
+ }, /*#__PURE__*/React.createElement(IconComponent, {
35
+ size: 12,
36
+ fill: "currentColor"
37
+ })), /*#__PURE__*/React.createElement("span", {
38
+ id: id
39
+ }, children));
40
+ };
41
+
42
+ InputValidation.displayName = "InputValidation";
43
+ export default InputValidation;
@@ -0,0 +1,6 @@
1
+ import { SxProp } from './sx';
2
+ interface Props {
3
+ isVisible?: boolean;
4
+ }
5
+ declare const VisuallyHidden: import("styled-components").StyledComponent<"span", any, Props & SxProp, never>;
6
+ export default VisuallyHidden;
@@ -0,0 +1,26 @@
1
+ import styled from 'styled-components';
2
+ import sx from './sx';
3
+ const VisuallyHidden = styled.span.withConfig({
4
+ displayName: "_VisuallyHidden__VisuallyHidden",
5
+ componentId: "sc-1k15c4h-0"
6
+ })(["", ""], props => {
7
+ if (props.isVisible) {
8
+ return sx;
9
+ }
10
+
11
+ return `
12
+ position: absolute;
13
+ width: 1px;
14
+ height: 1px;
15
+ padding: 0;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ clip: rect(0, 0, 0, 0);
19
+ white-space: nowrap;
20
+ border-width: 0;
21
+ `;
22
+ });
23
+ VisuallyHidden.defaultProps = {
24
+ isVisible: true
25
+ };
26
+ export default VisuallyHidden;
@@ -6,4 +6,3 @@
6
6
  */
7
7
  export * from './ActionList2';
8
8
  export * from './NewButton';
9
- export * from './ActionMenu2';
package/lib-esm/drafts.js CHANGED
@@ -6,5 +6,4 @@
6
6
  */
7
7
  // Components
8
8
  export * from './ActionList2';
9
- export * from './NewButton';
10
- export * from './ActionMenu2';
9
+ export * from './NewButton';
@@ -46,6 +46,8 @@ export { default as CircleBadge } from './CircleBadge';
46
46
  export type { CircleBadgeProps, CircleBadgeIconProps } from './CircleBadge';
47
47
  export { default as CircleOcticon } from './CircleOcticon';
48
48
  export type { CircleOcticonProps } from './CircleOcticon';
49
+ export { default as CheckboxInputField } from './CheckboxInputField';
50
+ export { default as ChoiceFieldset, Item } from './ChoiceFieldset';
49
51
  export { default as CounterLabel } from './CounterLabel';
50
52
  export type { CounterLabelProps } from './CounterLabel';
51
53
  export { default as Details } from './Details';
@@ -86,6 +88,7 @@ export { default as Popover } from './Popover';
86
88
  export type { PopoverProps, PopoverContentProps } from './Popover';
87
89
  export { default as ProgressBar } from './ProgressBar';
88
90
  export type { ProgressBarProps } from './ProgressBar';
91
+ export { default as RadioInputField } from './RadioInputField';
89
92
  export { default as SelectMenu } from './SelectMenu';
90
93
  export type { SelectMenuProps, SelectMenuDividerProps, SelectMenuFilterProps, SelectMenuFooterProps, SelectMenuItemProps, SelectMenuListProps, SelectMenuModalProps, SelectMenuTabsProps, SelectMenuHeaderProps, SelectMenuTabProps, SelectMenuTabPanelProps, SelectMenuLoadingAnimationProps } from './SelectMenu';
91
94
  export { default as SideNav } from './SideNav';
@@ -102,6 +105,7 @@ export { default as TabNav } from './TabNav';
102
105
  export type { TabNavProps, TabNavLinkProps } from './TabNav';
103
106
  export { default as TextInput } from './TextInput';
104
107
  export type { TextInputProps } from './TextInput';
108
+ export { default as TextInputField } from './TextInputField';
105
109
  export { default as TextInputWithTokens } from './TextInputWithTokens';
106
110
  export type { TextInputWithTokensProps } from './TextInputWithTokens';
107
111
  export { default as Text } from './Text';
package/lib-esm/index.js CHANGED
@@ -30,6 +30,8 @@ export { NewButton } from './NewButton';
30
30
  export { default as Caret } from './Caret';
31
31
  export { default as CircleBadge } from './CircleBadge';
32
32
  export { default as CircleOcticon } from './CircleOcticon';
33
+ export { default as CheckboxInputField } from './CheckboxInputField';
34
+ export { default as ChoiceFieldset, Item } from './ChoiceFieldset';
33
35
  export { default as CounterLabel } from './CounterLabel';
34
36
  export { default as Details } from './Details';
35
37
  export { default as Dialog } from './Dialog';
@@ -55,6 +57,7 @@ export { default as Popover } from './Popover';
55
57
  // export {default as Portal, registerPortalRoot} from './Portal'
56
58
  // export type {PortalProps} from './Portal'
57
59
  export { default as ProgressBar } from './ProgressBar';
60
+ export { default as RadioInputField } from './RadioInputField';
58
61
  export { default as SelectMenu } from './SelectMenu';
59
62
  export { default as SideNav } from './SideNav';
60
63
  export { default as Spinner } from './Spinner';
@@ -63,6 +66,7 @@ export { default as StyledOcticon } from './StyledOcticon';
63
66
  export { default as SubNav } from './SubNav';
64
67
  export { default as TabNav } from './TabNav';
65
68
  export { default as TextInput } from './TextInput';
69
+ export { default as TextInputField } from './TextInputField';
66
70
  export { default as TextInputWithTokens } from './TextInputWithTokens';
67
71
  export { default as Text } from './Text';
68
72
  export { default as Timeline } from './Timeline';
@@ -0,0 +1 @@
1
+ export declare type FormValidationStatus = 'error' | 'success';
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-2021113194429",
3
+ "version": "0.0.0-2021113204024",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -43,7 +43,7 @@
43
43
  "author": "GitHub, Inc.",
44
44
  "license": "MIT",
45
45
  "dependencies": {
46
- "@primer/octicons-react": "^16.1.0",
46
+ "@primer/octicons-react": "16.1.1",
47
47
  "@primer/primitives": "7.1.1",
48
48
  "@radix-ui/react-polymorphic": "0.0.14",
49
49
  "@react-aria/ssr": "3.1.0",
@@ -65,7 +65,7 @@
65
65
  "@babel/cli": "7.14.5",
66
66
  "@babel/core": "7.14.8",
67
67
  "@babel/eslint-parser": "7.15.7",
68
- "@babel/plugin-proposal-nullish-coalescing-operator": "7.16.0",
68
+ "@babel/plugin-proposal-nullish-coalescing-operator": "7.14.5",
69
69
  "@babel/plugin-proposal-optional-chaining": "7.14.5",
70
70
  "@babel/plugin-transform-modules-commonjs": "7.14.5",
71
71
  "@babel/preset-react": "7.14.5",
@@ -75,7 +75,7 @@
75
75
  "@github/prettier-config": "0.0.4",
76
76
  "@rollup/plugin-commonjs": "19.0.2",
77
77
  "@rollup/plugin-node-resolve": "13.0.5",
78
- "@size-limit/preset-big-lib": "7.0.3",
78
+ "@size-limit/preset-big-lib": "5.0.2",
79
79
  "@storybook/addon-a11y": "6.3.12",
80
80
  "@storybook/addon-actions": "^6.3.12",
81
81
  "@storybook/addon-essentials": "6.3.12",
@@ -91,7 +91,6 @@
91
91
  "@types/jest-axe": "3.5.3",
92
92
  "@types/lodash.isempty": "4.4.6",
93
93
  "@types/lodash.isobject": "3.0.6",
94
- "@types/node": "16.11.11",
95
94
  "@typescript-eslint/eslint-plugin": "4.31.2",
96
95
  "@typescript-eslint/parser": "4.26.1",
97
96
  "@wojtekmaj/enzyme-adapter-react-17": "0.6.3",
@@ -100,7 +99,7 @@
100
99
  "babel-plugin-add-react-displayname": "0.0.5",
101
100
  "babel-plugin-macros": "3.1.0",
102
101
  "babel-plugin-preval": "5.0.0",
103
- "babel-plugin-styled-components": "2.0.2",
102
+ "babel-plugin-styled-components": "1.12.0",
104
103
  "babel-plugin-transform-replace-expressions": "0.2.0",
105
104
  "babel-polyfill": "6.26.0",
106
105
  "chroma-js": "2.1.2",
@@ -117,7 +116,6 @@
117
116
  "eslint-plugin-primer-react": "0.7.0",
118
117
  "eslint-plugin-react": "7.24.0",
119
118
  "eslint-plugin-react-hooks": "4.2.0",
120
- "front-matter": "4.0.2",
121
119
  "jest": "27.0.4",
122
120
  "jest-axe": "5.0.1",
123
121
  "jest-styled-components": "6.3.4",
@@ -130,16 +128,16 @@
130
128
  "react-dnd-html5-backend": "14.0.2",
131
129
  "react-dom": "17.0.2",
132
130
  "react-test-renderer": "17.0.2",
133
- "rollup": "2.60.2",
131
+ "rollup": "2.56.3",
134
132
  "rollup-plugin-babel": "4.4.0",
135
133
  "rollup-plugin-terser": "7.0.2",
136
134
  "rollup-plugin-visualizer": "5.5.0",
137
135
  "semver": "7.3.5",
138
- "size-limit": "7.0.3",
136
+ "size-limit": "5.0.2",
139
137
  "storybook-addon-performance": "0.16.1",
140
138
  "styled-components": "4.4.1",
141
139
  "ts-toolbelt": "9.6.0",
142
- "typescript": "4.4.4"
140
+ "typescript": "4.2.2"
143
141
  },
144
142
  "peerDependencies": {
145
143
  "react": "^17.0.0",
@@ -158,9 +156,5 @@
158
156
  "webpack": false,
159
157
  "running": false
160
158
  }
161
- ],
162
- "engines": {
163
- "node": ">=16",
164
- "npm": ">=8"
165
- }
159
+ ]
166
160
  }
@@ -1,10 +0,0 @@
1
- /** This context can be used by components that compose ActionList inside a Menu */
2
- import React from 'react';
3
- declare type ContextProps = {
4
- parent?: string;
5
- listRole?: string;
6
- itemRole?: string;
7
- afterSelect?: () => void;
8
- };
9
- export declare const MenuContext: React.Context<ContextProps>;
10
- export {};