@capillarytech/blaze-ui 0.1.6-alpha.20 → 0.1.6-alpha.22
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/CapTestSelect/CapTestSelect.js +47 -0
- package/CapTestSelect/index.js +1 -0
- package/CapUnifiedSelect/CapUnifiedSelect.js +1 -1
- package/dist/CapTestSelect/CapTestSelect.js +40 -0
- package/dist/{CapTreeSelect → CapTestSelect}/index.js +2 -2
- package/dist/CapUnifiedSelect/CapUnifiedSelect.js +1 -1
- package/dist/esm/CapTestSelect/CapTestSelect.js +34 -0
- package/dist/esm/CapTestSelect/index.js +1 -0
- package/dist/esm/CapUnifiedSelect/CapUnifiedSelect.js +1 -1
- package/dist/esm/index.js +1 -11
- package/dist/esm/withStyles.js +23 -0
- package/dist/index.js +3 -29
- package/dist/withStyles.js +29 -0
- package/index.js +5 -1
- package/package.json +3 -7
- package/.DS_Store +0 -0
- package/CapHeading/CapHeading.js +0 -71
- package/CapHeading/index.js +0 -1
- package/CapHeading/styles.js +0 -125
- package/CapIcon/CapIcon.js +0 -83
- package/CapIcon/index.js +0 -1
- package/CapInfoNote/CapInfoNote.js +0 -54
- package/CapInfoNote/index.js +0 -1
- package/CapInfoNote/styles.js +0 -63
- package/CapLabel/CapLabel.js +0 -106
- package/CapLabel/index.js +0 -1
- package/CapLabel/styles.js +0 -221
- package/CapRow/CapRow.js +0 -22
- package/CapRow/index.js +0 -1
- package/CapRow/styles.js +0 -9
- package/CapSelect/CapSelect.js +0 -62
- package/CapSelect/index.js +0 -1
- package/CapSelect/styles.js +0 -119
- package/CapTooltip/CapTooltip.js +0 -36
- package/CapTooltip/index.js +0 -1
- package/CapTooltip/styles.js +0 -42
- package/CapTreeSelect/CapTreeSelect.js +0 -86
- package/CapTreeSelect/index.js +0 -1
- package/CapTreeSelect/styles.js +0 -122
- package/dist/CapHeading/CapHeading.js +0 -48
- package/dist/CapHeading/index.js +0 -13
- package/dist/CapHeading/styles.js +0 -131
- package/dist/CapIcon/CapIcon.js +0 -88
- package/dist/CapIcon/index.js +0 -13
- package/dist/CapInfoNote/CapInfoNote.js +0 -69
- package/dist/CapInfoNote/index.js +0 -13
- package/dist/CapInfoNote/styles.js +0 -15
- package/dist/CapLabel/CapLabel.js +0 -57
- package/dist/CapLabel/index.js +0 -13
- package/dist/CapLabel/styles.js +0 -227
- package/dist/CapRow/CapRow.js +0 -29
- package/dist/CapRow/index.js +0 -13
- package/dist/CapRow/styles.js +0 -12
- package/dist/CapSelect/CapSelect.js +0 -72
- package/dist/CapSelect/index.js +0 -13
- package/dist/CapSelect/styles.js +0 -15
- package/dist/CapTooltip/CapTooltip.js +0 -41
- package/dist/CapTooltip/index.js +0 -13
- package/dist/CapTooltip/styles.js +0 -15
- package/dist/CapTreeSelect/CapTreeSelect.js +0 -81
- package/dist/CapTreeSelect/styles.js +0 -20
- package/dist/esm/CapHeading/CapHeading.js +0 -41
- package/dist/esm/CapHeading/index.js +0 -1
- package/dist/esm/CapHeading/styles.js +0 -123
- package/dist/esm/CapIcon/CapIcon.js +0 -79
- package/dist/esm/CapIcon/index.js +0 -1
- package/dist/esm/CapInfoNote/CapInfoNote.js +0 -62
- package/dist/esm/CapInfoNote/index.js +0 -1
- package/dist/esm/CapInfoNote/styles.js +0 -6
- package/dist/esm/CapLabel/CapLabel.js +0 -50
- package/dist/esm/CapLabel/index.js +0 -1
- package/dist/esm/CapLabel/styles.js +0 -219
- package/dist/esm/CapRow/CapRow.js +0 -22
- package/dist/esm/CapRow/index.js +0 -1
- package/dist/esm/CapRow/styles.js +0 -5
- package/dist/esm/CapSelect/CapSelect.js +0 -65
- package/dist/esm/CapSelect/index.js +0 -1
- package/dist/esm/CapSelect/styles.js +0 -6
- package/dist/esm/CapTooltip/CapTooltip.js +0 -34
- package/dist/esm/CapTooltip/index.js +0 -1
- package/dist/esm/CapTooltip/styles.js +0 -6
- package/dist/esm/CapTreeSelect/CapTreeSelect.js +0 -74
- package/dist/esm/CapTreeSelect/index.js +0 -1
- package/dist/esm/CapTreeSelect/styles.js +0 -11
- package/dist/esm/hoc/ComponentWithLabelHOC.js +0 -170
- package/dist/hoc/ComponentWithLabelHOC.js +0 -178
- package/hoc/ComponentWithLabelHOC.js +0 -225
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Select } from 'antd';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Test component to verify Ant Design v5 Select integration
|
|
7
|
+
* This is a simple wrapper for testing purposes only
|
|
8
|
+
*/
|
|
9
|
+
const CapTestSelect = (props) => {
|
|
10
|
+
return <Select {...props} />;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
CapTestSelect.propTypes = {
|
|
14
|
+
// Common Select props from antd
|
|
15
|
+
allowClear: PropTypes.bool,
|
|
16
|
+
defaultValue: PropTypes.oneOfType([
|
|
17
|
+
PropTypes.string,
|
|
18
|
+
PropTypes.number,
|
|
19
|
+
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
20
|
+
]),
|
|
21
|
+
disabled: PropTypes.bool,
|
|
22
|
+
loading: PropTypes.bool,
|
|
23
|
+
mode: PropTypes.oneOf(['multiple', 'tags']),
|
|
24
|
+
placeholder: PropTypes.string,
|
|
25
|
+
showSearch: PropTypes.bool,
|
|
26
|
+
value: PropTypes.oneOfType([
|
|
27
|
+
PropTypes.string,
|
|
28
|
+
PropTypes.number,
|
|
29
|
+
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
30
|
+
]),
|
|
31
|
+
options: PropTypes.arrayOf(
|
|
32
|
+
PropTypes.shape({
|
|
33
|
+
label: PropTypes.node,
|
|
34
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
35
|
+
disabled: PropTypes.bool
|
|
36
|
+
})
|
|
37
|
+
)
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
CapTestSelect.defaultProps = {
|
|
41
|
+
allowClear: false,
|
|
42
|
+
disabled: false,
|
|
43
|
+
loading: false,
|
|
44
|
+
showSearch: false
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default CapTestSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CapTestSelect';
|
|
@@ -5,7 +5,7 @@ import classnames from 'classnames';
|
|
|
5
5
|
import { Select, TreeSelect, Tooltip, Input, Button } from 'antd';
|
|
6
6
|
import { InfoCircleOutlined, SearchOutlined, WarningFilled, DownOutlined } from '@ant-design/icons';
|
|
7
7
|
import { SelectWrapper, HeaderWrapper, selectStyles } from './styles';
|
|
8
|
-
import withStyles from '
|
|
8
|
+
import withStyles from '../../utils/withStyles';
|
|
9
9
|
import styled from 'styled-components';
|
|
10
10
|
|
|
11
11
|
const CapUnifiedSelect = ({
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
/**
|
|
12
|
+
* Test component to verify Ant Design v5 Select integration
|
|
13
|
+
* This is a simple wrapper for testing purposes only
|
|
14
|
+
*/
|
|
15
|
+
var CapTestSelect = function CapTestSelect(props) {
|
|
16
|
+
return /*#__PURE__*/_react["default"].createElement(_antd.Select, props);
|
|
17
|
+
};
|
|
18
|
+
CapTestSelect.propTypes = {
|
|
19
|
+
// Common Select props from antd
|
|
20
|
+
allowClear: _propTypes["default"].bool,
|
|
21
|
+
defaultValue: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]))]),
|
|
22
|
+
disabled: _propTypes["default"].bool,
|
|
23
|
+
loading: _propTypes["default"].bool,
|
|
24
|
+
mode: _propTypes["default"].oneOf(['multiple', 'tags']),
|
|
25
|
+
placeholder: _propTypes["default"].string,
|
|
26
|
+
showSearch: _propTypes["default"].bool,
|
|
27
|
+
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]))]),
|
|
28
|
+
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
29
|
+
label: _propTypes["default"].node,
|
|
30
|
+
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
31
|
+
disabled: _propTypes["default"].bool
|
|
32
|
+
}))
|
|
33
|
+
};
|
|
34
|
+
CapTestSelect.defaultProps = {
|
|
35
|
+
allowClear: false,
|
|
36
|
+
disabled: false,
|
|
37
|
+
loading: false,
|
|
38
|
+
showSearch: false
|
|
39
|
+
};
|
|
40
|
+
var _default = exports["default"] = CapTestSelect;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _CapTestSelect["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _CapTestSelect = _interopRequireDefault(require("./CapTestSelect"));
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -11,7 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
var _antd = require("antd");
|
|
12
12
|
var _icons = require("@ant-design/icons");
|
|
13
13
|
var _styles = require("./styles");
|
|
14
|
-
var _withStyles = _interopRequireDefault(require("
|
|
14
|
+
var _withStyles = _interopRequireDefault(require("../../utils/withStyles"));
|
|
15
15
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Select } from 'antd';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Test component to verify Ant Design v5 Select integration
|
|
7
|
+
* This is a simple wrapper for testing purposes only
|
|
8
|
+
*/
|
|
9
|
+
var CapTestSelect = function CapTestSelect(props) {
|
|
10
|
+
return /*#__PURE__*/React.createElement(Select, props);
|
|
11
|
+
};
|
|
12
|
+
CapTestSelect.propTypes = {
|
|
13
|
+
// Common Select props from antd
|
|
14
|
+
allowClear: PropTypes.bool,
|
|
15
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))]),
|
|
16
|
+
disabled: PropTypes.bool,
|
|
17
|
+
loading: PropTypes.bool,
|
|
18
|
+
mode: PropTypes.oneOf(['multiple', 'tags']),
|
|
19
|
+
placeholder: PropTypes.string,
|
|
20
|
+
showSearch: PropTypes.bool,
|
|
21
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))]),
|
|
22
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
|
23
|
+
label: PropTypes.node,
|
|
24
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
25
|
+
disabled: PropTypes.bool
|
|
26
|
+
}))
|
|
27
|
+
};
|
|
28
|
+
CapTestSelect.defaultProps = {
|
|
29
|
+
allowClear: false,
|
|
30
|
+
disabled: false,
|
|
31
|
+
loading: false,
|
|
32
|
+
showSearch: false
|
|
33
|
+
};
|
|
34
|
+
export default CapTestSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CapTestSelect';
|
|
@@ -18,7 +18,7 @@ import classnames from 'classnames';
|
|
|
18
18
|
import { Select, TreeSelect, Tooltip, Input, Button } from 'antd';
|
|
19
19
|
import { InfoCircleOutlined, SearchOutlined, WarningFilled, DownOutlined } from '@ant-design/icons';
|
|
20
20
|
import { SelectWrapper, HeaderWrapper, selectStyles } from './styles';
|
|
21
|
-
import withStyles from '
|
|
21
|
+
import withStyles from '../../utils/withStyles';
|
|
22
22
|
import styled from 'styled-components';
|
|
23
23
|
var CapUnifiedSelect = function CapUnifiedSelect(_ref) {
|
|
24
24
|
var type = _ref.type,
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as CapInput } from './CapInput';
|
|
3
|
-
export { default as CapTable } from './CapTable';
|
|
4
|
-
|
|
5
|
-
// Export utilities
|
|
6
|
-
export { default as LocaleHoc } from './LocaleHoc';
|
|
7
|
-
|
|
8
|
-
// Export styled utilities
|
|
9
|
-
import * as _styledVars from './styled/variables';
|
|
10
|
-
export { _styledVars as styledVars };
|
|
11
|
-
export { default as styled } from './styled';
|
|
1
|
+
export { default as withStyles } from './withStyles';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enhances a React component with additional styles using styled-components.
|
|
5
|
+
* @param {React.ComponentType} WrappedComponent - The React component to enhance.
|
|
6
|
+
* @param {TemplateStringsArray} styles - CSS styles as a TemplateStringsArray.
|
|
7
|
+
* @returns {React.ComponentType} Returns the enhanced styled component.
|
|
8
|
+
*/
|
|
9
|
+
var withStyledComponent = function withStyledComponent(WrappedComponent, styles) {
|
|
10
|
+
/**
|
|
11
|
+
* A styled component generated by combining WrappedComponent with additional styles.
|
|
12
|
+
* @type {React.ComponentType}
|
|
13
|
+
*/
|
|
14
|
+
var StyledComponent = styled(WrappedComponent).withConfig({
|
|
15
|
+
displayName: "StyledComponent",
|
|
16
|
+
componentId: "sc-ujcdm3-0"
|
|
17
|
+
})(["", ";"], styles);
|
|
18
|
+
|
|
19
|
+
// Set default props from the original component to the styled component
|
|
20
|
+
StyledComponent.defaultProps = WrappedComponent.defaultProps;
|
|
21
|
+
return StyledComponent;
|
|
22
|
+
};
|
|
23
|
+
export default withStyledComponent;
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "withStyles", {
|
|
8
7
|
enumerable: true,
|
|
9
8
|
get: function get() {
|
|
10
|
-
return
|
|
9
|
+
return _withStyles["default"];
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
|
-
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _CapTable["default"];
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "LocaleHoc", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _LocaleHoc["default"];
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "styled", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _styled["default"];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
exports.styledVars = void 0;
|
|
32
|
-
var _CapInput = _interopRequireDefault(require("./CapInput"));
|
|
33
|
-
var _CapTable = _interopRequireDefault(require("./CapTable"));
|
|
34
|
-
var _LocaleHoc = _interopRequireDefault(require("./LocaleHoc"));
|
|
35
|
-
var _styledVars = _interopRequireWildcard(require("./styled/variables"));
|
|
36
|
-
exports.styledVars = _styledVars;
|
|
37
|
-
var _styled = _interopRequireDefault(require("./styled"));
|
|
38
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
+
var _withStyles = _interopRequireDefault(require("./withStyles"));
|
|
39
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
/**
|
|
10
|
+
* Enhances a React component with additional styles using styled-components.
|
|
11
|
+
* @param {React.ComponentType} WrappedComponent - The React component to enhance.
|
|
12
|
+
* @param {TemplateStringsArray} styles - CSS styles as a TemplateStringsArray.
|
|
13
|
+
* @returns {React.ComponentType} Returns the enhanced styled component.
|
|
14
|
+
*/
|
|
15
|
+
var withStyledComponent = function withStyledComponent(WrappedComponent, styles) {
|
|
16
|
+
/**
|
|
17
|
+
* A styled component generated by combining WrappedComponent with additional styles.
|
|
18
|
+
* @type {React.ComponentType}
|
|
19
|
+
*/
|
|
20
|
+
var StyledComponent = (0, _styledComponents["default"])(WrappedComponent).withConfig({
|
|
21
|
+
displayName: "StyledComponent",
|
|
22
|
+
componentId: "sc-ujcdm3-0"
|
|
23
|
+
})(["", ";"], styles);
|
|
24
|
+
|
|
25
|
+
// Set default props from the original component to the styled component
|
|
26
|
+
StyledComponent.defaultProps = WrappedComponent.defaultProps;
|
|
27
|
+
return StyledComponent;
|
|
28
|
+
};
|
|
29
|
+
var _default = exports["default"] = withStyledComponent;
|
package/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
// Import and export all components
|
|
2
2
|
export { default as CapInput } from './CapInput';
|
|
3
3
|
export { default as CapTable } from './CapTable';
|
|
4
|
+
export { default as CapTestSelect } from './CapTestSelect'; // Test component for Ant Design v5 integration
|
|
4
5
|
|
|
5
6
|
// Export utilities
|
|
6
7
|
export { default as LocaleHoc } from './LocaleHoc';
|
|
7
8
|
|
|
8
9
|
// Export styled utilities
|
|
9
10
|
export * as styledVars from './styled/variables';
|
|
10
|
-
export { default as styled } from './styled';
|
|
11
|
+
export { default as styled } from './styled';
|
|
12
|
+
|
|
13
|
+
// Export utils
|
|
14
|
+
export * from '../utils';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/blaze-ui",
|
|
3
3
|
"author": "Capillary Technologies",
|
|
4
|
-
"version": "0.1.6-alpha.
|
|
4
|
+
"version": "0.1.6-alpha.22",
|
|
5
5
|
"description": "Capillary UI component library with Ant Design v5",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|
|
@@ -26,16 +26,12 @@
|
|
|
26
26
|
"!**/tests"
|
|
27
27
|
],
|
|
28
28
|
"homepage": "https://github.com/Capillary/blaze-ui",
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
31
|
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
32
|
-
"react-intl": "^6.5.0"
|
|
33
|
-
},
|
|
34
29
|
"dependencies": {
|
|
35
30
|
"@ant-design/icons": "^5.2.6",
|
|
36
31
|
"@capillarytech/cap-ui-utils": "^3.0.4",
|
|
37
32
|
"antd": "^5.12.0",
|
|
38
33
|
"prop-types": "^15.8.1",
|
|
39
|
-
"styled-components": "^5.3.11"
|
|
34
|
+
"styled-components": "^5.3.11",
|
|
35
|
+
"react-intl": "2.7.2"
|
|
40
36
|
}
|
|
41
37
|
}
|
package/.DS_Store
DELETED
|
Binary file
|
package/CapHeading/CapHeading.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { HeadingWrapper, HeadingSpan } from './styles';
|
|
4
|
-
|
|
5
|
-
const CapHeading = ({ type = 'h5', children, as, ...rest }) => {
|
|
6
|
-
return (
|
|
7
|
-
<HeadingWrapper type={type} as={as || 'div'} {...rest}>
|
|
8
|
-
{children}
|
|
9
|
-
</HeadingWrapper>
|
|
10
|
-
);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
CapHeading.propTypes = {
|
|
14
|
-
type: PropTypes.oneOf([
|
|
15
|
-
'h0',
|
|
16
|
-
'h1',
|
|
17
|
-
'h2',
|
|
18
|
-
'h3',
|
|
19
|
-
'h4',
|
|
20
|
-
'h5',
|
|
21
|
-
'h6',
|
|
22
|
-
'h7',
|
|
23
|
-
'h8',
|
|
24
|
-
'h9',
|
|
25
|
-
'h10',
|
|
26
|
-
'label1',
|
|
27
|
-
'label2',
|
|
28
|
-
'label3',
|
|
29
|
-
'label4',
|
|
30
|
-
'label5',
|
|
31
|
-
'label6',
|
|
32
|
-
]),
|
|
33
|
-
children: PropTypes.node,
|
|
34
|
-
as: PropTypes.string,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// Inline span version
|
|
38
|
-
const CapHeadingSpan = ({ type = 'h5', children, ...rest }) => {
|
|
39
|
-
return (
|
|
40
|
-
<HeadingSpan type={type} {...rest}>
|
|
41
|
-
{children}
|
|
42
|
-
</HeadingSpan>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
CapHeadingSpan.propTypes = {
|
|
47
|
-
type: PropTypes.oneOf([
|
|
48
|
-
'h0',
|
|
49
|
-
'h1',
|
|
50
|
-
'h2',
|
|
51
|
-
'h3',
|
|
52
|
-
'h4',
|
|
53
|
-
'h5',
|
|
54
|
-
'h6',
|
|
55
|
-
'h7',
|
|
56
|
-
'h8',
|
|
57
|
-
'h9',
|
|
58
|
-
'h10',
|
|
59
|
-
'label1',
|
|
60
|
-
'label2',
|
|
61
|
-
'label3',
|
|
62
|
-
'label4',
|
|
63
|
-
'label5',
|
|
64
|
-
'label6',
|
|
65
|
-
]),
|
|
66
|
-
children: PropTypes.node,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
CapHeading.Span = CapHeadingSpan;
|
|
70
|
-
|
|
71
|
-
export default CapHeading;
|
package/CapHeading/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CapHeading';
|
package/CapHeading/styles.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
import * as styledVars from '../styled/variables';
|
|
3
|
-
|
|
4
|
-
const headings = {
|
|
5
|
-
h0: {
|
|
6
|
-
fontSize: '28px',
|
|
7
|
-
fontWeight: '500',
|
|
8
|
-
color: styledVars.CAP_G01,
|
|
9
|
-
lineHeight: '36px',
|
|
10
|
-
},
|
|
11
|
-
h1: {
|
|
12
|
-
fontSize: '24px',
|
|
13
|
-
fontWeight: '500',
|
|
14
|
-
color: styledVars.CAP_G01,
|
|
15
|
-
lineHeight: '32px',
|
|
16
|
-
},
|
|
17
|
-
h2: {
|
|
18
|
-
fontSize: '20px',
|
|
19
|
-
fontWeight: '500',
|
|
20
|
-
color: styledVars.CAP_G01,
|
|
21
|
-
lineHeight: '28px',
|
|
22
|
-
},
|
|
23
|
-
h3: {
|
|
24
|
-
fontSize: '16px',
|
|
25
|
-
fontWeight: '500',
|
|
26
|
-
color: styledVars.CAP_G01,
|
|
27
|
-
lineHeight: '24px',
|
|
28
|
-
},
|
|
29
|
-
h4: {
|
|
30
|
-
fontSize: '14px',
|
|
31
|
-
fontWeight: '500',
|
|
32
|
-
color: styledVars.CAP_G01,
|
|
33
|
-
lineHeight: '20px',
|
|
34
|
-
},
|
|
35
|
-
h5: {
|
|
36
|
-
fontSize: '14px',
|
|
37
|
-
fontWeight: 'normal',
|
|
38
|
-
color: styledVars.CAP_G01,
|
|
39
|
-
lineHeight: '20px',
|
|
40
|
-
},
|
|
41
|
-
h6: {
|
|
42
|
-
color: styledVars.CAP_G04,
|
|
43
|
-
fontSize: '14px',
|
|
44
|
-
fontWeight: 'normal',
|
|
45
|
-
lineHeight: '20px',
|
|
46
|
-
},
|
|
47
|
-
h7: {
|
|
48
|
-
fontSize: '20px',
|
|
49
|
-
fontWeight: '500',
|
|
50
|
-
color: styledVars.CAP_G04,
|
|
51
|
-
lineHeight: '28px',
|
|
52
|
-
},
|
|
53
|
-
h8: {
|
|
54
|
-
fontSize: '14px',
|
|
55
|
-
fontWeight: '400',
|
|
56
|
-
color: styledVars.CAP_G01,
|
|
57
|
-
lineHeight: '20px',
|
|
58
|
-
},
|
|
59
|
-
h9: {
|
|
60
|
-
fontSize: '14px',
|
|
61
|
-
fontWeight: '500',
|
|
62
|
-
color: styledVars.CAP_WHITE,
|
|
63
|
-
lineHeight: '20px',
|
|
64
|
-
},
|
|
65
|
-
h10: {
|
|
66
|
-
fontSize: '12px',
|
|
67
|
-
fontWeight: '500',
|
|
68
|
-
color: styledVars.CAP_G01,
|
|
69
|
-
lineHeight: '16px',
|
|
70
|
-
},
|
|
71
|
-
label1: {
|
|
72
|
-
color: styledVars.CAP_G04,
|
|
73
|
-
fontSize: '12px',
|
|
74
|
-
fontWeight: 'normal',
|
|
75
|
-
lineHeight: '20px',
|
|
76
|
-
},
|
|
77
|
-
label2: {
|
|
78
|
-
color: styledVars.CAP_G01,
|
|
79
|
-
fontSize: '12px',
|
|
80
|
-
fontWeight: 'normal',
|
|
81
|
-
lineHeight: '20px',
|
|
82
|
-
},
|
|
83
|
-
label3: {
|
|
84
|
-
color: styledVars.CAP_G05,
|
|
85
|
-
fontSize: '12px',
|
|
86
|
-
fontWeight: 'normal',
|
|
87
|
-
lineHeight: '20px',
|
|
88
|
-
},
|
|
89
|
-
label4: {
|
|
90
|
-
color: styledVars.CAP_G04,
|
|
91
|
-
fontSize: '12px',
|
|
92
|
-
fontWeight: 'normal',
|
|
93
|
-
lineHeight: '16px',
|
|
94
|
-
},
|
|
95
|
-
label5: {
|
|
96
|
-
color: styledVars.CAP_G04,
|
|
97
|
-
fontSize: '16px',
|
|
98
|
-
fontWeight: 'normal',
|
|
99
|
-
lineHeight: '24px',
|
|
100
|
-
},
|
|
101
|
-
label6: {
|
|
102
|
-
color: styledVars.CAP_G01,
|
|
103
|
-
fontSize: '16px',
|
|
104
|
-
fontWeight: 'normal',
|
|
105
|
-
lineHeight: '24px',
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const headingStyles = css`
|
|
110
|
-
font-size: ${props => headings[props.type].fontSize};
|
|
111
|
-
font-weight: ${props => headings[props.type].fontWeight};
|
|
112
|
-
color: ${props => headings[props.type].color};
|
|
113
|
-
line-height: ${props => headings[props.type].lineHeight};
|
|
114
|
-
margin: 0;
|
|
115
|
-
padding: 0;
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
export const HeadingWrapper = styled.div`
|
|
119
|
-
${headingStyles}
|
|
120
|
-
`;
|
|
121
|
-
|
|
122
|
-
export const HeadingSpan = styled.span`
|
|
123
|
-
${headingStyles}
|
|
124
|
-
display: inline-block;
|
|
125
|
-
`;
|
package/CapIcon/CapIcon.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as AntIcons from '@ant-design/icons';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import classNames from 'classnames';
|
|
6
|
-
import * as styledVars from '../styled/variables';
|
|
7
|
-
|
|
8
|
-
const getFontSizeFromProps = (size) => {
|
|
9
|
-
switch (size) {
|
|
10
|
-
case 'xs':
|
|
11
|
-
return styledVars.ICON_SIZE_XS;
|
|
12
|
-
case 's':
|
|
13
|
-
return styledVars.ICON_SIZE_S;
|
|
14
|
-
case 'm':
|
|
15
|
-
return styledVars.ICON_SIZE_M;
|
|
16
|
-
case 'l':
|
|
17
|
-
return styledVars.ICON_SIZE_L;
|
|
18
|
-
default:
|
|
19
|
-
return styledVars.ICON_SIZE_M;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const IconWrapper = styled.span`
|
|
24
|
-
font-size: ${props => getFontSizeFromProps(props.size)};
|
|
25
|
-
color: ${props => props.color || 'inherit'};
|
|
26
|
-
cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
|
|
27
|
-
opacity: ${props => props.disabled ? 0.5 : 1};
|
|
28
|
-
transition: all 0.3s;
|
|
29
|
-
|
|
30
|
-
&:hover {
|
|
31
|
-
opacity: ${props => props.disabled ? 0.5 : 0.8};
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
const CapIcon = ({
|
|
36
|
-
type,
|
|
37
|
-
className,
|
|
38
|
-
disabled,
|
|
39
|
-
size = 'm',
|
|
40
|
-
color,
|
|
41
|
-
...rest
|
|
42
|
-
}) => {
|
|
43
|
-
// Convert type to AntD icon name (e.g., 'close' -> 'CloseOutlined')
|
|
44
|
-
const getIconComponent = (iconType) => {
|
|
45
|
-
const iconMap = {
|
|
46
|
-
'close': AntIcons.CloseOutlined,
|
|
47
|
-
'chevron-down': AntIcons.DownOutlined,
|
|
48
|
-
'tick': AntIcons.CheckOutlined,
|
|
49
|
-
'info': AntIcons.InfoCircleOutlined,
|
|
50
|
-
// Add more icon mappings as needed
|
|
51
|
-
};
|
|
52
|
-
return iconMap[iconType] || AntIcons[iconType];
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const IconComponent = getIconComponent(type);
|
|
56
|
-
|
|
57
|
-
if (!IconComponent) {
|
|
58
|
-
console.warn(`Icon type "${type}" not found`);
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<IconWrapper
|
|
64
|
-
className={classNames('cap-icon', className, { disabled })}
|
|
65
|
-
disabled={disabled}
|
|
66
|
-
size={size}
|
|
67
|
-
color={color}
|
|
68
|
-
{...rest}
|
|
69
|
-
>
|
|
70
|
-
<IconComponent />
|
|
71
|
-
</IconWrapper>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
CapIcon.propTypes = {
|
|
76
|
-
type: PropTypes.string.isRequired,
|
|
77
|
-
className: PropTypes.string,
|
|
78
|
-
disabled: PropTypes.bool,
|
|
79
|
-
size: PropTypes.oneOf(['xs', 's', 'm', 'l']),
|
|
80
|
-
color: PropTypes.string,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export default CapIcon;
|
package/CapIcon/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CapIcon';
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Alert } from 'antd';
|
|
4
|
-
import { InfoNoteWrapper } from './styles';
|
|
5
|
-
import CapLabel from '../CapLabel';
|
|
6
|
-
import CapRow from '../CapRow';
|
|
7
|
-
|
|
8
|
-
const Note = ({ noteText }) => (
|
|
9
|
-
<CapLabel.Inline type="label4" className="note-text">
|
|
10
|
-
{noteText}
|
|
11
|
-
</CapLabel.Inline>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
Note.propTypes = {
|
|
15
|
-
noteText: PropTypes.string,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const CapInfoNote = ({ message, style, noteText, type = 'info', className, ...rest }) => {
|
|
19
|
-
return (
|
|
20
|
-
<InfoNoteWrapper>
|
|
21
|
-
<Alert
|
|
22
|
-
message={(
|
|
23
|
-
<CapRow className="note-message-container">
|
|
24
|
-
<Note noteText={noteText} />:
|
|
25
|
-
<CapRow className="message-text">{message}</CapRow>
|
|
26
|
-
</CapRow>
|
|
27
|
-
)}
|
|
28
|
-
className={className}
|
|
29
|
-
type={type}
|
|
30
|
-
showIcon
|
|
31
|
-
style={{
|
|
32
|
-
marginTop: '0.857rem',
|
|
33
|
-
marginBottom: '0.857rem',
|
|
34
|
-
...style,
|
|
35
|
-
}}
|
|
36
|
-
{...rest}
|
|
37
|
-
/>
|
|
38
|
-
</InfoNoteWrapper>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
CapInfoNote.propTypes = {
|
|
43
|
-
message: PropTypes.node,
|
|
44
|
-
style: PropTypes.object,
|
|
45
|
-
noteText: PropTypes.string,
|
|
46
|
-
type: PropTypes.string,
|
|
47
|
-
className: PropTypes.string,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
CapInfoNote.defaultProps = {
|
|
51
|
-
type: 'info',
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default CapInfoNote;
|
package/CapInfoNote/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CapInfoNote';
|