@carbon/react 1.12.0-rc.1 → 1.12.0
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.
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import '../TextInput/index.js';
|
|
13
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
|
+
import { FormContext } from '../FluidForm/FormContext.js';
|
|
15
|
+
import TextInput from '../TextInput/TextInput.js';
|
|
16
|
+
|
|
17
|
+
var _excluded = ["className"];
|
|
18
|
+
|
|
19
|
+
function FluidTextInput(_ref) {
|
|
20
|
+
var className = _ref.className,
|
|
21
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
|
|
23
|
+
var prefix = usePrefix();
|
|
24
|
+
var classNames = cx("".concat(prefix, "--text-input--fluid"), className);
|
|
25
|
+
return /*#__PURE__*/React__default.createElement(FormContext.Provider, {
|
|
26
|
+
value: {
|
|
27
|
+
isFluid: true
|
|
28
|
+
}
|
|
29
|
+
}, /*#__PURE__*/React__default.createElement(TextInput, _extends({
|
|
30
|
+
className: classNames
|
|
31
|
+
}, other)));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
FluidTextInput.propTypes = {
|
|
35
|
+
/**
|
|
36
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
37
|
+
*/
|
|
38
|
+
className: PropTypes.string,
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optionally provide the default value of the `<input>`
|
|
42
|
+
*/
|
|
43
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Specify whether the `<input>` should be disabled
|
|
47
|
+
*/
|
|
48
|
+
disabled: PropTypes.bool,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Specify a custom `id` for the `<input>`
|
|
52
|
+
*/
|
|
53
|
+
id: PropTypes.string.isRequired,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Specify whether the control is currently invalid
|
|
57
|
+
*/
|
|
58
|
+
invalid: PropTypes.bool,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
62
|
+
*/
|
|
63
|
+
invalidText: PropTypes.node,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Provide the text that will be read by a screen reader when visiting this
|
|
67
|
+
* control
|
|
68
|
+
*/
|
|
69
|
+
labelText: PropTypes.node.isRequired,
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
73
|
+
* is updated
|
|
74
|
+
*/
|
|
75
|
+
onChange: PropTypes.func,
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Optionally provide an `onClick` handler that is called whenever the
|
|
79
|
+
* `<input>` is clicked
|
|
80
|
+
*/
|
|
81
|
+
onClick: PropTypes.func,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Specify the placeholder attribute for the `<input>`
|
|
85
|
+
*/
|
|
86
|
+
placeholder: PropTypes.string,
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Specify the value of the `<input>`
|
|
90
|
+
*/
|
|
91
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Specify whether the control is currently in warning state
|
|
95
|
+
*/
|
|
96
|
+
warn: PropTypes.bool,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Provide the text that is displayed when the control is in warning state
|
|
100
|
+
*/
|
|
101
|
+
warnText: PropTypes.node
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { FluidTextInput as default };
|
package/es/index.js
CHANGED
|
@@ -124,6 +124,7 @@ export { default as SideNavIcon } from './components/UIShell/SideNavIcon.js';
|
|
|
124
124
|
export { default as SideNavItem } from './components/UIShell/SideNavItem.js';
|
|
125
125
|
export { default as SideNavLinkText } from './components/UIShell/SideNavLinkText.js';
|
|
126
126
|
export { default as unstable_useContextMenu } from './components/ContextMenu/useContextMenu.js';
|
|
127
|
+
export { default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
|
|
127
128
|
export { default as unstable_MenuDivider } from './components/Menu/MenuDivider.js';
|
|
128
129
|
export { default as unstable_MenuGroup } from './components/Menu/MenuGroup.js';
|
|
129
130
|
export { default as unstable_MenuItem } from './components/Menu/MenuItem.js';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
+
var PropTypes = require('prop-types');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
require('../TextInput/index.js');
|
|
17
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
19
|
+
var TextInput = require('../TextInput/TextInput.js');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
+
|
|
23
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
|
+
|
|
27
|
+
var _excluded = ["className"];
|
|
28
|
+
|
|
29
|
+
function FluidTextInput(_ref) {
|
|
30
|
+
var className = _ref.className,
|
|
31
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
32
|
+
|
|
33
|
+
var prefix = usePrefix.usePrefix();
|
|
34
|
+
var classNames = cx__default["default"]("".concat(prefix, "--text-input--fluid"), className);
|
|
35
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
36
|
+
value: {
|
|
37
|
+
isFluid: true
|
|
38
|
+
}
|
|
39
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput["default"], _rollupPluginBabelHelpers["extends"]({
|
|
40
|
+
className: classNames
|
|
41
|
+
}, other)));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
FluidTextInput.propTypes = {
|
|
45
|
+
/**
|
|
46
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
47
|
+
*/
|
|
48
|
+
className: PropTypes__default["default"].string,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optionally provide the default value of the `<input>`
|
|
52
|
+
*/
|
|
53
|
+
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Specify whether the `<input>` should be disabled
|
|
57
|
+
*/
|
|
58
|
+
disabled: PropTypes__default["default"].bool,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Specify a custom `id` for the `<input>`
|
|
62
|
+
*/
|
|
63
|
+
id: PropTypes__default["default"].string.isRequired,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Specify whether the control is currently invalid
|
|
67
|
+
*/
|
|
68
|
+
invalid: PropTypes__default["default"].bool,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
72
|
+
*/
|
|
73
|
+
invalidText: PropTypes__default["default"].node,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Provide the text that will be read by a screen reader when visiting this
|
|
77
|
+
* control
|
|
78
|
+
*/
|
|
79
|
+
labelText: PropTypes__default["default"].node.isRequired,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
83
|
+
* is updated
|
|
84
|
+
*/
|
|
85
|
+
onChange: PropTypes__default["default"].func,
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Optionally provide an `onClick` handler that is called whenever the
|
|
89
|
+
* `<input>` is clicked
|
|
90
|
+
*/
|
|
91
|
+
onClick: PropTypes__default["default"].func,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Specify the placeholder attribute for the `<input>`
|
|
95
|
+
*/
|
|
96
|
+
placeholder: PropTypes__default["default"].string,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Specify the value of the `<input>`
|
|
100
|
+
*/
|
|
101
|
+
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Specify whether the control is currently in warning state
|
|
105
|
+
*/
|
|
106
|
+
warn: PropTypes__default["default"].bool,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Provide the text that is displayed when the control is in warning state
|
|
110
|
+
*/
|
|
111
|
+
warnText: PropTypes__default["default"].node
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
exports["default"] = FluidTextInput;
|
package/lib/index.js
CHANGED
|
@@ -128,6 +128,7 @@ var SideNavIcon = require('./components/UIShell/SideNavIcon.js');
|
|
|
128
128
|
var SideNavItem = require('./components/UIShell/SideNavItem.js');
|
|
129
129
|
var SideNavLinkText = require('./components/UIShell/SideNavLinkText.js');
|
|
130
130
|
var useContextMenu = require('./components/ContextMenu/useContextMenu.js');
|
|
131
|
+
var FluidTextInput = require('./components/FluidTextInput/FluidTextInput.js');
|
|
131
132
|
var MenuDivider = require('./components/Menu/MenuDivider.js');
|
|
132
133
|
var MenuGroup = require('./components/Menu/MenuGroup.js');
|
|
133
134
|
var MenuItem = require('./components/Menu/MenuItem.js');
|
|
@@ -344,6 +345,7 @@ exports.SideNavIcon = SideNavIcon["default"];
|
|
|
344
345
|
exports.SideNavItem = SideNavItem["default"];
|
|
345
346
|
exports.SideNavLinkText = SideNavLinkText["default"];
|
|
346
347
|
exports.unstable_useContextMenu = useContextMenu["default"];
|
|
348
|
+
exports.unstable__FluidTextInput = FluidTextInput["default"];
|
|
347
349
|
exports.unstable_MenuDivider = MenuDivider["default"];
|
|
348
350
|
exports.unstable_MenuGroup = MenuGroup["default"];
|
|
349
351
|
exports.unstable_MenuItem = MenuItem["default"];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.12.0
|
|
4
|
+
"version": "1.12.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@carbon/feature-flags": "^0.8.0",
|
|
47
47
|
"@carbon/icons-react": "^11.7.0",
|
|
48
48
|
"@carbon/layout": "^11.5.0",
|
|
49
|
-
"@carbon/styles": "^1.12.0
|
|
49
|
+
"@carbon/styles": "^1.12.0",
|
|
50
50
|
"@carbon/telemetry": "0.1.0",
|
|
51
51
|
"classnames": "2.3.1",
|
|
52
52
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@babel/preset-env": "^7.18.2",
|
|
74
74
|
"@babel/preset-react": "^7.17.12",
|
|
75
75
|
"@carbon/test-utils": "^10.25.0",
|
|
76
|
-
"@carbon/themes": "^11.
|
|
76
|
+
"@carbon/themes": "^11.8.0",
|
|
77
77
|
"@rollup/plugin-babel": "^5.3.0",
|
|
78
78
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
79
79
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"**/*.scss",
|
|
131
131
|
"**/*.css"
|
|
132
132
|
],
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "e3e4c8ce2fba7e4510764c70205b8cb57ccba8e1"
|
|
134
134
|
}
|