@decisiv/ui-components 2.0.1-alpha.150 → 2.0.1-alpha.153
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/lib/atoms/InputField/schema.js +2 -2
- package/lib/components/DropdownList/schema.js +1 -1
- package/lib/components/JumpTo/utils.d.ts.map +1 -1
- package/lib/components/JumpTo/utils.js +3 -7
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Toggle/Fieldset.d.ts.map +1 -1
- package/lib/components/Toggle/Fieldset.js +20 -11
- package/lib/components/Toggle/Option.d.ts.map +1 -1
- package/lib/components/Toggle/Option.js +1 -1
- package/lib/components/Toggle/Slider.d.ts +1 -3
- package/lib/components/Toggle/Slider.d.ts.map +1 -1
- package/lib/components/Toggle/Slider.js +29 -24
- package/lib/components/Toggle/index.d.ts.map +1 -1
- package/lib/components/Toggle/index.js +2 -1
- package/lib/components/Toggle/propTypes.js +1 -1
- package/lib/components/Toggle/schema.js +1 -1
- package/lib/components/Toggle/types.d.ts +3 -2
- package/lib/components/Toggle/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -20,9 +20,9 @@ schema.makePropTypes = function () {
|
|
|
20
20
|
icon: _reactDesc.PropTypes.element.description('An icon to be rendered on the left side of the input.'),
|
|
21
21
|
id: _reactDesc.PropTypes.string.description('A unique ID for the input.'),
|
|
22
22
|
inputContainerRef: _reactDesc.PropTypes.oneOfType([// Either a function
|
|
23
|
-
_reactDesc.PropTypes.func, // Or the instance of a DOM native element (
|
|
23
|
+
_reactDesc.PropTypes.func, // Or the instance of a DOM native element (current will be an instance of HTMLDivElement)
|
|
24
24
|
_reactDesc.PropTypes.shape({
|
|
25
|
-
current: _reactDesc.PropTypes.
|
|
25
|
+
current: _reactDesc.PropTypes.any
|
|
26
26
|
})]).description('A reference to the container component for the input field.'),
|
|
27
27
|
label: _reactDesc.PropTypes.string.description('A label for the input field.').isRequired,
|
|
28
28
|
labelId: _reactDesc.PropTypes.string.description("A unique ID for the input's label. This will be used in some ARIA attributes as well."),
|
|
@@ -37,7 +37,7 @@ schema.propTypes = _objectSpread({}, (0, _omit.default)(_schema.default.makeProp
|
|
|
37
37
|
value: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.number, _reactDesc.PropTypes.string]).description('The value for an option in the dropdown list.')
|
|
38
38
|
})).description('The array of item data that will be rendered').isRequired,
|
|
39
39
|
listRef: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.func, _reactDesc.PropTypes.shape({
|
|
40
|
-
current: _reactDesc.PropTypes.
|
|
40
|
+
current: _reactDesc.PropTypes.any
|
|
41
41
|
})]).description('A ref for the list container.'),
|
|
42
42
|
name: _reactDesc.PropTypes.string.description("The input's name, to identify the input in the data in a form.").isRequired,
|
|
43
43
|
onChange: _reactDesc.PropTypes.func.description('Change event handler, called with an array of the selected item IDs.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/JumpTo/utils.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAExD;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/JumpTo/utils.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAExD;AAmBD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,GAClB,IAAI,CAaN"}
|
|
@@ -22,16 +22,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
22
|
function getFirstNumber(values) {
|
|
23
23
|
return values.find(_isNumber.default) || 0;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Determine whether the current browser supports smooth scrolling.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var supportsNativeSmoothScroll = ('scrollBehavior' in document.documentElement.style);
|
|
31
25
|
|
|
32
26
|
function scrollToElement(element, offset) {
|
|
33
27
|
var targetOffset = element.getBoundingClientRect().top + window.pageYOffset;
|
|
34
|
-
var scrollTargetY = targetOffset - offset; //
|
|
28
|
+
var scrollTargetY = targetOffset - offset; // does the current browser support smooth scrolling?
|
|
29
|
+
|
|
30
|
+
var supportsNativeSmoothScroll = ('scrollBehavior' in document.documentElement.style); // in our testing supportsNativeSmoothScroll will always be true
|
|
35
31
|
|
|
36
32
|
/* istanbul ignore else */
|
|
37
33
|
|
|
@@ -254,7 +254,7 @@ Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
|
254
254
|
footer: _propTypes2.default.elementType,
|
|
255
255
|
getRowKey: (0, _propTypes.requireIf)(_propTypes2.default.func, function (_ref3) {
|
|
256
256
|
var data = _ref3.data;
|
|
257
|
-
return !((0, _get.default)(data, '0.key') || (0, _get.default)(data, '0.id'));
|
|
257
|
+
return !!data && data.length > 0 && !((0, _get.default)(data, '0.key') || (0, _get.default)(data, '0.id'));
|
|
258
258
|
}),
|
|
259
259
|
height: (0, _propTypes.requireIf)(_propTypes2.default.string, function (_ref4) {
|
|
260
260
|
var scroll = _ref4.scroll,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fieldset.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Fieldset.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Fieldset.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Fieldset.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAkCxC,QAAA,MAAM,QAAQ,oFAyDb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -17,33 +17,42 @@ var _focusRingWithColor = _interopRequireDefault(require("../../utils/focusRingW
|
|
|
17
17
|
|
|
18
18
|
var _styleModifiers = require("../../utils/styleModifiers");
|
|
19
19
|
|
|
20
|
-
var _Option = require("./Option");
|
|
21
|
-
|
|
22
20
|
var _Slider = require("./Slider");
|
|
23
21
|
|
|
24
22
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
25
23
|
|
|
26
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
25
|
|
|
28
|
-
var sharedInactiveStyles = (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
var sharedInactiveStyles = function sharedInactiveStyles(_ref) {
|
|
27
|
+
var position = _ref.position;
|
|
28
|
+
return (0, _styledComponents.css)(["cursor:not-allowed;", "{", ";}&:active,&:focus{", "{border:1px solid transparent;", ";}}&:hover{", "{box-shadow:none;}}*{cursor:not-allowed;}"], _Slider.SliderContainer, position === 'left' ? (0, _styledComponents.css)(["opacity:0.15;"]) : (0, _styledComponents.css)(["background-color:rgb(179,215,197);"]), _Slider.SliderContainer, (0, _focusRingWithColor.default)({
|
|
29
|
+
red: 0,
|
|
30
|
+
green: 0,
|
|
31
|
+
blue: 0,
|
|
32
|
+
alpha: 0
|
|
33
|
+
}), _Slider.SliderSwitch);
|
|
34
|
+
};
|
|
34
35
|
|
|
35
36
|
var Fieldset = _styledComponents.default.fieldset.withConfig({
|
|
36
37
|
displayName: "Fieldset",
|
|
37
38
|
componentId: "jon6ft-0"
|
|
38
|
-
})(["display:inline-block;border-width:0;padding:0;margin:0;&:active,&:focus{outline:none;}&:active ", ",&:focus ", "{border:1px solid ", ";", "
|
|
39
|
-
var
|
|
39
|
+
})(["display:inline-block;border-width:0;padding:0;margin:0;&:active,&:focus{outline:none;}&:hover{", "{box-shadow:0 0 0 ", "px rgba(37,38,46,0.15);}}&:active ", ",&:focus ", "{border:1px solid ", ";", "}&:hover ", "{background-color:toColorString(color.interaction.indianOcean)};}", "{border:1px solid transparent;}", ";", ";"], _Slider.SliderSwitch, _designTokens.spacing.base * 0.8, _Slider.SliderContainer, _Slider.SliderContainer, (0, _toColorString.default)(_designTokens.color.interaction.pacificOcean), function (_ref2) {
|
|
40
|
+
var position = _ref2.position;
|
|
41
|
+
return position === 'left' ? (0, _focusRingWithColor.default)(_designTokens.color.interaction.pacificOcean40) : (0, _focusRingWithColor.default)(_designTokens.color.opacity.fullMoon50);
|
|
42
|
+
}, _Slider.SliderSwitch, _Slider.SliderContainer, (0, _dynamicModifiers.applyDynamicModifiers)('size', function (_ref3) {
|
|
43
|
+
var size = _ref3.size;
|
|
40
44
|
|
|
41
45
|
if (size === 'small') {
|
|
42
46
|
return (0, _styledComponents.css)(["height:", "px;"], 8 * 2 + 2);
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
return (0, _styledComponents.css)(["height:", "px;"], _designTokens.spacing.base * 2 + 2);
|
|
46
|
-
}),
|
|
50
|
+
}), function (_ref4) {
|
|
51
|
+
var position = _ref4.position;
|
|
52
|
+
return (0, _styleModifiers.whenSome)([['disabled', true], ['readOnly', true]], (0, _styledComponents.css)(["", ""], sharedInactiveStyles({
|
|
53
|
+
position: position
|
|
54
|
+
})));
|
|
55
|
+
});
|
|
47
56
|
|
|
48
57
|
var _default = Fieldset;
|
|
49
58
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Option.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAUlD,eAAO,MAAM,WAAW;;
|
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Option.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAUlD,eAAO,MAAM,WAAW;;qBAIvB,CAAC;AAEF,iBAAS,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA2B3E;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -28,7 +28,7 @@ var OptionLabel = (0, _styledComponents.default)(_Typography.P).attrs({
|
|
|
28
28
|
}).withConfig({
|
|
29
29
|
displayName: "Option__OptionLabel",
|
|
30
30
|
componentId: "sjjkn8-1"
|
|
31
|
-
})(["
|
|
31
|
+
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
32
32
|
exports.OptionLabel = OptionLabel;
|
|
33
33
|
|
|
34
34
|
function Option(_ref) {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SliderProps } from './types';
|
|
3
3
|
export declare const SliderSwitch: import("styled-components").StyledComponent<"div", any, SliderProps, never>;
|
|
4
|
-
export declare const SliderContainer: import("styled-components").StyledComponent<"div", any,
|
|
5
|
-
size?: "small" | "medium" | undefined;
|
|
6
|
-
}, never>;
|
|
4
|
+
export declare const SliderContainer: import("styled-components").StyledComponent<"div", any, Partial<SliderProps>, never>;
|
|
7
5
|
declare function Slider({ position, size }: SliderProps): JSX.Element;
|
|
8
6
|
export default Slider;
|
|
9
7
|
//# sourceMappingURL=Slider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Slider.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Slider.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,YAAY,6EAuCxB,CAAC;AAuBF,eAAO,MAAM,eAAe,sFAqC3B,CAAC;AAEF,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAQ5D;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -19,52 +19,57 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
var SliderBar = _styledComponents.default.div.withConfig({
|
|
23
|
-
displayName: "Slider__SliderBar",
|
|
24
|
-
componentId: "egedid-0"
|
|
25
|
-
})(["align-items:center;background-color:", ";border-radius:1px;display:flex;height:2px;position:relative;", ";"], (0, _rgb.default)(_designTokens.color.base.quarterMoon), (0, _dynamicModifiers.applyDynamicModifiers)('size', function (_ref) {
|
|
26
|
-
var size = _ref.size;
|
|
27
|
-
return size === 'small' ? (0, _styledComponents.css)(["width:36px;"]) : (0, _styledComponents.css)(["width:44px;"]);
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
22
|
var SliderSwitch = _styledComponents.default.div.withConfig({
|
|
31
23
|
displayName: "Slider__SliderSwitch",
|
|
32
|
-
componentId: "egedid-
|
|
33
|
-
})(["background-color:", ";border-radius:50%;position:absolute;transition:left 200ms cubic-bezier(0.39,0.575,0.565,1);", ";", ";"], (0, _rgb.default)(_designTokens.color.
|
|
34
|
-
var position =
|
|
35
|
-
size =
|
|
24
|
+
componentId: "egedid-0"
|
|
25
|
+
})(["background-color:", ";border-radius:50%;position:absolute;transition:left 200ms cubic-bezier(0.39,0.575,0.565,1);", ";", ";"], (0, _rgb.default)(_designTokens.color.base.snowWhite), (0, _dynamicModifiers.applyDynamicModifiers)('position', function (_ref) {
|
|
26
|
+
var position = _ref.position,
|
|
27
|
+
size = _ref.size;
|
|
36
28
|
|
|
37
29
|
if (position === 'left') {
|
|
38
|
-
return (0, _styledComponents.css)(["left:
|
|
30
|
+
return (0, _styledComponents.css)(["left:", "px;"], _designTokens.spacing.base * 0.2);
|
|
39
31
|
}
|
|
40
32
|
/* Must equal the width of the SliderBar minus the width of the SliderSwitch */
|
|
41
33
|
|
|
42
34
|
/* Must use the `left` position to maintain the animation of "sliding" */
|
|
43
35
|
|
|
44
36
|
|
|
45
|
-
return size === 'small' ? (0, _styledComponents.css)(["left:
|
|
46
|
-
}), (0, _dynamicModifiers.applyDynamicModifiers)('size', function (
|
|
47
|
-
var size =
|
|
48
|
-
return size === 'small' ? (0, _styledComponents.css)(["height:
|
|
37
|
+
return size === 'small' ? (0, _styledComponents.css)(["left:", "px;"], _designTokens.spacing.base * 1.7) : (0, _styledComponents.css)(["left:", "px;"], _designTokens.spacing.base * 2.1);
|
|
38
|
+
}), (0, _dynamicModifiers.applyDynamicModifiers)('size', function (_ref2) {
|
|
39
|
+
var size = _ref2.size;
|
|
40
|
+
return size === 'small' ? (0, _styledComponents.css)(["height:", "px;width:", "px;"], _designTokens.spacing.base * 1.2, _designTokens.spacing.base * 1.2) : (0, _styledComponents.css)(["height:", "px;width:", "px;"], _designTokens.spacing.base * 1.6, _designTokens.spacing.base * 1.6);
|
|
49
41
|
}));
|
|
50
42
|
|
|
51
43
|
exports.SliderSwitch = SliderSwitch;
|
|
52
44
|
|
|
45
|
+
var SliderBar = _styledComponents.default.div.withConfig({
|
|
46
|
+
displayName: "Slider__SliderBar",
|
|
47
|
+
componentId: "egedid-1"
|
|
48
|
+
})(["align-items:center;background-color:rgb(color.base.quarterMoon)};border-radius:1px;display:flex;height:2px;position:relative;", ";"], (0, _dynamicModifiers.applyDynamicModifiers)('size', function (_ref3) {
|
|
49
|
+
var size = _ref3.size;
|
|
50
|
+
return size === 'small' ? (0, _styledComponents.css)(["width:", "px;"], _designTokens.spacing.base * 3.3) : (0, _styledComponents.css)(["width:", "px;"], _designTokens.spacing.base * 4.1);
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
53
|
var SliderContainer = _styledComponents.default.div.withConfig({
|
|
54
54
|
displayName: "Slider__SliderContainer",
|
|
55
55
|
componentId: "egedid-2"
|
|
56
|
-
})(["align-items:center;display:inline-flex;margin:0 ", "px;", ";"], _designTokens.spacing.base, (0, _dynamicModifiers.applyDynamicModifiers)('
|
|
57
|
-
var
|
|
58
|
-
|
|
56
|
+
})(["align-items:center;display:inline-flex;margin:0 ", "px;", ";", ";"], _designTokens.spacing.base, (0, _dynamicModifiers.applyDynamicModifiers)('position', function (_ref4) {
|
|
57
|
+
var position = _ref4.position;
|
|
58
|
+
var fillColor = (0, _rgb.default)(position === 'left' ? _designTokens.color.base.alaskanHusky : _designTokens.color.status.success.medium);
|
|
59
|
+
return (0, _styledComponents.css)(["background:", ";border:thin solid ", ";}"], fillColor, fillColor);
|
|
60
|
+
}), (0, _dynamicModifiers.applyDynamicModifiers)('size', function (_ref5) {
|
|
61
|
+
var size = _ref5.size;
|
|
62
|
+
return size === 'small' ? (0, _styledComponents.css)(["height:", "px;width:", "px;border-radius:", "px;"], _designTokens.spacing.base * 1.8, _designTokens.spacing.base * 3.3, _designTokens.spacing.base * 0.9) : (0, _styledComponents.css)(["border-radius:", "px;height:", "px;width:", "px;"], _designTokens.spacing.base + 1, _designTokens.spacing.base * 2 + 2, _designTokens.spacing.base * 4.1);
|
|
59
63
|
}));
|
|
60
64
|
|
|
61
65
|
exports.SliderContainer = SliderContainer;
|
|
62
66
|
|
|
63
|
-
function Slider(
|
|
64
|
-
var position =
|
|
65
|
-
size =
|
|
67
|
+
function Slider(_ref6) {
|
|
68
|
+
var position = _ref6.position,
|
|
69
|
+
size = _ref6.size;
|
|
66
70
|
return _react.default.createElement(SliderContainer, {
|
|
67
|
-
size: size
|
|
71
|
+
size: size,
|
|
72
|
+
position: position
|
|
68
73
|
}, _react.default.createElement(SliderBar, {
|
|
69
74
|
size: size
|
|
70
75
|
}, _react.default.createElement(SliderSwitch, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAoC,WAAW,EAAE,MAAM,SAAS,CAAC;AAExE,iBAAS,MAAM,CAAC,EACd,eAAe,EACf,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,GAAG,IAAI,EACR,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAoC,WAAW,EAAE,MAAM,SAAS,CAAC;AAExE,iBAAS,MAAM,CAAC,EACd,eAAe,EACf,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,GAAG,IAAI,EACR,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA4D3B;kBAtEQ,MAAM;;;;;;;;AAqFf,eAAe,MAAM,CAAC"}
|
|
@@ -91,7 +91,8 @@ function Toggle(_ref) {
|
|
|
91
91
|
onClick: toggleOption,
|
|
92
92
|
onKeyDown: onKeyDownHandler,
|
|
93
93
|
size: size,
|
|
94
|
-
tabIndex: 0
|
|
94
|
+
tabIndex: 0,
|
|
95
|
+
position: selectedId === (0, _get.default)(options, '0.id') ? 'left' : 'right'
|
|
95
96
|
}), _react.default.createElement(_Flex.default, {
|
|
96
97
|
alignItems: "center"
|
|
97
98
|
}, options.map(function (option, index) {
|
|
@@ -20,7 +20,7 @@ function requiredOptionsValidator(props, propName, componentName) {
|
|
|
20
20
|
_propTypes.default.checkPropTypes({
|
|
21
21
|
options: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
22
22
|
id: _propTypes.default.string.isRequired,
|
|
23
|
-
text: _propTypes.default.string
|
|
23
|
+
text: _propTypes.default.string
|
|
24
24
|
})).isRequired
|
|
25
25
|
}, props, propName, componentName);
|
|
26
26
|
|
|
@@ -18,7 +18,7 @@ schema.propTypes = {
|
|
|
18
18
|
onChange: _reactDesc.PropTypes.func.description('A function called when the toggle is switched. It is called with the ID of the newly selected option'),
|
|
19
19
|
options: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
|
|
20
20
|
id: _reactDesc.PropTypes.string.description('The ID of the option').isRequired,
|
|
21
|
-
text: _reactDesc.PropTypes.string.description('The label that will be displayed for the option')
|
|
21
|
+
text: _reactDesc.PropTypes.string.description('The label that will be displayed for the option. Ignore if you want to hide the label.')
|
|
22
22
|
})).description('A two element array where each element represents an option in the Toggle').isRequired,
|
|
23
23
|
readOnly: _reactDesc.PropTypes.bool.description('A boolean controlling whether the Toggle is read only.'),
|
|
24
24
|
selected: _reactDesc.PropTypes.string.description('The ID of the option that is selected. If provided, controlling the Toggle must be handled externally. Overrides `defaultSelected`.'),
|
|
@@ -3,7 +3,7 @@ import { PProps } from '../Typography';
|
|
|
3
3
|
export interface ToggleProps {
|
|
4
4
|
defaultSelected?: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
-
name
|
|
6
|
+
name?: string;
|
|
7
7
|
onChange?: (selectedOptionId: string) => void;
|
|
8
8
|
options: [ToggleOption, ToggleOption];
|
|
9
9
|
readOnly?: boolean;
|
|
@@ -16,7 +16,7 @@ export interface ToggleOption {
|
|
|
16
16
|
}
|
|
17
17
|
export interface OptionProps extends ToggleOption {
|
|
18
18
|
checked?: boolean;
|
|
19
|
-
name
|
|
19
|
+
name?: string;
|
|
20
20
|
size?: ToggleProps['size'];
|
|
21
21
|
}
|
|
22
22
|
export interface SliderProps {
|
|
@@ -27,6 +27,7 @@ export interface LabelProps extends PProps, React.LabelHTMLAttributes<HTMLLabelE
|
|
|
27
27
|
color?: PProps['color'];
|
|
28
28
|
}
|
|
29
29
|
export interface FieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
30
|
+
position: SliderProps['position'];
|
|
30
31
|
disabled?: ToggleProps['disabled'];
|
|
31
32
|
readOnly?: ToggleProps['readOnly'];
|
|
32
33
|
size?: ToggleProps['size'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,WAAW,WAAW;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,WAAW,WAAW;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,UACf,SAAQ,MAAM,EACZ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACzB;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC;IACzD,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decisiv/ui-components",
|
|
3
|
-
"version": "2.0.1-alpha.
|
|
3
|
+
"version": "2.0.1-alpha.153+fdfeff9",
|
|
4
4
|
"description": "Decisiv's design system React components",
|
|
5
5
|
"author": "Decisiv UI Development Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
73
|
"private": false,
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "fdfeff9d0d658c0051ac784160b9ca069a6e59cf"
|
|
75
75
|
}
|