@primer/components 0.0.0-20211030163410 → 0.0.0-20211030164933

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.
@@ -5,7 +5,6 @@ declare const _default: React.FC<import("./_InputField/ToggleInputField").Props>
5
5
  }>;
6
6
  Caption: React.FC<{}>;
7
7
  Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
8
- Validation: React.FC<import("./_InputField/InputFieldValidation").InputFieldValidationProps>;
9
8
  LeadingVisual: React.FC<{}>;
10
9
  };
11
10
  export default _default;
@@ -67,7 +67,6 @@ var _default = Object.assign(CheckboxInputField, {
67
67
  Input,
68
68
  Caption: _InputField.default.Caption,
69
69
  Label: _InputField.default.Label,
70
- Validation: _InputField.default.Validation,
71
70
  LeadingVisual: _ToggleInputLeadingVisual.default
72
71
  });
73
72
 
@@ -3,7 +3,6 @@ declare const _default: React.FC<import("./_InputField/ToggleInputField").Props>
3
3
  Input: React.FC<React.HTMLProps<HTMLInputElement>>;
4
4
  Caption: React.FC<{}>;
5
5
  Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
6
- Validation: React.FC<import("./_InputField/InputFieldValidation").InputFieldValidationProps>;
7
6
  LeadingVisual: React.FC<{}>;
8
7
  };
9
8
  export default _default;
@@ -76,7 +76,6 @@ var _default = Object.assign(RadioInputField, {
76
76
  Input,
77
77
  Caption: _InputField.default.Caption,
78
78
  Label: _InputField.default.Label,
79
- Validation: _InputField.default.Validation,
80
79
  LeadingVisual: _ToggleInputLeadingVisual.default
81
80
  });
82
81
 
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
+ /**
4
+ * The unique identifier used to associate the caption with an input
5
+ */
3
6
  id: string;
7
+ /**
8
+ * Whether the input associated with this caption is disabled
9
+ */
10
+ disabled?: boolean;
4
11
  }
5
12
  declare const InputCaption: React.FC<Props>;
6
13
  export default InputCaption;
@@ -11,12 +11,15 @@ var _ = require(".");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- 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); }
15
-
16
- const InputCaption = props => /*#__PURE__*/_react.default.createElement(_.Text, _extends({
17
- color: "fg.muted",
18
- fontSize: 0
19
- }, props));
14
+ const InputCaption = ({
15
+ children,
16
+ disabled,
17
+ id
18
+ }) => /*#__PURE__*/_react.default.createElement(_.Text, {
19
+ color: disabled ? 'fg.subtle' : 'fg.muted',
20
+ fontSize: 0,
21
+ id: id
22
+ }, children);
20
23
 
21
24
  InputCaption.displayName = "InputCaption";
22
25
  var _default = InputCaption;
@@ -18,9 +18,11 @@ const InputFieldCaption = ({
18
18
  }) => /*#__PURE__*/_react.default.createElement(_slots.Slot, {
19
19
  name: "Caption"
20
20
  }, ({
21
- captionId
21
+ captionId,
22
+ disabled
22
23
  }) => /*#__PURE__*/_react.default.createElement(_InputCaption.default, {
23
- id: captionId
24
+ id: captionId,
25
+ disabled: disabled
24
26
  }, children));
25
27
 
26
28
  InputFieldCaption.displayName = "InputFieldCaption";
@@ -5,7 +5,6 @@ declare const _default: React.FC<import("./_InputField/ToggleInputField").Props>
5
5
  }>;
6
6
  Caption: React.FC<{}>;
7
7
  Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
8
- Validation: React.FC<import("./_InputField/InputFieldValidation").InputFieldValidationProps>;
9
8
  LeadingVisual: React.FC<{}>;
10
9
  };
11
10
  export default _default;
@@ -52,6 +52,5 @@ export default Object.assign(CheckboxInputField, {
52
52
  Input,
53
53
  Caption: InputField.Caption,
54
54
  Label: InputField.Label,
55
- Validation: InputField.Validation,
56
55
  LeadingVisual: ToggleInputLeadingVisual
57
56
  });
@@ -3,7 +3,6 @@ declare const _default: React.FC<import("./_InputField/ToggleInputField").Props>
3
3
  Input: React.FC<React.HTMLProps<HTMLInputElement>>;
4
4
  Caption: React.FC<{}>;
5
5
  Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
6
- Validation: React.FC<import("./_InputField/InputFieldValidation").InputFieldValidationProps>;
7
6
  LeadingVisual: React.FC<{}>;
8
7
  };
9
8
  export default _default;
@@ -61,6 +61,5 @@ export default Object.assign(RadioInputField, {
61
61
  Input,
62
62
  Caption: InputField.Caption,
63
63
  Label: InputField.Label,
64
- Validation: InputField.Validation,
65
64
  LeadingVisual: ToggleInputLeadingVisual
66
65
  });
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
+ /**
4
+ * The unique identifier used to associate the caption with an input
5
+ */
3
6
  id: string;
7
+ /**
8
+ * Whether the input associated with this caption is disabled
9
+ */
10
+ disabled?: boolean;
4
11
  }
5
12
  declare const InputCaption: React.FC<Props>;
6
13
  export default InputCaption;
@@ -1,12 +1,15 @@
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
1
  import React from 'react';
4
2
  import { Text } from '.';
5
3
 
6
- const InputCaption = props => /*#__PURE__*/React.createElement(Text, _extends({
7
- color: "fg.muted",
8
- fontSize: 0
9
- }, props));
4
+ const InputCaption = ({
5
+ children,
6
+ disabled,
7
+ id
8
+ }) => /*#__PURE__*/React.createElement(Text, {
9
+ color: disabled ? 'fg.subtle' : 'fg.muted',
10
+ fontSize: 0,
11
+ id: id
12
+ }, children);
10
13
 
11
14
  InputCaption.displayName = "InputCaption";
12
15
  export default InputCaption;
@@ -7,9 +7,11 @@ const InputFieldCaption = ({
7
7
  }) => /*#__PURE__*/React.createElement(Slot, {
8
8
  name: "Caption"
9
9
  }, ({
10
- captionId
10
+ captionId,
11
+ disabled
11
12
  }) => /*#__PURE__*/React.createElement(InputCaption, {
12
- id: captionId
13
+ id: captionId,
14
+ disabled: disabled
13
15
  }, children));
14
16
 
15
17
  InputFieldCaption.displayName = "InputFieldCaption";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-20211030163410",
3
+ "version": "0.0.0-20211030164933",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",