@wireapp/react-ui-kit 8.8.4 → 8.11.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/CHANGELOG.md +34 -0
- package/package.json +3 -2
- package/src/Form/Checkbox.js +9 -7
- package/src/Form/Checkbox.js.map +1 -1
- package/src/Form/Checkbox.md +4 -2
- package/src/Form/DropFileInput.d.js +2 -0
- package/src/Form/DropFileInput.d.js.map +1 -0
- package/src/Form/DropFileInput.d.ts +19 -0
- package/src/Form/DropFileInput.js +237 -0
- package/src/Form/DropFileInput.js.map +1 -0
- package/src/Form/DropFileInput.md +18 -0
- package/src/Form/RangeInput.d.js +2 -0
- package/src/Form/RangeInput.d.js.map +1 -0
- package/src/Form/RangeInput.d.ts +11 -0
- package/src/Form/RangeInput.js +75 -0
- package/src/Form/RangeInput.js.map +1 -0
- package/src/Form/RangeInput.md +27 -0
- package/src/Form/RangeInput.styles.d.js +2 -0
- package/src/Form/RangeInput.styles.d.js.map +1 -0
- package/src/Form/RangeInput.styles.d.ts +9 -0
- package/src/Form/RangeInput.styles.js +76 -0
- package/src/Form/RangeInput.styles.js.map +1 -0
- package/src/Form/Select.d.js +4 -0
- package/src/Form/Select.d.ts +16 -15
- package/src/Form/Select.js +42 -319
- package/src/Form/Select.js.map +1 -1
- package/src/Form/Select.md +25 -26
- package/src/Form/SelectComponents.d.js +2 -0
- package/src/Form/SelectComponents.d.js.map +1 -0
- package/src/Form/SelectComponents.d.ts +12 -0
- package/src/Form/SelectComponents.js +176 -0
- package/src/Form/SelectComponents.js.map +1 -0
- package/src/Form/SelectStyles.d.js +2 -0
- package/src/Form/SelectStyles.d.js.map +1 -0
- package/src/Form/SelectStyles.d.ts +925 -0
- package/src/Form/SelectStyles.js +133 -0
- package/src/Form/SelectStyles.js.map +1 -0
- package/src/Form/index.d.js +26 -0
- package/src/Form/index.d.js.map +1 -1
- package/src/Form/index.d.ts +3 -0
- package/src/Form/index.js +26 -0
- package/src/Form/index.js.map +1 -1
- package/src/Icon/ArrowDown.d.js +2 -0
- package/src/Icon/ArrowDown.d.js.map +1 -0
- package/src/Icon/ArrowDown.d.ts +2 -0
- package/src/Icon/ArrowDown.js +45 -0
- package/src/Icon/ArrowDown.js.map +1 -0
- package/src/Icon/SVGIcon.md +2 -0
- package/src/Icon/UploadIcon.d.js +2 -0
- package/src/Icon/UploadIcon.d.js.map +1 -0
- package/src/Icon/UploadIcon.d.ts +4 -0
- package/src/Icon/UploadIcon.js +46 -0
- package/src/Icon/UploadIcon.js.map +1 -0
- package/src/Icon/index.d.js +13 -0
- package/src/Icon/index.d.js.map +1 -1
- package/src/Icon/index.d.ts +1 -0
- package/src/Icon/index.js +13 -0
- package/src/Icon/index.js.map +1 -1
- package/src/Layout/Theme.d.ts +1 -0
- package/src/Layout/Theme.js +4 -2
- package/src/Layout/Theme.js.map +1 -1
- package/src/util.d.ts +2 -0
- package/src/util.js +10 -1
- package/src/util.js.map +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.RangeInput = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _react = require("@emotion/react");
|
|
17
|
+
|
|
18
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _InputLabel = _interopRequireDefault(require("./InputLabel"));
|
|
21
|
+
|
|
22
|
+
var _RangeInput = require("./RangeInput.styles");
|
|
23
|
+
|
|
24
|
+
var _excluded = ["ref", "id", "label", "minValueLabel", "maxValueLabel", "min", "max", "value", "onChange", "wrapperCSS"];
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
var RangeInput = /*#__PURE__*/(0, _react2.forwardRef)(function (_ref) {
|
|
31
|
+
var ref = _ref.ref,
|
|
32
|
+
_ref$id = _ref.id,
|
|
33
|
+
id = _ref$id === void 0 ? Math.random().toString() : _ref$id,
|
|
34
|
+
label = _ref.label,
|
|
35
|
+
minValueLabel = _ref.minValueLabel,
|
|
36
|
+
maxValueLabel = _ref.maxValueLabel,
|
|
37
|
+
_ref$min = _ref.min,
|
|
38
|
+
min = _ref$min === void 0 ? '0' : _ref$min,
|
|
39
|
+
_ref$max = _ref.max,
|
|
40
|
+
max = _ref$max === void 0 ? '100' : _ref$max,
|
|
41
|
+
_ref$value = _ref.value,
|
|
42
|
+
value = _ref$value === void 0 ? '0' : _ref$value,
|
|
43
|
+
onChange = _ref.onChange,
|
|
44
|
+
wrapperCSS = _ref.wrapperCSS,
|
|
45
|
+
inputProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
46
|
+
var minNum = Number(min);
|
|
47
|
+
var maxNum = Number(max);
|
|
48
|
+
var valueNum = Number(value);
|
|
49
|
+
var backgroundSize = "".concat((valueNum - minNum) * 100 / (maxNum - minNum), "% 100%");
|
|
50
|
+
return (0, _react.jsx)("div", {
|
|
51
|
+
css: wrapperCSS
|
|
52
|
+
}, label && (0, _react.jsx)(_InputLabel["default"], {
|
|
53
|
+
htmlFor: id
|
|
54
|
+
}, label), (0, _react.jsx)("div", {
|
|
55
|
+
css: _RangeInput.rangeInputWrapperStyles
|
|
56
|
+
}, minValueLabel && (0, _react.jsx)("span", {
|
|
57
|
+
css: (0, _RangeInput.getValueLabelStyles)(_RangeInput.ValueLabelPosition.LEFT)
|
|
58
|
+
}, minValueLabel), maxValueLabel && (0, _react.jsx)("span", {
|
|
59
|
+
css: (0, _RangeInput.getValueLabelStyles)(_RangeInput.ValueLabelPosition.RIGHT)
|
|
60
|
+
}, maxValueLabel), (0, _react.jsx)("input", (0, _extends2["default"])({
|
|
61
|
+
ref: ref,
|
|
62
|
+
css: function css(theme) {
|
|
63
|
+
return (0, _RangeInput.getImageCropZoomInputStyles)(theme, backgroundSize);
|
|
64
|
+
},
|
|
65
|
+
id: id,
|
|
66
|
+
name: id,
|
|
67
|
+
min: min,
|
|
68
|
+
max: max,
|
|
69
|
+
value: value,
|
|
70
|
+
onChange: onChange,
|
|
71
|
+
type: "range"
|
|
72
|
+
}, inputProps))));
|
|
73
|
+
});
|
|
74
|
+
exports.RangeInput = RangeInput;
|
|
75
|
+
//# sourceMappingURL=RangeInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["RangeInput.tsx"],"names":["RangeInput","ref","id","Math","random","toString","label","minValueLabel","maxValueLabel","min","max","value","onChange","wrapperCSS","in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aAA3D,CAFpB,EAGE;AACE,IAAA,GAAG,EAAEP,GADP;AAEE,IAAA,GAAG,EAAE,aAACuB,KAAD;AAAA,aAAkB,6CAA4BA,KAA5B,EAAmCL,cAAnC,CAAlB;AAAA,KAFP;AAGE,IAAA,EAAE,EAAEjB,EAHN;AAIE,IAAA,IAAI,EAAEA,EAJR;AAKE,IAAA,GAAG,EAAEO,GALP;AAME,IAAA,GAAG,EAAEC,GANP;AAOE,IAAA,KAAK,EAAEC,KAPT;AAQE,IAAA,QAAQ,EAAEC,QARZ;AASE,IAAA,IAAI,EAAC;AATP,KAUME,UAVN,EAHF,CAFF,CADF;AAqBD,CAzC4C,CAAxC","sourcesContent":["/*\n * Wire\n * Copyright (C) 2022 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/** @jsx jsx */\nimport {CSSObject, jsx} from '@emotion/react';\nimport React, {FC, forwardRef} from 'react';\nimport {TextProps} from '../Text';\nimport {Theme} from '../Layout';\nimport InputLabel from './InputLabel';\nimport {\n getImageCropZoomInputStyles,\n getValueLabelStyles,\n rangeInputWrapperStyles,\n ValueLabelPosition,\n} from './RangeInput.styles';\n\nexport interface RangeInputProps<T = HTMLInputElement> extends TextProps<T> {\n label?: string;\n minValueLabel?: string;\n maxValueLabel?: string;\n wrapperCSS?: CSSObject;\n}\n\nexport const RangeInput: FC<RangeInputProps> = forwardRef<HTMLInputElement, RangeInputProps<HTMLInputElement>>(\n ({\n ref,\n id = Math.random().toString(),\n label,\n minValueLabel,\n maxValueLabel,\n min = '0',\n max = '100',\n value = '0',\n onChange,\n wrapperCSS,\n ...inputProps\n }) => {\n const minNum = Number(min);\n const maxNum = Number(max);\n const valueNum = Number(value);\n\n const backgroundSize = `${((valueNum - minNum) * 100) / (maxNum - minNum)}% 100%` as const;\n\n return (\n <div css={wrapperCSS}>\n {label && <InputLabel htmlFor={id}>{label}</InputLabel>}\n <div css={rangeInputWrapperStyles}>\n {minValueLabel && <span css={getValueLabelStyles(ValueLabelPosition.LEFT)}>{minValueLabel}</span>}\n {maxValueLabel && <span css={getValueLabelStyles(ValueLabelPosition.RIGHT)}>{maxValueLabel}</span>}\n <input\n ref={ref}\n css={(theme: Theme) => getImageCropZoomInputStyles(theme, backgroundSize)}\n id={id}\n name={id}\n min={min}\n max={max}\n value={value}\n onChange={onChange}\n type=\"range\"\n {...inputProps}\n />\n </div>\n </div>\n );\n },\n);\n"],"file":"RangeInput.js"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Demo:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
import {Columns, Column, RangeInput} from '@wireapp/react-ui-kit';
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
|
|
7
|
+
const [zoom, setZoom] = useState(1);
|
|
8
|
+
|
|
9
|
+
const handleChange = e => {
|
|
10
|
+
setZoom(+e.target.value);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
<>
|
|
14
|
+
<div>
|
|
15
|
+
<RangeInput
|
|
16
|
+
label={'Zoom'}
|
|
17
|
+
minValueLabel="-"
|
|
18
|
+
maxValueLabel="+"
|
|
19
|
+
onChange={handleChange}
|
|
20
|
+
value={zoom}
|
|
21
|
+
min={1}
|
|
22
|
+
max={3}
|
|
23
|
+
step={0.1}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</>;
|
|
27
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"RangeInput.styles.d.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSObject } from '@emotion/react';
|
|
2
|
+
import { Theme } from '../Layout';
|
|
3
|
+
export declare const rangeInputWrapperStyles: CSSObject;
|
|
4
|
+
export declare const getImageCropZoomInputStyles: (theme: Theme, backgroundSize: `${number}% ${number}%`) => CSSObject;
|
|
5
|
+
export declare enum ValueLabelPosition {
|
|
6
|
+
LEFT = "left",
|
|
7
|
+
RIGHT = "right"
|
|
8
|
+
}
|
|
9
|
+
export declare const getValueLabelStyles: (position: ValueLabelPosition) => CSSObject;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.getValueLabelStyles = exports.ValueLabelPosition = exports.getImageCropZoomInputStyles = exports.rangeInputWrapperStyles = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _Identity = require("../Identity");
|
|
13
|
+
|
|
14
|
+
var _util = require("../util");
|
|
15
|
+
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
+
|
|
20
|
+
var rangeInputWrapperStyles = {
|
|
21
|
+
position: 'relative',
|
|
22
|
+
marginTop: '19px'
|
|
23
|
+
};
|
|
24
|
+
exports.rangeInputWrapperStyles = rangeInputWrapperStyles;
|
|
25
|
+
var thumbSelectors = ['&::-webkit-slider-thumb', '&::-moz-range-thumb', '&::-ms-thumb'];
|
|
26
|
+
var sliderSelectors = ['&::-webkit-slider-runnable-track', '&::-moz-range-track', '&::-ms-track'];
|
|
27
|
+
|
|
28
|
+
var getImageCropZoomInputStyles = function getImageCropZoomInputStyles(theme, backgroundSize) {
|
|
29
|
+
return _objectSpread(_objectSpread({
|
|
30
|
+
display: 'block',
|
|
31
|
+
'-webkit-appearance': 'none',
|
|
32
|
+
width: '100%',
|
|
33
|
+
height: '8px',
|
|
34
|
+
background: _Identity.COLOR_V2.GRAY_60,
|
|
35
|
+
borderRadius: '4px',
|
|
36
|
+
backgroundImage: "linear-gradient(".concat(theme.general.primaryColor, ", ").concat(theme.general.primaryColor, ")"),
|
|
37
|
+
backgroundSize: backgroundSize || '0% 100%',
|
|
38
|
+
backgroundRepeat: 'no-repeat'
|
|
39
|
+
}, (0, _util.manySelectors)(thumbSelectors, {
|
|
40
|
+
'-webkit-appearance': 'none',
|
|
41
|
+
height: '18px',
|
|
42
|
+
width: '18px',
|
|
43
|
+
borderRadius: '50%',
|
|
44
|
+
background: _Identity.COLOR_V2.GRAY_80,
|
|
45
|
+
cursor: 'pointer',
|
|
46
|
+
border: 'none',
|
|
47
|
+
boxShadow: 'none'
|
|
48
|
+
})), (0, _util.manySelectors)(sliderSelectors, {
|
|
49
|
+
'-webkit-appearance': 'none',
|
|
50
|
+
boxShadow: 'none',
|
|
51
|
+
border: 'none',
|
|
52
|
+
background: 'transparent'
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.getImageCropZoomInputStyles = getImageCropZoomInputStyles;
|
|
57
|
+
var ValueLabelPosition;
|
|
58
|
+
exports.ValueLabelPosition = ValueLabelPosition;
|
|
59
|
+
|
|
60
|
+
(function (ValueLabelPosition) {
|
|
61
|
+
ValueLabelPosition["LEFT"] = "left";
|
|
62
|
+
ValueLabelPosition["RIGHT"] = "right";
|
|
63
|
+
})(ValueLabelPosition || (exports.ValueLabelPosition = ValueLabelPosition = {}));
|
|
64
|
+
|
|
65
|
+
var getValueLabelStyles = function getValueLabelStyles(position) {
|
|
66
|
+
return (0, _defineProperty2["default"])({
|
|
67
|
+
pointerEvents: 'none',
|
|
68
|
+
bottom: '100%',
|
|
69
|
+
fontSize: '16px',
|
|
70
|
+
fontWeight: 300,
|
|
71
|
+
position: 'absolute'
|
|
72
|
+
}, position, '4px');
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
exports.getValueLabelStyles = getValueLabelStyles;
|
|
76
|
+
//# sourceMappingURL=RangeInput.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["RangeInput.styles.ts"],"names":["rangeInputWrapperStyles","position","marginTop","thumbSelectors","sliderSelectors","getImageCropZoomInputStyles","theme","backgroundSize","display","width","height","background","COLOR_V2","GRAY_60","borderRadius","backgroundImage","general","primaryColor","backgroundRepeat","GRAY_80","cursor","border","boxShadow","ValueLabelPosition","getValueLabelStyles","pointerEvents","bottom","fontSize","fontWeight"],"mappings":";;;;;;;;;;;AAqBA;;AACA;;;;;;AAEO,IAAMA,uBAAkC,GAAG;AAChDC,EAAAA,QAAQ,EAAE,UADsC;AAEhDC,EAAAA,SAAS,EAAE;AAFqC,CAA3C;;AAKP,IAAMC,cAAc,GAAG,CAAC,yBAAD,EAA4B,qBAA5B,EAAmD,cAAnD,CAAvB;AACA,IAAMC,eAAe,GAAG,CAAC,kCAAD,EAAqC,qBAArC,EAA4D,cAA5D,CAAxB;;AAEO,IAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B,CAACC,KAAD,EAAeC,cAAf;AAAA;AACzC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B,KANqB;AAAA,CAA5B","sourcesContent":["/*\n * Wire\n * Copyright (C) 2022 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {CSSObject} from '@emotion/react';\nimport {Theme} from '../Layout';\nimport {COLOR_V2} from '../Identity';\nimport {manySelectors} from '../util';\n\nexport const rangeInputWrapperStyles: CSSObject = {\n position: 'relative',\n marginTop: '19px',\n};\n\nconst thumbSelectors = ['&::-webkit-slider-thumb', '&::-moz-range-thumb', '&::-ms-thumb'];\nconst sliderSelectors = ['&::-webkit-slider-runnable-track', '&::-moz-range-track', '&::-ms-track'];\n\nexport const getImageCropZoomInputStyles = (theme: Theme, backgroundSize: `${number}% ${number}%`): CSSObject => ({\n display: 'block',\n '-webkit-appearance': 'none',\n width: '100%',\n height: '8px',\n background: COLOR_V2.GRAY_60,\n borderRadius: '4px',\n backgroundImage: `linear-gradient(${theme.general.primaryColor}, ${theme.general.primaryColor})`,\n backgroundSize: backgroundSize || '0% 100%',\n backgroundRepeat: 'no-repeat',\n\n ...manySelectors(thumbSelectors, {\n '-webkit-appearance': 'none',\n height: '18px',\n width: '18px',\n borderRadius: '50%',\n background: COLOR_V2.GRAY_80,\n cursor: 'pointer',\n border: 'none',\n boxShadow: 'none',\n }),\n\n ...manySelectors(sliderSelectors, {\n '-webkit-appearance': 'none',\n boxShadow: 'none',\n border: 'none',\n background: 'transparent',\n }),\n});\n\nexport enum ValueLabelPosition {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport const getValueLabelStyles = (position: ValueLabelPosition): CSSObject => ({\n pointerEvents: 'none',\n bottom: '100%',\n fontSize: '16px',\n fontWeight: 300,\n position: 'absolute',\n [position]: '4px',\n});\n"],"file":"RangeInput.styles.js"}
|
package/src/Form/Select.d.js
CHANGED
package/src/Form/Select.d.ts
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { CSSObject
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
export declare type
|
|
2
|
+
import { CSSObject } from '@emotion/react';
|
|
3
|
+
import { FC, ReactElement } from 'react';
|
|
4
|
+
import { StateManagerProps } from 'react-select/dist/declarations/src/useStateManager';
|
|
5
|
+
export declare type Option = {
|
|
6
6
|
value: string | number;
|
|
7
7
|
label: string;
|
|
8
8
|
description?: string;
|
|
9
|
+
isDisabled?: boolean;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
interface SelectProps extends StateManagerProps<Option> {
|
|
11
12
|
id: string;
|
|
12
|
-
onChange: (selectedOption: T['value']) => void;
|
|
13
13
|
dataUieName: string;
|
|
14
|
-
options:
|
|
15
|
-
|
|
16
|
-
helperText?: string;
|
|
14
|
+
options: Option[];
|
|
15
|
+
wrapperCSS?: CSSObject;
|
|
17
16
|
label?: string;
|
|
18
|
-
|
|
19
|
-
required?: boolean;
|
|
20
|
-
markInvalid?: boolean;
|
|
17
|
+
helperText?: string;
|
|
21
18
|
error?: ReactElement;
|
|
22
|
-
|
|
19
|
+
markInvalid?: boolean;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
isMulti?: boolean;
|
|
22
|
+
/**In the multi-select case, onChange's value will be an array of all the currently selected values. */
|
|
23
|
+
onChange?: (value: Option | Option[]) => void;
|
|
23
24
|
}
|
|
24
|
-
export declare const
|
|
25
|
-
export
|
|
25
|
+
export declare const Select: FC<SelectProps>;
|
|
26
|
+
export {};
|