@carbon/react 0.10.1 → 0.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.
- package/es/index.js +1 -3
- package/icons/es/icon-helpers/es/index.js +9 -21
- package/icons/es/icons-react/next/index.esm.js +1 -1
- package/icons/lib/icon-helpers/es/index.js +9 -21
- package/icons/lib/icons-react/next/index.esm.js +1 -1
- package/lib/feature-flags.js +2 -4
- package/lib/index.js +250 -583
- package/package.json +41 -35
- package/scss/_layer.scss +9 -0
- package/scss/fonts/_index.scss +9 -0
- package/scss/fonts/_mono.scss +9 -0
- package/scss/fonts/_sans-arabic.scss +9 -0
- package/scss/fonts/_sans-devanagari.scss +9 -0
- package/scss/fonts/_sans-hebrew.scss +9 -0
- package/scss/fonts/_sans-thai-looped.scss +9 -0
- package/scss/fonts/_sans-thai.scss +9 -0
- package/scss/fonts/_sans.scss +9 -0
- package/scss/fonts/_serif.scss +9 -0
- package/es/_virtual/_commonjsHelpers.js +0 -13
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -93
- package/es/components/Layer/index.js +0 -47
- package/es/components/Theme/index.js +0 -76
- package/es/internal/usePrefix.js +0 -12
- package/es/node_modules/classnames/index.js +0 -61
- package/lib/_virtual/_commonjsHelpers.js +0 -17
- package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -101
- package/lib/components/Layer/index.js +0 -56
- package/lib/components/Theme/index.js +0 -86
- package/lib/internal/usePrefix.js +0 -16
- package/lib/node_modules/classnames/index.js +0 -63
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": "0.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -42,61 +42,67 @@
|
|
|
42
42
|
"sass": "^1.32.12"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@carbon/feature-flags": "^0.
|
|
46
|
-
"@carbon/icons-react": "^10.
|
|
47
|
-
"@carbon/styles": "^0.
|
|
45
|
+
"@carbon/feature-flags": "^0.7.0",
|
|
46
|
+
"@carbon/icons-react": "^10.45.0",
|
|
47
|
+
"@carbon/styles": "^0.12.0",
|
|
48
48
|
"@carbon/telemetry": "0.0.0-alpha.6",
|
|
49
|
-
"carbon-components": "^10.
|
|
50
|
-
"carbon-components-react": "^7.
|
|
49
|
+
"carbon-components": "^10.51.0",
|
|
50
|
+
"carbon-components-react": "^7.51.0",
|
|
51
51
|
"carbon-icons": "^7.0.7"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@babel/core": "^7.
|
|
55
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
56
|
-
"@babel/plugin-proposal-export-default-from": "^7.
|
|
57
|
-
"@babel/plugin-proposal-export-namespace-from": "^7.
|
|
58
|
-
"@babel/plugin-transform-react-constant-elements": "^7.
|
|
59
|
-
"@babel/preset-env": "^7.
|
|
60
|
-
"@babel/preset-react": "^7.
|
|
61
|
-
"@carbon/themes": "^10.
|
|
54
|
+
"@babel/core": "^7.16.7",
|
|
55
|
+
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
56
|
+
"@babel/plugin-proposal-export-default-from": "^7.16.7",
|
|
57
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.16.7",
|
|
58
|
+
"@babel/plugin-transform-react-constant-elements": "^7.16.7",
|
|
59
|
+
"@babel/preset-env": "^7.16.7",
|
|
60
|
+
"@babel/preset-react": "^7.16.7",
|
|
61
|
+
"@carbon/themes": "^10.49.0",
|
|
62
62
|
"@rollup/plugin-babel": "^5.3.0",
|
|
63
63
|
"@rollup/plugin-commonjs": "^18.0.0",
|
|
64
64
|
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
65
|
-
"@storybook/addon-
|
|
66
|
-
"@storybook/addon-
|
|
67
|
-
"@storybook/addon-
|
|
68
|
-
"@storybook/
|
|
69
|
-
"@storybook/
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
65
|
+
"@storybook/addon-a11y": "^6.4.9",
|
|
66
|
+
"@storybook/addon-actions": "^6.4.9",
|
|
67
|
+
"@storybook/addon-docs": "^6.4.9",
|
|
68
|
+
"@storybook/addon-essentials": "^6.4.9",
|
|
69
|
+
"@storybook/addon-storysource": "^6.4.9",
|
|
70
|
+
"@storybook/builder-webpack5": "^6.4.9",
|
|
71
|
+
"@storybook/manager-webpack5": "^6.4.9",
|
|
72
|
+
"@storybook/react": "^6.4.9",
|
|
73
|
+
"@storybook/theming": "^6.4.9",
|
|
74
|
+
"autoprefixer": "^10.4.0",
|
|
75
|
+
"babel-loader": "^8.2.3",
|
|
76
|
+
"babel-plugin-dev-expression": "^0.2.3",
|
|
77
|
+
"babel-preset-carbon": "^0.2.0",
|
|
74
78
|
"browserslist-config-carbon": "^10.6.1",
|
|
75
|
-
"css-loader": "^5.
|
|
79
|
+
"css-loader": "^6.5.1",
|
|
76
80
|
"fs-extra": "^10.0.0",
|
|
77
|
-
"mini-css-extract-plugin": "^
|
|
78
|
-
"postcss": "^8.
|
|
79
|
-
"postcss-
|
|
80
|
-
"postcss-loader": "4",
|
|
81
|
+
"mini-css-extract-plugin": "^2.4.5",
|
|
82
|
+
"postcss": "^8.4.5",
|
|
83
|
+
"postcss-loader": "^6.2.1",
|
|
81
84
|
"prop-types": "^15.7.2",
|
|
82
85
|
"react": "^17.0.2",
|
|
83
86
|
"react-dom": "^17.0.2",
|
|
84
87
|
"rimraf": "^3.0.2",
|
|
85
88
|
"rollup": "^2.46.0",
|
|
86
89
|
"rollup-plugin-strip-banner": "^2.0.0",
|
|
87
|
-
"rtlcss": "^3.
|
|
88
|
-
"sass": "^1.
|
|
89
|
-
"sass-loader": "
|
|
90
|
-
"style-loader": "^
|
|
91
|
-
"webpack": "^
|
|
90
|
+
"rtlcss": "^3.5.0",
|
|
91
|
+
"sass": "^1.45.0",
|
|
92
|
+
"sass-loader": "^12.4.0",
|
|
93
|
+
"style-loader": "^3.3.1",
|
|
94
|
+
"webpack": "^5.65.0"
|
|
92
95
|
},
|
|
93
96
|
"sideEffects": [
|
|
94
97
|
"es/index.js",
|
|
95
98
|
"lib/index.js",
|
|
99
|
+
"src/index.js",
|
|
96
100
|
"es/feature-flags.js",
|
|
97
101
|
"lib/feature-flags.js",
|
|
102
|
+
"src/feature-flags.js",
|
|
98
103
|
"es/prefix.js",
|
|
99
|
-
"lib/prefix.js"
|
|
104
|
+
"lib/prefix.js",
|
|
105
|
+
"src/prefix.js"
|
|
100
106
|
],
|
|
101
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "ac4b4bf03cf93cb8463916231619fbfdc72f0be5"
|
|
102
108
|
}
|
package/scss/_layer.scss
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/layer';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts/mono';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts/sans-arabic';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts/sans-devanagari';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts/sans-hebrew';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts/sans-thai-looped';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts/sans-thai';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts/sans';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/fonts/serif';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2021
|
|
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
|
-
function createCommonjsModule(fn) {
|
|
9
|
-
var module = { exports: {} };
|
|
10
|
-
return fn(module, module.exports), module.exports;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { createCommonjsModule };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2021
|
|
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
|
-
function _typeof(obj) {
|
|
9
|
-
"@babel/helpers - typeof";
|
|
10
|
-
|
|
11
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
12
|
-
_typeof = function (obj) {
|
|
13
|
-
return typeof obj;
|
|
14
|
-
};
|
|
15
|
-
} else {
|
|
16
|
-
_typeof = function (obj) {
|
|
17
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return _typeof(obj);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _defineProperty(obj, key, value) {
|
|
25
|
-
if (key in obj) {
|
|
26
|
-
Object.defineProperty(obj, key, {
|
|
27
|
-
value: value,
|
|
28
|
-
enumerable: true,
|
|
29
|
-
configurable: true,
|
|
30
|
-
writable: true
|
|
31
|
-
});
|
|
32
|
-
} else {
|
|
33
|
-
obj[key] = value;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return obj;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function _extends() {
|
|
40
|
-
_extends = Object.assign || function (target) {
|
|
41
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
42
|
-
var source = arguments[i];
|
|
43
|
-
|
|
44
|
-
for (var key in source) {
|
|
45
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
46
|
-
target[key] = source[key];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return target;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return _extends.apply(this, arguments);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
58
|
-
if (source == null) return {};
|
|
59
|
-
var target = {};
|
|
60
|
-
var sourceKeys = Object.keys(source);
|
|
61
|
-
var key, i;
|
|
62
|
-
|
|
63
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
64
|
-
key = sourceKeys[i];
|
|
65
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
66
|
-
target[key] = source[key];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return target;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _objectWithoutProperties(source, excluded) {
|
|
73
|
-
if (source == null) return {};
|
|
74
|
-
|
|
75
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
76
|
-
|
|
77
|
-
var key, i;
|
|
78
|
-
|
|
79
|
-
if (Object.getOwnPropertySymbols) {
|
|
80
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
81
|
-
|
|
82
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
83
|
-
key = sourceSymbolKeys[i];
|
|
84
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
85
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
86
|
-
target[key] = source[key];
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return target;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export { _defineProperty as defineProperty, _extends as extends, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _typeof as typeof };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2021
|
|
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 React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import classnames from '../../node_modules/classnames/index.js';
|
|
12
|
-
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
-
|
|
14
|
-
var _excluded = ["as", "className", "children"];
|
|
15
|
-
function Layer(_ref) {
|
|
16
|
-
var _ref$as = _ref.as,
|
|
17
|
-
BaseComponent = _ref$as === void 0 ? 'div' : _ref$as,
|
|
18
|
-
customClassName = _ref.className,
|
|
19
|
-
children = _ref.children,
|
|
20
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
|
|
22
|
-
var prefix = usePrefix();
|
|
23
|
-
var className = classnames("".concat(prefix, "--layer"), customClassName);
|
|
24
|
-
return /*#__PURE__*/React.createElement(BaseComponent, _extends({}, rest, {
|
|
25
|
-
className: className
|
|
26
|
-
}), children);
|
|
27
|
-
}
|
|
28
|
-
Layer.propTypes = {
|
|
29
|
-
/**
|
|
30
|
-
* Specify a custom component or element to be rendered as the top-level
|
|
31
|
-
* element in the component
|
|
32
|
-
*/
|
|
33
|
-
as: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.elementType]),
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Provide child elements to be rendered inside of `Theme`
|
|
37
|
-
*/
|
|
38
|
-
children: PropTypes.node,
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Provide a custom class name to be used on the outermost element rendered by
|
|
42
|
-
* the component
|
|
43
|
-
*/
|
|
44
|
-
className: PropTypes.string
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export { Layer };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2021
|
|
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, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import classnames from '../../node_modules/classnames/index.js';
|
|
12
|
-
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
-
|
|
14
|
-
var _excluded = ["as", "children", "className", "theme"];
|
|
15
|
-
var ThemeContext = /*#__PURE__*/React.createContext({
|
|
16
|
-
theme: 'white'
|
|
17
|
-
});
|
|
18
|
-
/**
|
|
19
|
-
* Specify the theme to be applied to a page, or a region in a page
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
function Theme(_ref) {
|
|
23
|
-
var _cx;
|
|
24
|
-
|
|
25
|
-
var _ref$as = _ref.as,
|
|
26
|
-
BaseComponent = _ref$as === void 0 ? 'div' : _ref$as,
|
|
27
|
-
children = _ref.children,
|
|
28
|
-
customClassName = _ref.className,
|
|
29
|
-
theme = _ref.theme,
|
|
30
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
|
|
32
|
-
var prefix = usePrefix();
|
|
33
|
-
var className = classnames(customClassName, (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--white"), theme === 'white'), _defineProperty(_cx, "".concat(prefix, "--g10"), theme === 'g10'), _defineProperty(_cx, "".concat(prefix, "--g90"), theme === 'g90'), _defineProperty(_cx, "".concat(prefix, "--g100"), theme === 'g100'), _cx));
|
|
34
|
-
var value = React.useMemo(function () {
|
|
35
|
-
return {
|
|
36
|
-
theme: theme
|
|
37
|
-
};
|
|
38
|
-
}, [theme]);
|
|
39
|
-
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
40
|
-
value: value
|
|
41
|
-
}, /*#__PURE__*/React.createElement(BaseComponent, _extends({}, rest, {
|
|
42
|
-
className: className
|
|
43
|
-
}), children));
|
|
44
|
-
}
|
|
45
|
-
Theme.propTypes = {
|
|
46
|
-
/**
|
|
47
|
-
* Specify a custom component or element to be rendered as the top-level
|
|
48
|
-
* element in the component
|
|
49
|
-
*/
|
|
50
|
-
as: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.elementType]),
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Provide child elements to be rendered inside of `Theme`
|
|
54
|
-
*/
|
|
55
|
-
children: PropTypes.node,
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Provide a custom class name to be used on the outermost element rendered by
|
|
59
|
-
* the component
|
|
60
|
-
*/
|
|
61
|
-
className: PropTypes.string,
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Specify the theme
|
|
65
|
-
*/
|
|
66
|
-
theme: PropTypes.oneOf(['white', 'g10', 'g90', 'g100'])
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Get access to the current theme
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
function useTheme() {
|
|
73
|
-
return React.useContext(ThemeContext);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export { Theme, useTheme };
|
package/es/internal/usePrefix.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2021
|
|
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 { unstable_usePrefix } from 'carbon-components-react';
|
|
9
|
-
|
|
10
|
-
var usePrefix = unstable_usePrefix;
|
|
11
|
-
|
|
12
|
-
export { usePrefix };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2021
|
|
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 { typeof as _typeof } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import { createCommonjsModule } from '../../_virtual/_commonjsHelpers.js';
|
|
10
|
-
|
|
11
|
-
var classnames = createCommonjsModule(function (module) {
|
|
12
|
-
/* global define */
|
|
13
|
-
(function () {
|
|
14
|
-
|
|
15
|
-
var hasOwn = {}.hasOwnProperty;
|
|
16
|
-
|
|
17
|
-
function classNames() {
|
|
18
|
-
var classes = [];
|
|
19
|
-
|
|
20
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
21
|
-
var arg = arguments[i];
|
|
22
|
-
if (!arg) continue;
|
|
23
|
-
|
|
24
|
-
var argType = _typeof(arg);
|
|
25
|
-
|
|
26
|
-
if (argType === 'string' || argType === 'number') {
|
|
27
|
-
classes.push(arg);
|
|
28
|
-
} else if (Array.isArray(arg)) {
|
|
29
|
-
if (arg.length) {
|
|
30
|
-
var inner = classNames.apply(null, arg);
|
|
31
|
-
|
|
32
|
-
if (inner) {
|
|
33
|
-
classes.push(inner);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
} else if (argType === 'object') {
|
|
37
|
-
if (arg.toString === Object.prototype.toString) {
|
|
38
|
-
for (var key in arg) {
|
|
39
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
40
|
-
classes.push(key);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
classes.push(arg.toString());
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return classes.join(' ');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (module.exports) {
|
|
53
|
-
classNames.default = classNames;
|
|
54
|
-
module.exports = classNames;
|
|
55
|
-
} else {
|
|
56
|
-
window.classNames = classNames;
|
|
57
|
-
}
|
|
58
|
-
})();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
export default classnames;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2021
|
|
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
|
-
function createCommonjsModule(fn) {
|
|
13
|
-
var module = { exports: {} };
|
|
14
|
-
return fn(module, module.exports), module.exports;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.createCommonjsModule = createCommonjsModule;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2021
|
|
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
|
-
function _typeof(obj) {
|
|
13
|
-
"@babel/helpers - typeof";
|
|
14
|
-
|
|
15
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
16
|
-
_typeof = function (obj) {
|
|
17
|
-
return typeof obj;
|
|
18
|
-
};
|
|
19
|
-
} else {
|
|
20
|
-
_typeof = function (obj) {
|
|
21
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return _typeof(obj);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function _defineProperty(obj, key, value) {
|
|
29
|
-
if (key in obj) {
|
|
30
|
-
Object.defineProperty(obj, key, {
|
|
31
|
-
value: value,
|
|
32
|
-
enumerable: true,
|
|
33
|
-
configurable: true,
|
|
34
|
-
writable: true
|
|
35
|
-
});
|
|
36
|
-
} else {
|
|
37
|
-
obj[key] = value;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _extends() {
|
|
44
|
-
_extends = Object.assign || function (target) {
|
|
45
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
46
|
-
var source = arguments[i];
|
|
47
|
-
|
|
48
|
-
for (var key in source) {
|
|
49
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
50
|
-
target[key] = source[key];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return target;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return _extends.apply(this, arguments);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
62
|
-
if (source == null) return {};
|
|
63
|
-
var target = {};
|
|
64
|
-
var sourceKeys = Object.keys(source);
|
|
65
|
-
var key, i;
|
|
66
|
-
|
|
67
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
68
|
-
key = sourceKeys[i];
|
|
69
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
70
|
-
target[key] = source[key];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return target;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function _objectWithoutProperties(source, excluded) {
|
|
77
|
-
if (source == null) return {};
|
|
78
|
-
|
|
79
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
80
|
-
|
|
81
|
-
var key, i;
|
|
82
|
-
|
|
83
|
-
if (Object.getOwnPropertySymbols) {
|
|
84
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
85
|
-
|
|
86
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
87
|
-
key = sourceSymbolKeys[i];
|
|
88
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
89
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
90
|
-
target[key] = source[key];
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return target;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
exports.defineProperty = _defineProperty;
|
|
98
|
-
exports.extends = _extends;
|
|
99
|
-
exports.objectWithoutProperties = _objectWithoutProperties;
|
|
100
|
-
exports.objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
|
101
|
-
exports.typeof = _typeof;
|