@primer/components 0.0.0-2021111193153 → 0.0.0-202111121740
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 +2 -12
- package/dist/browser.esm.js +605 -587
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +222 -204
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/Divider.d.ts +2 -3
- package/lib/ActionList2/Divider.js +5 -10
- package/lib/ActionList2/Item.js +5 -21
- package/lib/ActionList2/List.js +1 -11
- package/lib/ActionList2/Selection.js +0 -11
- package/lib/ActionList2/index.d.ts +2 -1
- package/lib/Autocomplete/AutocompleteMenu.js +6 -13
- package/lib/Avatar.d.ts +2 -1
- package/lib/Avatar.js +1 -1
- package/lib/BranchName.d.ts +2 -1
- package/lib/BranchName.js +1 -1
- package/lib/Checkbox.d.ts +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 +63 -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 +6 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetLegend.js +44 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetList.d.ts +6 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetList.js +80 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +18 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetListContext.js +15 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +25 -0
- package/lib/ChoiceFieldset/ChoiceFieldsetListItem.js +74 -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/Details.d.ts +2 -1
- package/lib/Details.js +3 -1
- package/lib/Dropdown.d.ts +66 -2
- package/lib/Heading.d.ts +2 -1
- package/lib/Heading.js +6 -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/Spinner.d.ts +2 -1
- package/lib/Spinner.js +3 -1
- package/lib/TextInputField.d.ts +581 -0
- package/lib/TextInputField.js +66 -0
- 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/ActionList2/Divider.d.ts +2 -3
- package/lib-esm/ActionList2/Divider.js +5 -8
- package/lib-esm/ActionList2/Item.js +5 -19
- package/lib-esm/ActionList2/List.js +1 -9
- package/lib-esm/ActionList2/Selection.js +0 -9
- package/lib-esm/ActionList2/index.d.ts +2 -1
- 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/BranchName.d.ts +2 -1
- package/lib-esm/BranchName.js +2 -2
- package/lib-esm/Checkbox.d.ts +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 +63 -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 +6 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.js +31 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.d.ts +6 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.js +63 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +18 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.js +5 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +25 -0
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.js +50 -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/Details.d.ts +2 -1
- package/lib-esm/Details.js +2 -1
- package/lib-esm/Dropdown.d.ts +66 -2
- package/lib-esm/Heading.d.ts +2 -1
- package/lib-esm/Heading.js +6 -2
- 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/Spinner.d.ts +2 -1
- package/lib-esm/Spinner.js +2 -1
- package/lib-esm/TextInputField.d.ts +581 -0
- package/lib-esm/TextInputField.js +50 -0
- 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 +2 -2
- package/lib/ActionList2/MenuContext.d.ts +0 -10
- package/lib/ActionMenu2.d.ts +0 -310
- 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 -310
- package/lib-esm/ActionMenu2.js +0 -67
@@ -0,0 +1,82 @@
|
|
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 _InputField = _interopRequireDefault(require("./_InputField/InputField"));
|
11
|
+
|
12
|
+
var _slots = require("./_InputField/slots");
|
13
|
+
|
14
|
+
var _ToggleInputField = _interopRequireDefault(require("./_InputField/ToggleInputField"));
|
15
|
+
|
16
|
+
var _ToggleInputLeadingVisual = _interopRequireDefault(require("./_InputField/ToggleInputLeadingVisual"));
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
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); }
|
21
|
+
|
22
|
+
// TODO: use Primer's checkbox input once it's available
|
23
|
+
// https://github.com/github/primer/issues/489
|
24
|
+
const RadioInput = props => {
|
25
|
+
return /*#__PURE__*/_react.default.createElement("input", _extends({
|
26
|
+
type: "radio"
|
27
|
+
}, props));
|
28
|
+
};
|
29
|
+
|
30
|
+
RadioInput.displayName = "RadioInput";
|
31
|
+
|
32
|
+
// pulling out `id`, `disabled`, and `required` because those should come from the parent TextInputField component
|
33
|
+
const Input = ({
|
34
|
+
id: idProp,
|
35
|
+
required: requiredProp,
|
36
|
+
disabled: disabledProp,
|
37
|
+
...rest
|
38
|
+
}) => {
|
39
|
+
if (idProp) {
|
40
|
+
// eslint-disable-next-line no-console
|
41
|
+
console.warn("instead of passing the 'id' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
|
42
|
+
}
|
43
|
+
|
44
|
+
if (disabledProp) {
|
45
|
+
// eslint-disable-next-line no-console
|
46
|
+
console.warn("instead of passing the 'disabled' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
|
47
|
+
}
|
48
|
+
|
49
|
+
if (requiredProp) {
|
50
|
+
// eslint-disable-next-line no-console
|
51
|
+
console.warn("instead of passing the 'required' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
|
52
|
+
}
|
53
|
+
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_slots.Slot, {
|
55
|
+
name: "Input"
|
56
|
+
}, ({
|
57
|
+
disabled,
|
58
|
+
id,
|
59
|
+
required,
|
60
|
+
captionId
|
61
|
+
}) => /*#__PURE__*/_react.default.createElement(RadioInput, _extends({
|
62
|
+
"aria-describedby": captionId,
|
63
|
+
id: id,
|
64
|
+
required: required,
|
65
|
+
disabled: disabled
|
66
|
+
}, rest)));
|
67
|
+
};
|
68
|
+
|
69
|
+
Input.displayName = "Input";
|
70
|
+
|
71
|
+
const RadioInputField = props => /*#__PURE__*/_react.default.createElement(_ToggleInputField.default, props);
|
72
|
+
|
73
|
+
RadioInputField.displayName = "RadioInputField";
|
74
|
+
|
75
|
+
var _default = Object.assign(RadioInputField, {
|
76
|
+
Input,
|
77
|
+
Caption: _InputField.default.Caption,
|
78
|
+
Label: _InputField.default.Label,
|
79
|
+
LeadingVisual: _ToggleInputLeadingVisual.default
|
80
|
+
});
|
81
|
+
|
82
|
+
exports.default = _default;
|
package/lib/Spinner.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { SystemCommonProps } from './constants';
|
2
3
|
import { SxProp } from './sx';
|
3
4
|
import { ComponentProps } from './utils/types';
|
4
5
|
declare const sizeMap: {
|
@@ -11,6 +12,6 @@ export interface SpinnerInternalProps {
|
|
11
12
|
size?: keyof typeof sizeMap;
|
12
13
|
}
|
13
14
|
declare function Spinner({ size: sizeKey, ...props }: SpinnerInternalProps): JSX.Element;
|
14
|
-
declare const StyledSpinner: import("styled-components").StyledComponent<typeof Spinner, any, SxProp, never>;
|
15
|
+
declare const StyledSpinner: import("styled-components").StyledComponent<typeof Spinner, any, SystemCommonProps & SxProp, never>;
|
15
16
|
export declare type SpinnerProps = ComponentProps<typeof StyledSpinner>;
|
16
17
|
export default StyledSpinner;
|
package/lib/Spinner.js
CHANGED
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
11
11
|
|
12
|
+
var _constants = require("./constants");
|
13
|
+
|
12
14
|
var _sx = _interopRequireDefault(require("./sx"));
|
13
15
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -52,7 +54,7 @@ Spinner.displayName = "Spinner";
|
|
52
54
|
const StyledSpinner = (0, _styledComponents.default)(Spinner).withConfig({
|
53
55
|
displayName: "Spinner__StyledSpinner",
|
54
56
|
componentId: "sc-14tspit-0"
|
55
|
-
})(["@keyframes rotate-keyframes{100%{transform:rotate(360deg);}}animation:rotate-keyframes 1s linear infinite;", ""], _sx.default);
|
57
|
+
})(["@keyframes rotate-keyframes{100%{transform:rotate(360deg);}}animation:rotate-keyframes 1s linear infinite;", " ", ""], _constants.COMMON, _sx.default);
|
56
58
|
StyledSpinner.displayName = 'Spinner';
|
57
59
|
var _default = StyledSpinner;
|
58
60
|
exports.default = _default;
|