@decisiv/ui-components 2.0.1-alpha.185 → 2.0.1-alpha.187
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/HelpMessage.d.ts +1 -1
- package/lib/atoms/InputField/HelpMessage.d.ts.map +1 -1
- package/lib/atoms/InputField/HelpMessage.js +2 -1
- package/lib/atoms/InputField/index.d.ts +1 -0
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +3 -2
- package/lib/components/Badge/types.d.ts +1 -1
- package/lib/components/Button/StyledButton.d.ts +3 -8
- package/lib/components/Button/StyledButton.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.js +2 -2
- package/lib/components/Button/index.js +1 -1
- package/lib/components/Link/styles.d.ts +1 -1
- package/lib/components/Modal/Manager.d.ts +6 -0
- package/lib/components/Modal/Manager.d.ts.map +1 -0
- package/lib/components/Modal/Manager.js +53 -0
- package/lib/components/Modal/ResponsiveModalWrapper.d.ts +12 -0
- package/lib/components/Modal/ResponsiveModalWrapper.d.ts.map +1 -0
- package/lib/components/Modal/ResponsiveModalWrapper.js +79 -0
- package/lib/components/Modal/components.d.ts +1 -0
- package/lib/components/Modal/components.d.ts.map +1 -1
- package/lib/components/Modal/components.js +2 -2
- package/lib/components/Modal/index.d.ts +8 -4
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/index.js +33 -81
- package/lib/components/Popover/Arrow.d.ts +2 -2
- package/lib/components/SearchInput/index.d.ts +1 -1
- package/lib/components/SearchInput/index.d.ts.map +1 -1
- package/lib/components/SearchInput/index.js +56 -75
- package/lib/components/SearchInput/index.test.js +183 -0
- package/lib/components/SearchInput/schema.d.ts.map +1 -1
- package/lib/components/SearchInput/schema.js +12 -1
- package/lib/components/SearchInput/styles.d.ts +1176 -0
- package/lib/components/SearchInput/styles.d.ts.map +1 -0
- package/lib/components/SearchInput/styles.js +97 -0
- package/lib/components/SearchInput/types.d.ts +9 -1
- package/lib/components/SearchInput/types.d.ts.map +1 -1
- package/lib/components/Tag/propTypes.d.ts +1 -1
- package/lib/components/Wizard/index.d.ts +24 -0
- package/lib/components/Wizard/index.d.ts.map +1 -0
- package/lib/components/Wizard/index.js +142 -0
- package/lib/components/Wizard/index.test.js +591 -0
- package/lib/components/Wizard/schema.d.ts +3 -0
- package/lib/components/Wizard/schema.d.ts.map +1 -0
- package/lib/components/Wizard/schema.js +37 -0
- package/lib/components/Wizard/styles.d.ts +989 -0
- package/lib/components/Wizard/styles.d.ts.map +1 -0
- package/lib/components/Wizard/styles.js +79 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +24 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts +9 -0
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +10 -1
- package/lib/utils/commonUIColors.d.ts +2 -2
- package/lib/utils/commonUIColors.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ export interface HelpMessageProps {
|
|
|
4
4
|
helpMessage?: string;
|
|
5
5
|
maxLength?: number;
|
|
6
6
|
showCharacterCount?: boolean;
|
|
7
|
-
contentLength
|
|
7
|
+
contentLength?: number;
|
|
8
8
|
}
|
|
9
9
|
declare function HelpMessage(props: HelpMessageProps): JSX.Element | null;
|
|
10
10
|
declare namespace HelpMessage {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpMessage.d.ts","sourceRoot":"","sources":["../../../src/atoms/InputField/HelpMessage.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AASnC,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"HelpMessage.d.ts","sourceRoot":"","sources":["../../../src/atoms/InputField/HelpMessage.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AASnC,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA6BhE;kBA7BQ,WAAW;;;;;;;;;;;;;;AA8CpB,eAAe,WAAW,CAAC"}
|
|
@@ -28,7 +28,8 @@ function HelpMessage(props) {
|
|
|
28
28
|
var helpMessage = props.helpMessage,
|
|
29
29
|
maxLength = props.maxLength,
|
|
30
30
|
showCharacterCount = props.showCharacterCount,
|
|
31
|
-
contentLength = props.contentLength
|
|
31
|
+
_props$contentLength = props.contentLength,
|
|
32
|
+
contentLength = _props$contentLength === void 0 ? 0 : _props$contentLength;
|
|
32
33
|
var translate = (0, _useTranslations.default)();
|
|
33
34
|
var showCount = Boolean(maxLength && showCharacterCount); // You have {remaining} characters left ({max} max).
|
|
34
35
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/InputField/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,aAAa,EAEb,GAAG,EACH,sBAAsB,EAGvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAoB5C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAA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E,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA4KD,QAAA,MAAM,iBAAiB,EAAE,sBAAsB,CAC7C,GAAG,CAAC,GAAG,CAAC,EACR,mBAAmB,CACK,CAAC;AAQ3B,eAAe,iBAAiB,CAAC"}
|
|
@@ -85,11 +85,12 @@ function InputField(props, targetRef) {
|
|
|
85
85
|
style = props.style,
|
|
86
86
|
value = props.value,
|
|
87
87
|
warningMessage = props.warningMessage,
|
|
88
|
+
withWarningIntent = props.withWarningIntent,
|
|
88
89
|
_props$isTextArea = props.isTextArea,
|
|
89
90
|
isTextArea = _props$isTextArea === void 0 ? false : _props$isTextArea,
|
|
90
91
|
_props$multiple = props.multiple,
|
|
91
92
|
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
|
92
|
-
rest = _objectWithoutProperties(props, ["children", "cursor", "disabled", "hideLabel", "helpMessage", "icon", "secondaryElement", "id", "inputContainerRef", "label", "labelId", "maxLength", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "overflow", "readOnly", "required", "requiredMessage", "showCharacterCount", "style", "value", "warningMessage", "isTextArea", "multiple"]);
|
|
93
|
+
rest = _objectWithoutProperties(props, ["children", "cursor", "disabled", "hideLabel", "helpMessage", "icon", "secondaryElement", "id", "inputContainerRef", "label", "labelId", "maxLength", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "overflow", "readOnly", "required", "requiredMessage", "showCharacterCount", "style", "value", "warningMessage", "withWarningIntent", "isTextArea", "multiple"]);
|
|
93
94
|
|
|
94
95
|
var fallbackTargetRef = (0, _react.useRef)(null);
|
|
95
96
|
var finalTargetRef = targetRef || fallbackTargetRef;
|
|
@@ -160,7 +161,7 @@ function InputField(props, targetRef) {
|
|
|
160
161
|
cursor: cursor,
|
|
161
162
|
hiddenLabel: hideLabel,
|
|
162
163
|
disabled: disabled,
|
|
163
|
-
hasWarning: !!warningMessage,
|
|
164
|
+
hasWarning: !!warningMessage || withWarningIntent,
|
|
164
165
|
isFocused: isFocused,
|
|
165
166
|
readOnly: readOnly,
|
|
166
167
|
ref: inputContainerRef,
|
|
@@ -14,7 +14,7 @@ export interface BadgeProps {
|
|
|
14
14
|
}
|
|
15
15
|
declare function variantValidator(props: BadgeProps, propName: 'variant', componentName: 'Badge'): Error | null;
|
|
16
16
|
export declare const propTypes: {
|
|
17
|
-
color: PropTypes.Requireable<
|
|
17
|
+
color: PropTypes.Requireable<CommonUIColorKeys>;
|
|
18
18
|
icon: PropTypes.Validator<PropTypes.ReactComponentLike>;
|
|
19
19
|
size: PropTypes.Requireable<string>;
|
|
20
20
|
variant: typeof variantValidator;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface StyledButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
|
|
4
|
-
|
|
5
|
-
kind?: Kind;
|
|
6
|
-
minWidth?: string;
|
|
7
|
-
size: Size;
|
|
8
|
-
variant?: Variant;
|
|
9
|
-
loading?: boolean;
|
|
2
|
+
import { ButtonProps } from './types';
|
|
3
|
+
export interface StyledButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonProps {
|
|
4
|
+
$loading?: ButtonProps['loading'];
|
|
10
5
|
}
|
|
11
6
|
declare const StyledButton: import("styled-components").StyledComponent<"button", any, StyledButtonProps, never>;
|
|
12
7
|
export default StyledButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/StyledButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,OAAO,
|
|
1
|
+
{"version":3,"file":"StyledButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/StyledButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,OAAO,EAAQ,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,WAAW;IACb,QAAQ,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACnC;AA6LD,QAAA,MAAM,YAAY,sFAkBjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -85,9 +85,9 @@ var buttonSizeModifier = function buttonSizeModifier(_ref) {
|
|
|
85
85
|
|
|
86
86
|
var disabledStyles = function disabledStyles(_ref2) {
|
|
87
87
|
var variant = _ref2.variant,
|
|
88
|
-
loading = _ref2
|
|
88
|
+
$loading = _ref2.$loading;
|
|
89
89
|
|
|
90
|
-
if (loading) {
|
|
90
|
+
if ($loading) {
|
|
91
91
|
if (variant === 'ghost') {
|
|
92
92
|
return (0, _styledComponents.css)(["&:disabled:disabled{border-color:transparent;color:", ";cursor:not-allowed;}"], _colors.interactionSecondaryLight);
|
|
93
93
|
}
|
|
@@ -8,7 +8,7 @@ export declare const fontSize: (p: {
|
|
|
8
8
|
size?: import("../../atoms/OptionsList/types").Size;
|
|
9
9
|
}) => SimpleInterpolation;
|
|
10
10
|
export declare const IconContainer: import("styled-components").StyledComponent<"span", any, {
|
|
11
|
-
position: "
|
|
11
|
+
position: import("../Button").IconPosition;
|
|
12
12
|
withText: boolean;
|
|
13
13
|
}, never>;
|
|
14
14
|
export declare const sharedLinkStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { ModalProps } from './types';
|
|
3
|
+
declare type ManagerProps = Pick<ModalProps, 'onClose' | 'visible'>;
|
|
4
|
+
declare function Manager({ onClose, visible, children, }: PropsWithChildren<ManagerProps>): React.ReactPortal | null;
|
|
5
|
+
export default Manager;
|
|
6
|
+
//# sourceMappingURL=Manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Manager.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Manager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA0B,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIzE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,aAAK,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;AAE5D,iBAAS,OAAO,CAAC,EACf,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CA+B5D;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _ConfigProvider = require("../../providers/ConfigProvider");
|
|
11
|
+
|
|
12
|
+
var _canUseDOM = _interopRequireDefault(require("../../utils/canUseDOM"));
|
|
13
|
+
|
|
14
|
+
var _utils = require("./utils");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function Manager(_ref) {
|
|
19
|
+
var onClose = _ref.onClose,
|
|
20
|
+
visible = _ref.visible,
|
|
21
|
+
children = _ref.children;
|
|
22
|
+
(0, _utils.useReturnFocus)(!visible);
|
|
23
|
+
|
|
24
|
+
var _useConfig = (0, _ConfigProvider.useConfig)(),
|
|
25
|
+
createPortal = _useConfig.createPortal;
|
|
26
|
+
|
|
27
|
+
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
28
|
+
if (event.key === 'Escape') {
|
|
29
|
+
onClose && onClose(event);
|
|
30
|
+
}
|
|
31
|
+
}, [onClose]); // Allow closing the modal by pressing the Escape key
|
|
32
|
+
|
|
33
|
+
(0, _react.useEffect)(function () {
|
|
34
|
+
if (visible && _canUseDOM.default) {
|
|
35
|
+
document.addEventListener('keydown', onKeyDown);
|
|
36
|
+
return function () {
|
|
37
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
38
|
+
};
|
|
39
|
+
} // eslint has issues with no return statement here...
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
return undefined;
|
|
43
|
+
}, [visible, onKeyDown]);
|
|
44
|
+
|
|
45
|
+
if (visible) {
|
|
46
|
+
return createPortal(children);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
var _default = Manager;
|
|
53
|
+
exports.default = _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { sizes } from '@decisiv/breakpoint-observer';
|
|
3
|
+
import { ModalProps } from './types';
|
|
4
|
+
import { WizardProps } from '../Wizard';
|
|
5
|
+
declare type Props = Pick<ModalProps, 'id' | 'onClose' | 'zIndex'> & {
|
|
6
|
+
size?: WizardProps['size'];
|
|
7
|
+
breakpoint: keyof typeof sizes | undefined;
|
|
8
|
+
observedElementRef: RefObject<HTMLDivElement>;
|
|
9
|
+
};
|
|
10
|
+
declare const ResponsiveModalWrapper: ({ children, breakpoint, id, size, onClose, zIndex, observedElementRef, }: React.PropsWithChildren<Props>) => JSX.Element;
|
|
11
|
+
export default ResponsiveModalWrapper;
|
|
12
|
+
//# sourceMappingURL=ResponsiveModalWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponsiveModalWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ResponsiveModalWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkC,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,aAAK,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG;IAC3D,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,UAAU,EAAE,MAAM,OAAO,KAAK,GAAG,SAAS,CAAC;IAC3C,kBAAkB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CAC/C,CAAC;AAEF,QAAA,MAAM,sBAAsB,2HA0D3B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _components = require("./components");
|
|
11
|
+
|
|
12
|
+
var _useUniqueId = _interopRequireDefault(require("../../utils/useUniqueId"));
|
|
13
|
+
|
|
14
|
+
var _utils = require("./utils");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
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; } }
|
|
19
|
+
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
21
|
+
|
|
22
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
23
|
+
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
25
|
+
|
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
|
|
28
|
+
var ResponsiveModalWrapper = function ResponsiveModalWrapper(_ref) {
|
|
29
|
+
var children = _ref.children,
|
|
30
|
+
breakpoint = _ref.breakpoint,
|
|
31
|
+
id = _ref.id,
|
|
32
|
+
_ref$size = _ref.size,
|
|
33
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
34
|
+
onClose = _ref.onClose,
|
|
35
|
+
_ref$zIndex = _ref.zIndex,
|
|
36
|
+
zIndex = _ref$zIndex === void 0 ? 100 : _ref$zIndex,
|
|
37
|
+
observedElementRef = _ref.observedElementRef;
|
|
38
|
+
// Any click within the overlay should stay within the overlay. This click event should close
|
|
39
|
+
// the modal, but not bubble up to any parent elements.
|
|
40
|
+
var handleOverlayClick = (0, _react.useCallback)(function (event) {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
onClose && onClose(event);
|
|
44
|
+
}, [onClose]); // Any click within the body should stay within the body. This prevents the click event from
|
|
45
|
+
// bubbling up and firing the onClose handler via the Overlay's onClick.
|
|
46
|
+
|
|
47
|
+
var handleBodyClick = (0, _react.useCallback)(function (event) {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
event.stopPropagation();
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
var _useElement = (0, _utils.useElement)(),
|
|
53
|
+
_useElement2 = _slicedToArray(_useElement, 2),
|
|
54
|
+
container = _useElement2[0],
|
|
55
|
+
containerRef = _useElement2[1];
|
|
56
|
+
|
|
57
|
+
(0, _utils.useKeepFocusWithin)(container);
|
|
58
|
+
var uuid = (0, _useUniqueId.default)(id, 'modal-');
|
|
59
|
+
var modalHeaderId = "modal-header-".concat(uuid);
|
|
60
|
+
var modalContentId = "modal-content-".concat(uuid);
|
|
61
|
+
return _react.default.createElement(_components.Overlay, {
|
|
62
|
+
onClick: handleOverlayClick,
|
|
63
|
+
ref: observedElementRef,
|
|
64
|
+
zIndex: zIndex
|
|
65
|
+
}, _react.default.createElement(_components.Body, {
|
|
66
|
+
widthSize: size,
|
|
67
|
+
"aria-describedby": modalContentId,
|
|
68
|
+
"aria-labelledby": modalHeaderId,
|
|
69
|
+
"aria-modal": "true",
|
|
70
|
+
size: breakpoint,
|
|
71
|
+
id: uuid,
|
|
72
|
+
onClick: handleBodyClick,
|
|
73
|
+
ref: containerRef,
|
|
74
|
+
role: "dialog"
|
|
75
|
+
}, children));
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var _default = ResponsiveModalWrapper;
|
|
79
|
+
exports.default = _default;
|
|
@@ -4,6 +4,7 @@ export declare const Overlay: import("styled-components").StyledComponent<"div",
|
|
|
4
4
|
}, never>;
|
|
5
5
|
export declare const Body: import("styled-components").StyledComponent<"div", any, {
|
|
6
6
|
size?: "XS" | "SM" | "MD" | "LG" | "XL" | undefined;
|
|
7
|
+
widthSize: "normal" | "extraLarge" | undefined;
|
|
7
8
|
}, never>;
|
|
8
9
|
export declare const ScrollYBox: import("styled-components").StyledComponent<"div", any, {
|
|
9
10
|
size?: "XS" | "SM" | "MD" | "LG" | "XL" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/components.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/components.tsx"],"names":[],"mappings":";AAaA,eAAO,MAAM,OAAO;;SASnB,CAAC;AAEF,eAAO,MAAM,IAAI;;;SAuChB,CAAC;AAEF,eAAO,MAAM,UAAU;;SAgBtB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAoD,CAAC;AAExE,eAAO,MAAM,oBAAoB,oEAIhC,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAKnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoBlB,CAAC;AAEF,eAAO,MAAM,aAAa,sGAkBzB,CAAC"}
|
|
@@ -35,14 +35,14 @@ exports.Overlay = Overlay;
|
|
|
35
35
|
var Body = _styledComponents.default.div.withConfig({
|
|
36
36
|
displayName: "components__Body",
|
|
37
37
|
componentId: "zcog99-1"
|
|
38
|
-
})(["background:", ";border-radius:2px;box-shadow:0 1px 4px ", ";margin:40px auto;max-height:calc(100% - 80px);max-width:650px;overflow:hidden;padding-bottom:75px;position:relative;width:100%;", ";"], (0, _toColorString.default)(_designTokens.color.base.snowWhite), (0, _toColorString.default)(_designTokens.color.shadow.light.default), (0, _styleModifiers.when)('size', _breakpointObserver.sizes.XS, (0, _styledComponents.css)(["border-radius:0;bottom:0;left:0;margin:0;max-height:100%;overflow:hidden;position:fixed;right:0;top:0;"])));
|
|
38
|
+
})(["background:", ";border-radius:2px;box-shadow:0 1px 4px ", ";margin:40px auto;max-height:calc(100% - 80px);max-width:650px;overflow:hidden;padding-bottom:75px;position:relative;width:100%;", ";", ""], (0, _toColorString.default)(_designTokens.color.base.snowWhite), (0, _toColorString.default)(_designTokens.color.shadow.light.default), (0, _styleModifiers.when)('size', _breakpointObserver.sizes.XS, (0, _styledComponents.css)(["border-radius:0;bottom:0;left:0;margin:0;max-height:100%;overflow:hidden;position:fixed;right:0;top:0;padding-bottom:0;"])), (0, _styleModifiers.when)('widthSize', 'extraLarge', (0, _styledComponents.css)(["max-width:", ";"], (0, _rem.default)(_designTokens.spacing.base * 90))));
|
|
39
39
|
|
|
40
40
|
exports.Body = Body;
|
|
41
41
|
|
|
42
42
|
var ScrollYBox = _styledComponents.default.div.withConfig({
|
|
43
43
|
displayName: "components__ScrollYBox",
|
|
44
44
|
componentId: "zcog99-2"
|
|
45
|
-
})(["overflow-y:auto;position:relative;height:100%;max-height:calc(100vh - 150px);", ";"], (0, _styleModifiers.when)('size', _breakpointObserver.sizes.XS, (0, _styledComponents.css)(["max-height:calc(100vh - 70px);"])));
|
|
45
|
+
})(["width:100%;overflow-y:auto;position:relative;height:100%;max-height:calc(100vh - 150px);", ";"], (0, _styleModifiers.when)('size', _breakpointObserver.sizes.XS, (0, _styledComponents.css)(["max-height:calc(100vh - 70px);"])));
|
|
46
46
|
|
|
47
47
|
exports.ScrollYBox = ScrollYBox;
|
|
48
48
|
var Header = (0, _styledComponents.default)(_Flex.default).attrs({
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ModalProps } from './types';
|
|
3
|
-
declare function
|
|
4
|
-
declare namespace
|
|
3
|
+
declare function ModalWrapper({ onClose, visible, children, ...rest }: ModalProps): JSX.Element;
|
|
4
|
+
declare namespace ModalWrapper {
|
|
5
5
|
var propTypes: any;
|
|
6
|
+
var defaultProps: {
|
|
7
|
+
actions: undefined;
|
|
8
|
+
icon: undefined;
|
|
9
|
+
};
|
|
6
10
|
var displayName: string;
|
|
7
11
|
}
|
|
8
|
-
export default
|
|
12
|
+
export default ModalWrapper;
|
|
9
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":";AA+BA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA2HrC,iBAAS,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,eAQxE;kBARQ,YAAY;;;;;;;;AAwBrB,eAAe,YAAY,CAAC"}
|
|
@@ -5,25 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
11
|
-
|
|
12
|
-
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
9
|
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
11
|
|
|
16
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
12
|
var _breakpointObserver = require("@decisiv/breakpoint-observer");
|
|
19
13
|
|
|
20
14
|
var _designTokens = require("@decisiv/design-tokens");
|
|
21
15
|
|
|
22
16
|
var _Times = _interopRequireDefault(require("@decisiv/iconix/lib/components/Times"));
|
|
23
17
|
|
|
24
|
-
var
|
|
18
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
25
19
|
|
|
26
|
-
var
|
|
20
|
+
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
21
|
+
|
|
22
|
+
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
27
23
|
|
|
28
24
|
var _commonUIColors = require("../../utils/commonUIColors");
|
|
29
25
|
|
|
@@ -43,16 +39,18 @@ var _components = require("./components");
|
|
|
43
39
|
|
|
44
40
|
var _constants = require("./constants");
|
|
45
41
|
|
|
42
|
+
var _Manager = _interopRequireDefault(require("./Manager"));
|
|
43
|
+
|
|
46
44
|
var _proptypeValidators = require("./proptypeValidators");
|
|
47
45
|
|
|
46
|
+
var _ResponsiveModalWrapper = _interopRequireDefault(require("./ResponsiveModalWrapper"));
|
|
47
|
+
|
|
48
48
|
var _schema = _interopRequireDefault(require("./schema"));
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
51
|
|
|
52
52
|
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; } }
|
|
53
53
|
|
|
54
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
55
|
-
|
|
56
54
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
57
55
|
|
|
58
56
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -113,43 +111,16 @@ function Modal(_ref) {
|
|
|
113
111
|
|
|
114
112
|
return null;
|
|
115
113
|
}, [colorProp, icon, intent]);
|
|
116
|
-
|
|
117
|
-
var _useElement = (0, _utils.useElement)(),
|
|
118
|
-
_useElement2 = _slicedToArray(_useElement, 2),
|
|
119
|
-
container = _useElement2[0],
|
|
120
|
-
containerRef = _useElement2[1];
|
|
121
|
-
|
|
122
|
-
(0, _utils.useKeepFocusWithin)(container);
|
|
123
114
|
var uuid = (0, _useUniqueId.default)(id, 'modal-');
|
|
124
115
|
var modalHeaderId = "modal-header-".concat(uuid);
|
|
125
116
|
var modalContentId = "modal-content-".concat(uuid);
|
|
126
|
-
var modalFooterId = "modal-footer-".concat(uuid);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}, [onClose]); // Any click within the body should stay within the body. This prevents the click event from
|
|
134
|
-
// bubbling up and firing the onClose handler via the Overlay's onClick.
|
|
135
|
-
|
|
136
|
-
var handleBodyClick = (0, _react.useCallback)(function (event) {
|
|
137
|
-
event.preventDefault();
|
|
138
|
-
event.stopPropagation();
|
|
139
|
-
}, []);
|
|
140
|
-
return _react.default.createElement(_components.Overlay, {
|
|
141
|
-
onClick: handleOverlayClick,
|
|
142
|
-
ref: observedElementRef,
|
|
143
|
-
zIndex: zIndex
|
|
144
|
-
}, _react.default.createElement(_components.Body, {
|
|
145
|
-
"aria-describedby": modalContentId,
|
|
146
|
-
"aria-labelledby": modalHeaderId,
|
|
147
|
-
"aria-modal": "true",
|
|
148
|
-
size: breakpoint,
|
|
149
|
-
id: uuid,
|
|
150
|
-
onClick: handleBodyClick,
|
|
151
|
-
ref: containerRef,
|
|
152
|
-
role: "dialog"
|
|
117
|
+
var modalFooterId = "modal-footer-".concat(uuid);
|
|
118
|
+
return _react.default.createElement(_ResponsiveModalWrapper.default, {
|
|
119
|
+
id: id,
|
|
120
|
+
zIndex: zIndex,
|
|
121
|
+
onClose: onClose,
|
|
122
|
+
breakpoint: breakpoint,
|
|
123
|
+
observedElementRef: observedElementRef
|
|
153
124
|
}, _react.default.createElement(_components.ScrollYBox, {
|
|
154
125
|
size: breakpoint
|
|
155
126
|
}, _react.default.createElement(_components.Header, {
|
|
@@ -187,52 +158,33 @@ function Modal(_ref) {
|
|
|
187
158
|
marginRight: 0.5,
|
|
188
159
|
size: breakpoint
|
|
189
160
|
}, _react.default.createElement(_Button.default, _extends({}, (0, _omit.default)(action, ['kind', 'size', 'variant']), actionProps[index])));
|
|
190
|
-
})))
|
|
161
|
+
})));
|
|
191
162
|
}
|
|
192
163
|
|
|
193
|
-
function
|
|
164
|
+
function ModalWrapper(_ref8) {
|
|
194
165
|
var onClose = _ref8.onClose,
|
|
195
166
|
visible = _ref8.visible,
|
|
196
167
|
children = _ref8.children,
|
|
197
168
|
rest = _objectWithoutProperties(_ref8, ["onClose", "visible", "children"]);
|
|
198
169
|
|
|
199
|
-
(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
onClose && onClose(event);
|
|
207
|
-
}
|
|
208
|
-
}, [onClose]); // Allow closing the modal by pressing the Escape key
|
|
209
|
-
|
|
210
|
-
(0, _react.useEffect)(function () {
|
|
211
|
-
if (visible && _canUseDOM.default) {
|
|
212
|
-
document.addEventListener('keydown', onKeyDown);
|
|
213
|
-
return function () {
|
|
214
|
-
document.removeEventListener('keydown', onKeyDown);
|
|
215
|
-
};
|
|
216
|
-
} // eslint has issues with no return statement here...
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return undefined;
|
|
220
|
-
}, [visible, onKeyDown]);
|
|
221
|
-
|
|
222
|
-
if (visible) {
|
|
223
|
-
return createPortal(_react.default.createElement(Modal, _extends({
|
|
224
|
-
onClose: onClose
|
|
225
|
-
}, rest), children));
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return null;
|
|
170
|
+
return _react.default.createElement(_Manager.default, {
|
|
171
|
+
onClose: onClose,
|
|
172
|
+
visible: visible
|
|
173
|
+
}, _react.default.createElement(Modal, _extends({
|
|
174
|
+
onClose: onClose,
|
|
175
|
+
visible: visible
|
|
176
|
+
}, rest), children));
|
|
229
177
|
} // @ts-ignore
|
|
230
178
|
|
|
231
179
|
|
|
232
|
-
|
|
180
|
+
ModalWrapper.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
233
181
|
actions: _proptypeValidators.actionsValidator,
|
|
234
182
|
icon: _propTypes.default.elementType
|
|
235
183
|
});
|
|
236
|
-
|
|
237
|
-
|
|
184
|
+
ModalWrapper.defaultProps = {
|
|
185
|
+
actions: undefined,
|
|
186
|
+
icon: undefined
|
|
187
|
+
};
|
|
188
|
+
ModalWrapper.displayName = 'Modal';
|
|
189
|
+
var _default = ModalWrapper;
|
|
238
190
|
exports.default = _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ArrowProps } from './types';
|
|
2
2
|
export declare const arrowColors: {
|
|
3
|
-
|
|
3
|
+
danger: import("@decisiv/design-tokens/lib/color").Color;
|
|
4
4
|
success: import("@decisiv/design-tokens/lib/color").Color;
|
|
5
|
+
information: import("@decisiv/design-tokens/lib/color").Color;
|
|
5
6
|
warning: import("@decisiv/design-tokens/lib/color").Color;
|
|
6
|
-
danger: import("@decisiv/design-tokens/lib/color").Color;
|
|
7
7
|
berryCrisp: import("@decisiv/design-tokens/lib/color").Color;
|
|
8
8
|
koolaidCake: import("@decisiv/design-tokens/lib/color").Color;
|
|
9
9
|
cookieMonster: import("@decisiv/design-tokens/lib/color").Color;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SearchInputProps, SearchItem, StyledFlexProps } from './types';
|
|
3
|
-
declare function SearchInput({ onSearch, value, onChange, size, disabled, searchDisabled, searchOn, ...props }: SearchInputProps): JSX.Element;
|
|
3
|
+
declare function SearchInput({ onSearch, value, onChange, size, disabled, searchDisabled, searchOn, searchByOptions, searchByLabel, searchByValue, searchByName, searchByDefaultValue, searchByWidth, onSearchByChange, warningMessage, helpMessage, ...props }: SearchInputProps): JSX.Element;
|
|
4
4
|
declare namespace SearchInput {
|
|
5
5
|
var defaultProps: {
|
|
6
6
|
size: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/index.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAiBxE,iBAAwB,WAAW,CAAC,EAClC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,QAAmB,EACnB,eAAoB,EACpB,aAAkB,EAClB,aAAa,EACb,YAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAsIhC;kBAxJuB,WAAW;;;;;eAAX,WAAW;AA8JnC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC"}
|