@primer/components 0.0.0-2021113144816 → 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 -17
  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,34 @@
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 _InputLabel = _interopRequireDefault(require("../_InputLabel"));
11
+
12
+ var _slots = require("./slots");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ const InputFieldLabel = ({
17
+ children,
18
+ visuallyHidden
19
+ }) => /*#__PURE__*/_react.default.createElement(_slots.Slot, {
20
+ name: "Label"
21
+ }, ({
22
+ disabled,
23
+ id,
24
+ required
25
+ }) => /*#__PURE__*/_react.default.createElement(_InputLabel.default, {
26
+ htmlFor: id,
27
+ visuallyHidden: visuallyHidden,
28
+ required: required,
29
+ disabled: disabled
30
+ }, children));
31
+
32
+ InputFieldLabel.displayName = "InputFieldLabel";
33
+ var _default = InputFieldLabel;
34
+ exports.default = _default;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface InputFieldValidationProps {
3
+ validationKey: string;
4
+ }
5
+ declare const InputFieldValidation: React.FC<InputFieldValidationProps>;
6
+ export default InputFieldValidation;
@@ -3,13 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.MenuContext = void 0;
6
+ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
 
12
- /** This context can be used by components that compose ActionList inside a Menu */
13
- const MenuContext = /*#__PURE__*/_react.default.createContext({});
12
+ const InputFieldValidation = ({
13
+ children
14
+ }) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
14
15
 
15
- exports.MenuContext = MenuContext;
16
+ var _default = InputFieldValidation;
17
+ exports.default = _default;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Props as InputFieldProps } from './InputField';
3
+ import { FormValidationStatus } from '../utils/types/FormValidationStatus';
4
+ export interface ToggleInputFieldProps extends Pick<InputFieldProps, 'disabled' | 'id'> {
5
+ /**
6
+ * Styles the field to visually communicate the result of form validation
7
+ */
8
+ validationStatus?: FormValidationStatus;
9
+ }
10
+ declare const _default: React.FC<ToggleInputFieldProps> & {
11
+ LeadingVisual: React.FC<{}>;
12
+ };
13
+ export default _default;
@@ -0,0 +1,71 @@
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 _constants = require("../constants");
13
+
14
+ var _uniqueId = require("../utils/uniqueId");
15
+
16
+ var _slots = require("./slots");
17
+
18
+ var _ToggleInputLeadingVisual = _interopRequireDefault(require("./ToggleInputLeadingVisual"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ const ToggleInputField = ({
23
+ children,
24
+ disabled,
25
+ id,
26
+ validationStatus
27
+ }) => {
28
+ const fieldId = id || (0, _uniqueId.uniqueId)();
29
+ return /*#__PURE__*/_react.default.createElement(_slots.Slots, {
30
+ context: {
31
+ captionId: `${id}-caption`,
32
+ disabled,
33
+ id: fieldId,
34
+ validationStatus
35
+ }
36
+ }, slots => {
37
+ return /*#__PURE__*/_react.default.createElement(_.Box, {
38
+ display: "flex",
39
+ alignItems: slots.LeadingVisual ? 'center' : undefined
40
+ }, children, /*#__PURE__*/_react.default.createElement(_.Box, {
41
+ sx: {
42
+ '> input': {
43
+ marginLeft: 0,
44
+ marginRight: 0
45
+ }
46
+ }
47
+ }, slots.Input), slots.LeadingVisual && /*#__PURE__*/_react.default.createElement(_.Box, {
48
+ color: disabled ? 'fg.muted' : 'fg.default',
49
+ sx: {
50
+ '> *': {
51
+ minWidth: slots.Caption ? (0, _constants.get)('fontSizes.4') : (0, _constants.get)('fontSizes.2'),
52
+ minHeight: slots.Caption ? (0, _constants.get)('fontSizes.4') : (0, _constants.get)('fontSizes.2'),
53
+ fill: 'currentColor'
54
+ }
55
+ },
56
+ ml: 2
57
+ }, slots.LeadingVisual), /*#__PURE__*/_react.default.isValidElement(slots.Label) && !slots.Label.props.visuallyHidden || slots.Caption ? /*#__PURE__*/_react.default.createElement(_.Box, {
58
+ display: "flex",
59
+ flexDirection: "column",
60
+ ml: 2
61
+ }, slots.Label, slots.Caption) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, slots.Label, slots.Caption));
62
+ });
63
+ };
64
+
65
+ ToggleInputField.displayName = "ToggleInputField";
66
+
67
+ var _default = Object.assign(ToggleInputField, {
68
+ LeadingVisual: _ToggleInputLeadingVisual.default
69
+ });
70
+
71
+ exports.default = _default;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ToggleInputLeadingVisual: React.FC;
3
+ export default ToggleInputLeadingVisual;
@@ -0,0 +1,22 @@
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 _slots = require("./slots");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const ToggleInputLeadingVisual = ({
15
+ children
16
+ }) => /*#__PURE__*/_react.default.createElement(_slots.Slot, {
17
+ name: "LeadingVisual"
18
+ }, children);
19
+
20
+ ToggleInputLeadingVisual.displayName = "ToggleInputLeadingVisual";
21
+ var _default = ToggleInputLeadingVisual;
22
+ exports.default = _default;
@@ -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,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
+
12
+ var _ = require("..");
13
+
14
+ 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); }
15
+
16
+ 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; }
17
+
18
+ const fadeIn = (0, _styledComponents.keyframes)(["0%{opacity:0;transform:translateY(-100%);}100%{opacity:1;transform:translateY(0);}"]); // using easeOutQuint easing fn https://easings.net/#easeOutQuint
19
+
20
+ const AnimatedElement = _styledComponents.default.div.withConfig({
21
+ displayName: "ValidationAnimationContainer__AnimatedElement",
22
+ componentId: "sc-1grmoaz-0"
23
+ })(["animation:", ";"], props => props.show && (0, _styledComponents.css)(["170ms ", " cubic-bezier(0.44,0.74,0.36,1);"], fadeIn));
24
+
25
+ const ValidationAnimationContainer = ({
26
+ show,
27
+ children
28
+ }) => {
29
+ const [shouldRender, setRender] = (0, _react.useState)(show);
30
+ (0, _react.useEffect)(() => {
31
+ if (show) setRender(true);
32
+ }, [show]);
33
+
34
+ const onAnimationEnd = () => {
35
+ if (!show) setRender(false);
36
+ };
37
+
38
+ return shouldRender ? /*#__PURE__*/_react.default.createElement(_.Box, {
39
+ height: show ? 'auto' : 0,
40
+ overflow: "hidden"
41
+ }, /*#__PURE__*/_react.default.createElement(AnimatedElement, {
42
+ show: show,
43
+ onAnimationEnd: onAnimationEnd
44
+ }, children)) : null;
45
+ };
46
+
47
+ var _default = ValidationAnimationContainer;
48
+ exports.default = _default;
@@ -0,0 +1 @@
1
+ export { default } from './InputField';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _InputField.default;
10
+ }
11
+ });
12
+
13
+ var _InputField = _interopRequireDefault(require("./InputField"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -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,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Slot = exports.Slots = void 0;
7
+
8
+ var _createSlots = _interopRequireDefault(require("../utils/create-slots"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ const {
13
+ Slots,
14
+ Slot
15
+ } = (0, _createSlots.default)(['Caption', 'Input', 'Label', 'LeadingVisual']);
16
+ exports.Slot = Slot;
17
+ exports.Slots = Slots;
@@ -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,44 @@
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 _VisuallyHidden = _interopRequireDefault(require("./_VisuallyHidden"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ const InputLabel = ({
17
+ children,
18
+ disabled,
19
+ required,
20
+ visuallyHidden,
21
+ htmlFor
22
+ }) => {
23
+ return /*#__PURE__*/_react.default.createElement(_VisuallyHidden.default, {
24
+ isVisible: !visuallyHidden,
25
+ as: "label",
26
+ htmlFor: htmlFor,
27
+ title: required ? 'required field' : undefined,
28
+ sx: {
29
+ fontWeight: 'bold',
30
+ fontSize: 1,
31
+ display: 'block',
32
+ color: disabled ? 'fg.muted' : 'fg.default'
33
+ }
34
+ }, required ? /*#__PURE__*/_react.default.createElement(_.Box, {
35
+ display: "flex",
36
+ as: "span"
37
+ }, /*#__PURE__*/_react.default.createElement(_.Box, {
38
+ mr: 1
39
+ }, children), /*#__PURE__*/_react.default.createElement("span", null, "*")) : children);
40
+ };
41
+
42
+ InputLabel.displayName = "InputLabel";
43
+ var _default = InputLabel;
44
+ exports.default = _default;
@@ -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,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _octiconsReact = require("@primer/octicons-react");
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _ = require(".");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ const validationIconMap = {
17
+ success: _octiconsReact.CheckCircleFillIcon,
18
+ error: _octiconsReact.AlertFillIcon
19
+ };
20
+ const validationColorMap = {
21
+ success: 'success.fg',
22
+ error: 'danger.fg'
23
+ };
24
+
25
+ const InputValidation = ({
26
+ children,
27
+ id,
28
+ validationStatus
29
+ }) => {
30
+ const IconComponent = validationStatus ? validationIconMap[validationStatus] : undefined;
31
+ const fgColor = validationStatus ? validationColorMap[validationStatus] : undefined;
32
+ return /*#__PURE__*/_react.default.createElement(_.Text, {
33
+ display: "flex",
34
+ color: fgColor,
35
+ fontSize: 0,
36
+ sx: {
37
+ alignItems: 'baseline',
38
+ a: {
39
+ color: 'currentColor',
40
+ textDecoration: 'underline'
41
+ }
42
+ }
43
+ }, IconComponent && /*#__PURE__*/_react.default.createElement(_.Box, {
44
+ as: "span",
45
+ mr: 1
46
+ }, /*#__PURE__*/_react.default.createElement(IconComponent, {
47
+ size: 12,
48
+ fill: "currentColor"
49
+ })), /*#__PURE__*/_react.default.createElement("span", {
50
+ id: id
51
+ }, children));
52
+ };
53
+
54
+ InputValidation.displayName = "InputValidation";
55
+ var _default = InputValidation;
56
+ exports.default = _default;
@@ -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,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+
10
+ var _sx = _interopRequireDefault(require("./sx"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const VisuallyHidden = _styledComponents.default.span.withConfig({
15
+ displayName: "_VisuallyHidden__VisuallyHidden",
16
+ componentId: "sc-1k15c4h-0"
17
+ })(["", ""], props => {
18
+ if (props.isVisible) {
19
+ return _sx.default;
20
+ }
21
+
22
+ return `
23
+ position: absolute;
24
+ width: 1px;
25
+ height: 1px;
26
+ padding: 0;
27
+ margin: -1px;
28
+ overflow: hidden;
29
+ clip: rect(0, 0, 0, 0);
30
+ white-space: nowrap;
31
+ border-width: 0;
32
+ `;
33
+ });
34
+
35
+ VisuallyHidden.defaultProps = {
36
+ isVisible: true
37
+ };
38
+ var _default = VisuallyHidden;
39
+ exports.default = _default;
package/lib/drafts.d.ts CHANGED
@@ -6,4 +6,3 @@
6
6
  */
7
7
  export * from './ActionList2';
8
8
  export * from './NewButton';
9
- export * from './ActionMenu2';
package/lib/drafts.js CHANGED
@@ -28,17 +28,4 @@ Object.keys(_NewButton).forEach(function (key) {
28
28
  return _NewButton[key];
29
29
  }
30
30
  });
31
- });
32
-
33
- var _ActionMenu = require("./ActionMenu2");
34
-
35
- Object.keys(_ActionMenu).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _ActionMenu[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function () {
41
- return _ActionMenu[key];
42
- }
43
- });
44
31
  });
package/lib/index.d.ts CHANGED
@@ -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/index.js CHANGED
@@ -267,6 +267,24 @@ Object.defineProperty(exports, "CircleOcticon", {
267
267
  return _CircleOcticon.default;
268
268
  }
269
269
  });
270
+ Object.defineProperty(exports, "CheckboxInputField", {
271
+ enumerable: true,
272
+ get: function () {
273
+ return _CheckboxInputField.default;
274
+ }
275
+ });
276
+ Object.defineProperty(exports, "ChoiceFieldset", {
277
+ enumerable: true,
278
+ get: function () {
279
+ return _ChoiceFieldset.default;
280
+ }
281
+ });
282
+ Object.defineProperty(exports, "Item", {
283
+ enumerable: true,
284
+ get: function () {
285
+ return _ChoiceFieldset.Item;
286
+ }
287
+ });
270
288
  Object.defineProperty(exports, "CounterLabel", {
271
289
  enumerable: true,
272
290
  get: function () {
@@ -393,6 +411,12 @@ Object.defineProperty(exports, "ProgressBar", {
393
411
  return _ProgressBar.default;
394
412
  }
395
413
  });
414
+ Object.defineProperty(exports, "RadioInputField", {
415
+ enumerable: true,
416
+ get: function () {
417
+ return _RadioInputField.default;
418
+ }
419
+ });
396
420
  Object.defineProperty(exports, "SelectMenu", {
397
421
  enumerable: true,
398
422
  get: function () {
@@ -441,6 +465,12 @@ Object.defineProperty(exports, "TextInput", {
441
465
  return _TextInput.default;
442
466
  }
443
467
  });
468
+ Object.defineProperty(exports, "TextInputField", {
469
+ enumerable: true,
470
+ get: function () {
471
+ return _TextInputField.default;
472
+ }
473
+ });
444
474
  Object.defineProperty(exports, "TextInputWithTokens", {
445
475
  enumerable: true,
446
476
  get: function () {
@@ -572,6 +602,10 @@ var _CircleBadge = _interopRequireDefault(require("./CircleBadge"));
572
602
 
573
603
  var _CircleOcticon = _interopRequireDefault(require("./CircleOcticon"));
574
604
 
605
+ var _CheckboxInputField = _interopRequireDefault(require("./CheckboxInputField"));
606
+
607
+ var _ChoiceFieldset = _interopRequireWildcard(require("./ChoiceFieldset"));
608
+
575
609
  var _CounterLabel = _interopRequireDefault(require("./CounterLabel"));
576
610
 
577
611
  var _Details = _interopRequireDefault(require("./Details"));
@@ -612,6 +646,8 @@ var _Popover = _interopRequireDefault(require("./Popover"));
612
646
 
613
647
  var _ProgressBar = _interopRequireDefault(require("./ProgressBar"));
614
648
 
649
+ var _RadioInputField = _interopRequireDefault(require("./RadioInputField"));
650
+
615
651
  var _SelectMenu = _interopRequireDefault(require("./SelectMenu"));
616
652
 
617
653
  var _SideNav = _interopRequireDefault(require("./SideNav"));
@@ -628,6 +664,8 @@ var _TabNav = _interopRequireDefault(require("./TabNav"));
628
664
 
629
665
  var _TextInput = _interopRequireDefault(require("./TextInput"));
630
666
 
667
+ var _TextInputField = _interopRequireDefault(require("./TextInputField"));
668
+
631
669
  var _TextInputWithTokens = _interopRequireDefault(require("./TextInputWithTokens"));
632
670
 
633
671
  var _Text = _interopRequireDefault(require("./Text"));
@@ -0,0 +1 @@
1
+ export declare type FormValidationStatus = 'error' | 'success';
@@ -0,0 +1 @@
1
+ "use strict";
@@ -10,7 +10,7 @@ import sx from '../sx';
10
10
 
11
11
  export const StyledHeader = styled.div.withConfig({
12
12
  displayName: "Header__StyledHeader",
13
- componentId: "sc-qmofje-0"
13
+ componentId: "qmofje-0"
14
14
  })(["{}padding:6px ", ";font-size:", ";font-weight:", ";color:", ";", " ", ""], get('space.3'), get('fontSizes.0'), get('fontWeights.bold'), get('colors.fg.muted'), ({
15
15
  variant
16
16
  }) => variant === 'filled' && css(["background:", ";margin:", " 0;border-top:1px solid ", ";border-bottom:1px solid ", ";&:first-child{margin-top:0;}"], get('colors.canvas.subtle'), get('space.2'), get('colors.neutral.muted'), get('colors.neutral.muted')), sx);