@primer/components 0.0.0-2021116182158 → 0.0.0-2021116202431
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/dist/browser.esm.js +2 -2
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +2 -2
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/Item.js +6 -4
- package/lib/ActionList2/List.js +2 -2
- package/lib/ActionList2/{ActionListContainerContext.d.ts → MenuContext.d.ts} +3 -3
- package/lib/ActionList2/{ActionListContainerContext.js → MenuContext.js} +3 -3
- package/lib/ActionList2/Selection.js +4 -4
- package/lib/ActionMenu2.d.ts +9 -13
- package/lib/ActionMenu2.js +29 -63
- package/lib/Checkbox.d.ts +1 -1
- package/lib/hooks/index.d.ts +0 -1
- package/lib/hooks/index.js +1 -9
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -8
- package/lib-esm/ActionList2/Item.js +6 -4
- package/lib-esm/ActionList2/List.js +2 -2
- package/lib-esm/ActionList2/{ActionListContainerContext.d.ts → MenuContext.d.ts} +3 -3
- package/lib-esm/ActionList2/{ActionListContainerContext.js → MenuContext.js} +1 -1
- package/lib-esm/ActionList2/Selection.js +4 -4
- package/lib-esm/ActionMenu2.d.ts +9 -13
- package/lib-esm/ActionMenu2.js +27 -60
- package/lib-esm/Checkbox.d.ts +1 -1
- package/lib-esm/hooks/index.d.ts +0 -1
- package/lib-esm/hooks/index.js +1 -2
- package/lib-esm/index.d.ts +0 -2
- package/lib-esm/index.js +0 -1
- package/package.json +1 -1
- package/lib/Radio.d.ts +0 -38
- package/lib/Radio.js +0 -55
- package/lib-esm/Radio.d.ts +0 -38
- package/lib-esm/Radio.js +0 -40
package/lib-esm/Checkbox.d.ts
CHANGED
@@ -25,5 +25,5 @@ export declare type CheckboxProps = {
|
|
25
25
|
/**
|
26
26
|
* An accessible, native checkbox component
|
27
27
|
*/
|
28
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Pick<CheckboxProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "
|
28
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Pick<CheckboxProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "indeterminate" | "validationStatus"> & React.RefAttributes<HTMLInputElement>>;
|
29
29
|
export default Checkbox;
|
package/lib-esm/hooks/index.d.ts
CHANGED
@@ -9,4 +9,3 @@ export { useAnchoredPosition } from './useAnchoredPosition';
|
|
9
9
|
export { useOverlay } from './useOverlay';
|
10
10
|
export type { UseOverlaySettings } from './useOverlay';
|
11
11
|
export { useRenderForcingRef } from './useRenderForcingRef';
|
12
|
-
export { useProvidedStateOrCreate } from './useProvidedStateOrCreate';
|
package/lib-esm/hooks/index.js
CHANGED
@@ -4,5 +4,4 @@ export { useOnEscapePress } from './useOnEscapePress';
|
|
4
4
|
export { useOpenAndCloseFocus } from './useOpenAndCloseFocus';
|
5
5
|
export { useAnchoredPosition } from './useAnchoredPosition';
|
6
6
|
export { useOverlay } from './useOverlay';
|
7
|
-
export { useRenderForcingRef } from './useRenderForcingRef';
|
8
|
-
export { useProvidedStateOrCreate } from './useProvidedStateOrCreate';
|
7
|
+
export { useRenderForcingRef } from './useRenderForcingRef';
|
package/lib-esm/index.d.ts
CHANGED
@@ -21,8 +21,6 @@ export { useOpenAndCloseFocus } from './hooks/useOpenAndCloseFocus';
|
|
21
21
|
export { useOnEscapePress } from './hooks/useOnEscapePress';
|
22
22
|
export { useOverlay } from './hooks/useOverlay';
|
23
23
|
export { useConfirm } from './Dialog/ConfirmationDialog';
|
24
|
-
export { default as Radio } from './Radio';
|
25
|
-
export type { RadioProps } from './Radio';
|
26
24
|
export { ActionList } from './ActionList';
|
27
25
|
export { ActionMenu } from './ActionMenu';
|
28
26
|
export type { ActionMenuProps } from './ActionMenu';
|
package/lib-esm/index.js
CHANGED
@@ -17,7 +17,6 @@ export { useOnEscapePress } from './hooks/useOnEscapePress';
|
|
17
17
|
export { useOverlay } from './hooks/useOverlay';
|
18
18
|
export { useConfirm } from './Dialog/ConfirmationDialog'; // Components
|
19
19
|
|
20
|
-
export { default as Radio } from './Radio';
|
21
20
|
export { ActionList } from './ActionList';
|
22
21
|
export { ActionMenu } from './ActionMenu';
|
23
22
|
export { default as Autocomplete } from './Autocomplete';
|
package/package.json
CHANGED
package/lib/Radio.d.ts
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
import React, { InputHTMLAttributes } from 'react';
|
2
|
-
import { SxProp } from './sx';
|
3
|
-
export declare type RadioProps = {
|
4
|
-
/**
|
5
|
-
* A unique value that is never shown to the user.
|
6
|
-
* Used during form submission and to identify which radio button in a group is selected
|
7
|
-
*/
|
8
|
-
value: string;
|
9
|
-
/**
|
10
|
-
* Name attribute of the input element. Required for grouping radio inputs
|
11
|
-
*/
|
12
|
-
name: string;
|
13
|
-
/**
|
14
|
-
* Apply inactive visual appearance to the radio button
|
15
|
-
*/
|
16
|
-
disabled?: boolean;
|
17
|
-
/**
|
18
|
-
* Indicates whether the radio button is selected
|
19
|
-
*/
|
20
|
-
checked?: boolean;
|
21
|
-
/**
|
22
|
-
* Forward a ref to the underlying input element
|
23
|
-
*/
|
24
|
-
ref?: React.RefObject<HTMLInputElement>;
|
25
|
-
/**
|
26
|
-
* Indicates whether the radio button must be checked before the form can be submitted
|
27
|
-
*/
|
28
|
-
required?: boolean;
|
29
|
-
/**
|
30
|
-
* Indicates whether the radio button validation state is non-standard
|
31
|
-
*/
|
32
|
-
validationStatus?: 'error' | 'success';
|
33
|
-
} & InputHTMLAttributes<HTMLInputElement> & SxProp;
|
34
|
-
/**
|
35
|
-
* An accessible, native radio component for selecting one option from a list.
|
36
|
-
*/
|
37
|
-
declare const Radio: React.ForwardRefExoticComponent<Pick<RadioProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "validationStatus"> & React.RefAttributes<HTMLInputElement>>;
|
38
|
-
export default Radio;
|
package/lib/Radio.js
DELETED
@@ -1,55 +0,0 @@
|
|
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 _react = _interopRequireDefault(require("react"));
|
11
|
-
|
12
|
-
var _sx = _interopRequireDefault(require("./sx"));
|
13
|
-
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
|
-
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); }
|
17
|
-
|
18
|
-
const StyledRadio = _styledComponents.default.input.withConfig({
|
19
|
-
displayName: "Radio__StyledRadio",
|
20
|
-
componentId: "sc-1ak1fjg-0"
|
21
|
-
})(["cursor:pointer;", " ", ""], props => props.disabled && `cursor: not-allowed;`, _sx.default);
|
22
|
-
/**
|
23
|
-
* An accessible, native radio component for selecting one option from a list.
|
24
|
-
*/
|
25
|
-
|
26
|
-
|
27
|
-
const Radio = /*#__PURE__*/_react.default.forwardRef(({
|
28
|
-
checked,
|
29
|
-
disabled,
|
30
|
-
sx: sxProp,
|
31
|
-
required,
|
32
|
-
validationStatus,
|
33
|
-
value,
|
34
|
-
name,
|
35
|
-
...rest
|
36
|
-
}, ref) => {
|
37
|
-
return /*#__PURE__*/_react.default.createElement(StyledRadio, _extends({
|
38
|
-
type: "radio",
|
39
|
-
value: value,
|
40
|
-
name: name,
|
41
|
-
ref: ref,
|
42
|
-
disabled: disabled,
|
43
|
-
"aria-disabled": disabled ? 'true' : 'false',
|
44
|
-
checked: checked,
|
45
|
-
"aria-checked": checked ? 'true' : 'false',
|
46
|
-
required: required,
|
47
|
-
"aria-required": required ? 'true' : 'false',
|
48
|
-
"aria-invalid": validationStatus === 'error' ? 'true' : 'false',
|
49
|
-
sx: sxProp
|
50
|
-
}, rest));
|
51
|
-
});
|
52
|
-
|
53
|
-
Radio.displayName = 'Radio';
|
54
|
-
var _default = Radio;
|
55
|
-
exports.default = _default;
|
package/lib-esm/Radio.d.ts
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
import React, { InputHTMLAttributes } from 'react';
|
2
|
-
import { SxProp } from './sx';
|
3
|
-
export declare type RadioProps = {
|
4
|
-
/**
|
5
|
-
* A unique value that is never shown to the user.
|
6
|
-
* Used during form submission and to identify which radio button in a group is selected
|
7
|
-
*/
|
8
|
-
value: string;
|
9
|
-
/**
|
10
|
-
* Name attribute of the input element. Required for grouping radio inputs
|
11
|
-
*/
|
12
|
-
name: string;
|
13
|
-
/**
|
14
|
-
* Apply inactive visual appearance to the radio button
|
15
|
-
*/
|
16
|
-
disabled?: boolean;
|
17
|
-
/**
|
18
|
-
* Indicates whether the radio button is selected
|
19
|
-
*/
|
20
|
-
checked?: boolean;
|
21
|
-
/**
|
22
|
-
* Forward a ref to the underlying input element
|
23
|
-
*/
|
24
|
-
ref?: React.RefObject<HTMLInputElement>;
|
25
|
-
/**
|
26
|
-
* Indicates whether the radio button must be checked before the form can be submitted
|
27
|
-
*/
|
28
|
-
required?: boolean;
|
29
|
-
/**
|
30
|
-
* Indicates whether the radio button validation state is non-standard
|
31
|
-
*/
|
32
|
-
validationStatus?: 'error' | 'success';
|
33
|
-
} & InputHTMLAttributes<HTMLInputElement> & SxProp;
|
34
|
-
/**
|
35
|
-
* An accessible, native radio component for selecting one option from a list.
|
36
|
-
*/
|
37
|
-
declare const Radio: React.ForwardRefExoticComponent<Pick<RadioProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "validationStatus"> & React.RefAttributes<HTMLInputElement>>;
|
38
|
-
export default Radio;
|
package/lib-esm/Radio.js
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
-
|
3
|
-
import styled from 'styled-components';
|
4
|
-
import React from 'react';
|
5
|
-
import sx from './sx';
|
6
|
-
const StyledRadio = styled.input.withConfig({
|
7
|
-
displayName: "Radio__StyledRadio",
|
8
|
-
componentId: "sc-1ak1fjg-0"
|
9
|
-
})(["cursor:pointer;", " ", ""], props => props.disabled && `cursor: not-allowed;`, sx);
|
10
|
-
/**
|
11
|
-
* An accessible, native radio component for selecting one option from a list.
|
12
|
-
*/
|
13
|
-
|
14
|
-
const Radio = /*#__PURE__*/React.forwardRef(({
|
15
|
-
checked,
|
16
|
-
disabled,
|
17
|
-
sx: sxProp,
|
18
|
-
required,
|
19
|
-
validationStatus,
|
20
|
-
value,
|
21
|
-
name,
|
22
|
-
...rest
|
23
|
-
}, ref) => {
|
24
|
-
return /*#__PURE__*/React.createElement(StyledRadio, _extends({
|
25
|
-
type: "radio",
|
26
|
-
value: value,
|
27
|
-
name: name,
|
28
|
-
ref: ref,
|
29
|
-
disabled: disabled,
|
30
|
-
"aria-disabled": disabled ? 'true' : 'false',
|
31
|
-
checked: checked,
|
32
|
-
"aria-checked": checked ? 'true' : 'false',
|
33
|
-
required: required,
|
34
|
-
"aria-required": required ? 'true' : 'false',
|
35
|
-
"aria-invalid": validationStatus === 'error' ? 'true' : 'false',
|
36
|
-
sx: sxProp
|
37
|
-
}, rest));
|
38
|
-
});
|
39
|
-
Radio.displayName = 'Radio';
|
40
|
-
export default Radio;
|