@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.
- package/CHANGELOG.md +986 -0
- package/dist/browser.esm.js +2227 -2
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +2227 -2
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Header.js +1 -1
- package/lib/ActionList/Item.js +10 -10
- package/lib/ActionList/List.js +1 -1
- package/lib/ActionList2/Divider.d.ts +2 -3
- package/lib/ActionList2/Divider.js +5 -10
- package/lib/ActionList2/Item.js +6 -22
- package/lib/ActionList2/List.js +2 -12
- package/lib/ActionList2/Selection.js +0 -11
- package/lib/ActionList2/index.d.ts +2 -1
- package/lib/Autocomplete/Autocomplete.d.ts +1 -2
- package/lib/Autocomplete/AutocompleteInput.d.ts +1 -2
- package/lib/Autocomplete/AutocompleteMenu.js +6 -13
- package/lib/Avatar.d.ts +2 -1
- package/lib/Avatar.js +1 -1
- package/lib/BaseStyles.js +20 -2
- package/lib/BorderBox.js +1 -1
- package/lib/Box.js +1 -1
- package/lib/BranchName.d.ts +2 -1
- package/lib/BranchName.js +1 -1
- package/lib/Breadcrumbs.js +3 -3
- package/lib/Button/Button.d.ts +2 -2
- package/lib/Button/Button.js +1 -1
- package/lib/Button/ButtonClose.d.ts +2 -2
- package/lib/Button/ButtonDanger.d.ts +2 -2
- package/lib/Button/ButtonGroup.js +1 -1
- package/lib/Button/ButtonInvisible.d.ts +2 -2
- package/lib/Button/ButtonOutline.d.ts +2 -2
- package/lib/Button/ButtonPrimary.d.ts +2 -2
- package/lib/Checkbox.d.ts +1 -1
- package/lib/Checkbox.js +1 -1
- package/lib/CheckboxInputField.d.ts +11 -0
- package/lib/CheckboxInputField.js +73 -0
- package/lib/ChoiceFieldset/ChoiceFieldCaption.d.ts +3 -0
- package/lib/ChoiceFieldset/ChoiceFieldCaption.js +35 -0
- package/lib/ChoiceFieldset/ChoiceFieldLabel.d.ts +3 -0
- package/lib/ChoiceFieldset/ChoiceFieldLabel.js +35 -0
- package/lib/ChoiceFieldset/ChoiceFieldset.d.ts +65 -0
- package/lib/ChoiceFieldset/ChoiceFieldset.js +95 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +3 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetDescription.js +29 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +9 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetLegend.js +44 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetList.d.ts +9 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetList.js +80 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +19 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetListContext.js +15 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +25 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetListItem.js +75 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +6 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetValidation.js +17 -0
- package/lib/ChoiceFieldset/index.d.ts +3 -0
- package/lib/ChoiceFieldset/index.js +23 -0
- package/lib/CircleOcticon.d.ts +35 -35
- package/lib/Details.d.ts +2 -1
- package/lib/Details.js +4 -2
- package/lib/Dialog.d.ts +37 -37
- package/lib/Dropdown.d.ts +72 -8
- package/lib/DropdownMenu/DropdownButton.d.ts +3 -6
- package/lib/FilterList.d.ts +1 -1
- package/lib/FilteredActionList/FilteredActionList.js +1 -1
- package/lib/Flex.js +1 -1
- package/lib/Heading.d.ts +2 -1
- package/lib/Heading.js +6 -1
- package/lib/LabelGroup.js +1 -1
- package/lib/Overlay.js +1 -1
- package/lib/Pagination/Pagination.js +2 -2
- package/lib/Position.d.ts +4 -4
- package/lib/Position.js +1 -1
- package/lib/ProgressBar.d.ts +11 -16
- package/lib/ProgressBar.js +10 -6
- package/lib/RadioInputField.d.ts +9 -0
- package/lib/RadioInputField.js +82 -0
- package/lib/SelectMenu/SelectMenu.d.ts +10 -11
- package/lib/SelectMenu/SelectMenu.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib/Spinner.d.ts +2 -1
- package/lib/Spinner.js +3 -1
- package/lib/StateLabel.js +1 -1
- package/lib/StyledOcticon.js +1 -1
- package/lib/SubNav.js +3 -3
- package/lib/TextInputField.d.ts +581 -0
- package/lib/TextInputField.js +66 -0
- package/lib/TextInputWithTokens.d.ts +1 -2
- package/lib/ThemeProvider.d.ts +0 -1
- package/lib/ThemeProvider.js +4 -17
- package/lib/Timeline.js +4 -4
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/AvatarToken.js +1 -1
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Token/TokenBase.js +1 -1
- package/lib/Tooltip.js +1 -1
- package/lib/UnderlineNav.js +2 -2
- package/lib/_InputCaption.d.ts +13 -0
- package/lib/_InputCaption.js +27 -0
- package/lib/_InputField/InputField.d.ts +39 -0
- package/lib/_InputField/InputField.js +90 -0
- package/lib/_InputField/InputFieldCaption.d.ts +3 -0
- package/lib/_InputField/InputFieldCaption.js +30 -0
- package/lib/_InputField/InputFieldLabel.d.ts +9 -0
- package/lib/_InputField/InputFieldLabel.js +34 -0
- package/lib/_InputField/InputFieldValidation.d.ts +6 -0
- package/lib/{ActionList2/MenuContext.js → _InputField/InputFieldValidation.js} +6 -4
- package/lib/_InputField/ToggleInputField.d.ts +13 -0
- package/lib/_InputField/ToggleInputField.js +71 -0
- package/lib/_InputField/ToggleInputLeadingVisual.d.ts +3 -0
- package/lib/_InputField/ToggleInputLeadingVisual.js +22 -0
- package/lib/_InputField/ValidationAnimationContainer.d.ts +6 -0
- package/lib/_InputField/ValidationAnimationContainer.js +48 -0
- package/lib/_InputField/index.d.ts +1 -0
- package/lib/_InputField/index.js +15 -0
- package/lib/_InputField/slots.d.ts +13 -0
- package/lib/_InputField/slots.js +17 -0
- package/lib/_InputLabel.d.ts +8 -0
- package/lib/_InputLabel.js +44 -0
- package/lib/_InputValidation.d.ts +8 -0
- package/lib/_InputValidation.js +56 -0
- package/lib/_VisuallyHidden.d.ts +6 -0
- package/lib/_VisuallyHidden.js +39 -0
- package/lib/drafts.d.ts +0 -1
- package/lib/drafts.js +0 -13
- package/lib/index.d.ts +4 -0
- package/lib/index.js +38 -0
- package/lib/utils/types/FormValidationStatus.d.ts +1 -0
- package/lib/utils/types/FormValidationStatus.js +1 -0
- package/lib-esm/ActionList/Header.js +1 -1
- package/lib-esm/ActionList/Item.js +10 -10
- package/lib-esm/ActionList/List.js +1 -1
- package/lib-esm/ActionList2/Divider.d.ts +2 -3
- package/lib-esm/ActionList2/Divider.js +5 -8
- package/lib-esm/ActionList2/Item.js +6 -20
- package/lib-esm/ActionList2/List.js +2 -10
- package/lib-esm/ActionList2/Selection.js +0 -9
- package/lib-esm/ActionList2/index.d.ts +2 -1
- package/lib-esm/Autocomplete/Autocomplete.d.ts +1 -2
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +1 -2
- package/lib-esm/Autocomplete/AutocompleteMenu.js +3 -13
- package/lib-esm/Avatar.d.ts +2 -1
- package/lib-esm/Avatar.js +2 -2
- package/lib-esm/BaseStyles.js +20 -2
- package/lib-esm/BorderBox.js +1 -1
- package/lib-esm/Box.js +1 -1
- package/lib-esm/BranchName.d.ts +2 -1
- package/lib-esm/BranchName.js +2 -2
- package/lib-esm/Breadcrumbs.js +3 -3
- package/lib-esm/Button/Button.d.ts +2 -2
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +2 -2
- package/lib-esm/Button/ButtonGroup.js +1 -1
- package/lib-esm/Button/ButtonInvisible.d.ts +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +2 -2
- package/lib-esm/Checkbox.d.ts +1 -1
- package/lib-esm/Checkbox.js +1 -1
- package/lib-esm/CheckboxInputField.d.ts +11 -0
- package/lib-esm/CheckboxInputField.js +56 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.d.ts +3 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.js +20 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.d.ts +3 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.js +20 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldset.d.ts +65 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldset.js +72 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +3 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.js +17 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +9 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.js +31 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.d.ts +9 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.js +63 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +19 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.js +5 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +25 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.js +51 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +6 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.js +7 -0
- package/lib-esm/ChoiceFieldset/index.d.ts +3 -0
- package/lib-esm/ChoiceFieldset/index.js +2 -0
- package/lib-esm/CircleOcticon.d.ts +35 -35
- package/lib-esm/Details.d.ts +2 -1
- package/lib-esm/Details.js +3 -2
- package/lib-esm/Dialog.d.ts +37 -37
- package/lib-esm/Dropdown.d.ts +72 -8
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +3 -6
- package/lib-esm/FilterList.d.ts +1 -1
- package/lib-esm/FilteredActionList/FilteredActionList.js +1 -1
- package/lib-esm/Flex.js +1 -1
- package/lib-esm/Heading.d.ts +2 -1
- package/lib-esm/Heading.js +6 -2
- package/lib-esm/LabelGroup.js +1 -1
- package/lib-esm/Overlay.js +1 -1
- package/lib-esm/Pagination/Pagination.js +2 -2
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/Position.js +1 -1
- package/lib-esm/ProgressBar.d.ts +11 -16
- package/lib-esm/ProgressBar.js +11 -7
- package/lib-esm/RadioInputField.d.ts +9 -0
- package/lib-esm/RadioInputField.js +65 -0
- package/lib-esm/SelectMenu/SelectMenu.d.ts +10 -11
- package/lib-esm/SelectMenu/SelectMenu.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuItem.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib-esm/Spinner.d.ts +2 -1
- package/lib-esm/Spinner.js +2 -1
- package/lib-esm/StateLabel.js +1 -1
- package/lib-esm/StyledOcticon.js +1 -1
- package/lib-esm/SubNav.js +3 -3
- package/lib-esm/TextInputField.d.ts +581 -0
- package/lib-esm/TextInputField.js +50 -0
- package/lib-esm/TextInputWithTokens.d.ts +1 -2
- package/lib-esm/ThemeProvider.d.ts +0 -1
- package/lib-esm/ThemeProvider.js +4 -17
- package/lib-esm/Timeline.js +4 -4
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/AvatarToken.js +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Token/TokenBase.js +1 -1
- package/lib-esm/Tooltip.js +1 -1
- package/lib-esm/UnderlineNav.js +2 -2
- package/lib-esm/_InputCaption.d.ts +13 -0
- package/lib-esm/_InputCaption.js +16 -0
- package/lib-esm/_InputField/InputField.d.ts +39 -0
- package/lib-esm/_InputField/InputField.js +70 -0
- package/lib-esm/_InputField/InputFieldCaption.d.ts +3 -0
- package/lib-esm/_InputField/InputFieldCaption.js +18 -0
- package/lib-esm/_InputField/InputFieldLabel.d.ts +9 -0
- package/lib-esm/_InputField/InputFieldLabel.js +22 -0
- package/lib-esm/_InputField/InputFieldValidation.d.ts +6 -0
- package/lib-esm/_InputField/InputFieldValidation.js +7 -0
- package/lib-esm/_InputField/ToggleInputField.d.ts +13 -0
- package/lib-esm/_InputField/ToggleInputField.js +54 -0
- package/lib-esm/_InputField/ToggleInputLeadingVisual.d.ts +3 -0
- package/lib-esm/_InputField/ToggleInputLeadingVisual.js +11 -0
- package/lib-esm/_InputField/ValidationAnimationContainer.d.ts +6 -0
- package/lib-esm/_InputField/ValidationAnimationContainer.js +33 -0
- package/lib-esm/_InputField/index.d.ts +1 -0
- package/lib-esm/_InputField/index.js +1 -0
- package/lib-esm/_InputField/slots.d.ts +13 -0
- package/lib-esm/_InputField/slots.js +5 -0
- package/lib-esm/_InputLabel.d.ts +8 -0
- package/lib-esm/_InputLabel.js +32 -0
- package/lib-esm/_InputValidation.d.ts +8 -0
- package/lib-esm/_InputValidation.js +43 -0
- package/lib-esm/_VisuallyHidden.d.ts +6 -0
- package/lib-esm/_VisuallyHidden.js +26 -0
- package/lib-esm/drafts.d.ts +0 -1
- package/lib-esm/drafts.js +1 -2
- package/lib-esm/index.d.ts +4 -0
- package/lib-esm/index.js +4 -0
- package/lib-esm/utils/types/FormValidationStatus.d.ts +1 -0
- package/lib-esm/utils/types/FormValidationStatus.js +1 -0
- package/package.json +9 -17
- package/lib/ActionList2/MenuContext.d.ts +0 -10
- package/lib/ActionMenu2.d.ts +0 -313
- package/lib/ActionMenu2.js +0 -91
- package/lib-esm/ActionList2/MenuContext.d.ts +0 -10
- package/lib-esm/ActionList2/MenuContext.js +0 -3
- package/lib-esm/ActionMenu2.d.ts +0 -313
- package/lib-esm/ActionMenu2.js +0 -67
@@ -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,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,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;
|
package/lib-esm/drafts.d.ts
CHANGED
package/lib-esm/drafts.js
CHANGED
package/lib-esm/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-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-
|
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",
|
@@ -15,7 +15,6 @@
|
|
15
15
|
"start": "concurrently npm:start:*",
|
16
16
|
"start:docs": "cd docs && npm run develop",
|
17
17
|
"start:storybook": "start-storybook -p 6006",
|
18
|
-
"build:storybook": "build-storybook",
|
19
18
|
"lint": "eslint '**/*.{js,ts,tsx,md,mdx}' --max-warnings=0",
|
20
19
|
"lint:fix": "npm run lint -- --fix",
|
21
20
|
"test": "jest",
|
@@ -44,7 +43,7 @@
|
|
44
43
|
"author": "GitHub, Inc.",
|
45
44
|
"license": "MIT",
|
46
45
|
"dependencies": {
|
47
|
-
"@primer/octicons-react": "
|
46
|
+
"@primer/octicons-react": "16.1.1",
|
48
47
|
"@primer/primitives": "7.1.1",
|
49
48
|
"@radix-ui/react-polymorphic": "0.0.14",
|
50
49
|
"@react-aria/ssr": "3.1.0",
|
@@ -66,7 +65,7 @@
|
|
66
65
|
"@babel/cli": "7.14.5",
|
67
66
|
"@babel/core": "7.14.8",
|
68
67
|
"@babel/eslint-parser": "7.15.7",
|
69
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "7.
|
68
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "7.14.5",
|
70
69
|
"@babel/plugin-proposal-optional-chaining": "7.14.5",
|
71
70
|
"@babel/plugin-transform-modules-commonjs": "7.14.5",
|
72
71
|
"@babel/preset-react": "7.14.5",
|
@@ -76,7 +75,7 @@
|
|
76
75
|
"@github/prettier-config": "0.0.4",
|
77
76
|
"@rollup/plugin-commonjs": "19.0.2",
|
78
77
|
"@rollup/plugin-node-resolve": "13.0.5",
|
79
|
-
"@size-limit/preset-big-lib": "
|
78
|
+
"@size-limit/preset-big-lib": "5.0.2",
|
80
79
|
"@storybook/addon-a11y": "6.3.12",
|
81
80
|
"@storybook/addon-actions": "^6.3.12",
|
82
81
|
"@storybook/addon-essentials": "6.3.12",
|
@@ -92,7 +91,6 @@
|
|
92
91
|
"@types/jest-axe": "3.5.3",
|
93
92
|
"@types/lodash.isempty": "4.4.6",
|
94
93
|
"@types/lodash.isobject": "3.0.6",
|
95
|
-
"@types/node": "16.11.11",
|
96
94
|
"@typescript-eslint/eslint-plugin": "4.31.2",
|
97
95
|
"@typescript-eslint/parser": "4.26.1",
|
98
96
|
"@wojtekmaj/enzyme-adapter-react-17": "0.6.3",
|
@@ -101,11 +99,10 @@
|
|
101
99
|
"babel-plugin-add-react-displayname": "0.0.5",
|
102
100
|
"babel-plugin-macros": "3.1.0",
|
103
101
|
"babel-plugin-preval": "5.0.0",
|
104
|
-
"babel-plugin-styled-components": "
|
102
|
+
"babel-plugin-styled-components": "1.12.0",
|
105
103
|
"babel-plugin-transform-replace-expressions": "0.2.0",
|
106
104
|
"babel-polyfill": "6.26.0",
|
107
105
|
"chroma-js": "2.1.2",
|
108
|
-
"chromatic": "6.1.0",
|
109
106
|
"concurrently": "6.2.1",
|
110
107
|
"copyfiles": "2.4.1",
|
111
108
|
"cross-env": "7.0.3",
|
@@ -119,7 +116,6 @@
|
|
119
116
|
"eslint-plugin-primer-react": "0.7.0",
|
120
117
|
"eslint-plugin-react": "7.24.0",
|
121
118
|
"eslint-plugin-react-hooks": "4.2.0",
|
122
|
-
"front-matter": "4.0.2",
|
123
119
|
"jest": "27.0.4",
|
124
120
|
"jest-axe": "5.0.1",
|
125
121
|
"jest-styled-components": "6.3.4",
|
@@ -132,16 +128,16 @@
|
|
132
128
|
"react-dnd-html5-backend": "14.0.2",
|
133
129
|
"react-dom": "17.0.2",
|
134
130
|
"react-test-renderer": "17.0.2",
|
135
|
-
"rollup": "2.
|
131
|
+
"rollup": "2.56.3",
|
136
132
|
"rollup-plugin-babel": "4.4.0",
|
137
133
|
"rollup-plugin-terser": "7.0.2",
|
138
134
|
"rollup-plugin-visualizer": "5.5.0",
|
139
135
|
"semver": "7.3.5",
|
140
|
-
"size-limit": "
|
136
|
+
"size-limit": "5.0.2",
|
141
137
|
"storybook-addon-performance": "0.16.1",
|
142
138
|
"styled-components": "4.4.1",
|
143
139
|
"ts-toolbelt": "9.6.0",
|
144
|
-
"typescript": "4.
|
140
|
+
"typescript": "4.2.2"
|
145
141
|
},
|
146
142
|
"peerDependencies": {
|
147
143
|
"react": "^17.0.0",
|
@@ -160,9 +156,5 @@
|
|
160
156
|
"webpack": false,
|
161
157
|
"running": false
|
162
158
|
}
|
163
|
-
]
|
164
|
-
"engines": {
|
165
|
-
"node": ">=16",
|
166
|
-
"npm": ">=8"
|
167
|
-
}
|
159
|
+
]
|
168
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 {};
|