@elliemae/ds-form-layout-blocks 1.57.1-rc.0 → 2.0.0-alpha.11
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/cjs/form-layout-block-item/DSFormLayoutBlockItem.js +30 -35
- package/cjs/form-layout-block-item/index.d.js +0 -1
- package/cjs/form-layout-block-item/index.js +3 -10
- package/cjs/form-layout-block-item/propTypes.js +2 -3
- package/cjs/form-layout-block-item/styles.js +37 -49
- package/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +14 -17
- package/cjs/form-layout-checkbox-group/config/useValidateProps.js +6 -9
- package/cjs/form-layout-checkbox-group/defaultProps.js +1 -2
- package/cjs/form-layout-checkbox-group/index.d.js +0 -1
- package/cjs/form-layout-checkbox-group/index.js +3 -13
- package/cjs/form-layout-checkbox-group/propTypes.js +1 -2
- package/cjs/form-layout-checkbox-group/styles.js +15 -22
- package/cjs/index.d.js +0 -1
- package/cjs/index.js +6 -19
- package/esm/form-layout-block-item/DSFormLayoutBlockItem.js +27 -32
- package/esm/form-layout-block-item/index.d.js +0 -1
- package/esm/form-layout-block-item/index.js +0 -7
- package/esm/form-layout-block-item/propTypes.js +2 -3
- package/esm/form-layout-block-item/styles.js +37 -49
- package/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +7 -10
- package/esm/form-layout-checkbox-group/config/useValidateProps.js +5 -7
- package/esm/form-layout-checkbox-group/defaultProps.js +1 -2
- package/esm/form-layout-checkbox-group/index.d.js +0 -1
- package/esm/form-layout-checkbox-group/index.js +0 -10
- package/esm/form-layout-checkbox-group/propTypes.js +1 -2
- package/esm/form-layout-checkbox-group/styles.js +15 -22
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -13
- package/package.json +68 -11
- package/types/form-layout-block-item/DSFormLayoutBlockItem.d.ts +22 -0
- package/types/form-layout-block-item/index.d.d.ts +35 -0
- package/types/form-layout-block-item/index.d.ts +1 -0
- package/types/form-layout-block-item/propTypes.d.ts +15 -0
- package/types/form-layout-block-item/styles.d.ts +6 -0
- package/types/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.d.ts +10 -0
- package/types/form-layout-checkbox-group/config/useValidateProps.d.ts +2 -0
- package/types/form-layout-checkbox-group/defaultProps.d.ts +3 -0
- package/types/form-layout-checkbox-group/index.d.d.ts +10 -0
- package/types/form-layout-checkbox-group/index.d.ts +1 -0
- package/types/form-layout-checkbox-group/propTypes.d.ts +3 -0
- package/types/form-layout-checkbox-group/styles.d.ts +2 -0
- package/types/index.d.ts +2 -0
- package/cjs/form-layout-block-item/DSFormLayoutBlockItem.js.map +0 -1
- package/cjs/form-layout-block-item/index.d.js.map +0 -1
- package/cjs/form-layout-block-item/index.js.map +0 -1
- package/cjs/form-layout-block-item/propTypes.js.map +0 -1
- package/cjs/form-layout-block-item/styles.js.map +0 -1
- package/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +0 -1
- package/cjs/form-layout-checkbox-group/config/useValidateProps.js.map +0 -1
- package/cjs/form-layout-checkbox-group/defaultProps.js.map +0 -1
- package/cjs/form-layout-checkbox-group/index.d.js.map +0 -1
- package/cjs/form-layout-checkbox-group/index.js.map +0 -1
- package/cjs/form-layout-checkbox-group/propTypes.js.map +0 -1
- package/cjs/form-layout-checkbox-group/styles.js.map +0 -1
- package/cjs/index.d.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/esm/form-layout-block-item/DSFormLayoutBlockItem.js.map +0 -1
- package/esm/form-layout-block-item/index.d.js.map +0 -1
- package/esm/form-layout-block-item/index.js.map +0 -1
- package/esm/form-layout-block-item/propTypes.js.map +0 -1
- package/esm/form-layout-block-item/styles.js.map +0 -1
- package/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +0 -1
- package/esm/form-layout-checkbox-group/config/useValidateProps.js.map +0 -1
- package/esm/form-layout-checkbox-group/defaultProps.js.map +0 -1
- package/esm/form-layout-checkbox-group/index.d.js.map +0 -1
- package/esm/form-layout-checkbox-group/index.js.map +0 -1
- package/esm/form-layout-checkbox-group/propTypes.js.map +0 -1
- package/esm/form-layout-checkbox-group/styles.js.map +0 -1
- package/esm/index.d.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/form-layout-block-item/DSFormLayoutBlockItem/package.json +0 -10
- package/form-layout-block-item/package.json +0 -10
- package/form-layout-block-item/propTypes/package.json +0 -10
- package/form-layout-block-item/styles/package.json +0 -10
- package/form-layout-checkbox-group/DSFormLayoutCheckboxGroup/package.json +0 -10
- package/form-layout-checkbox-group/config/useValidateProps/package.json +0 -10
- package/form-layout-checkbox-group/defaultProps/package.json +0 -10
- package/form-layout-checkbox-group/package.json +0 -10
- package/form-layout-checkbox-group/propTypes/package.json +0 -10
- package/form-layout-checkbox-group/styles/package.json +0 -10
|
@@ -1,59 +1,47 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
|
4
4
|
componentId: "sc-196zgtg-0"
|
|
5
|
-
})(["position:relative;padding:0;margin:0;display:grid;", " ", ";", " align-items:center;", ""],
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
withHighlight = _ref4.withHighlight;
|
|
18
|
-
return withHighlight ? "\n &::after {\n position: absolute;\n content: '';\n left: -".concat(theme.space.xxs, ";\n top: -").concat(theme.space.xxxs, ";\n z-index: -1;\n width: calc(100% + ").concat(theme.space.xs, ");\n height: calc(100% + ").concat(theme.space.xxs, ");\n background-color: #FEFBEE;\n border : 1px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 1px 3px 0 rgba(0,0,0,0.35);\n }\n &:hover, \n &:focus-within {\n &::after {\n position: absolute;\n content: '';\n left: -").concat(theme.space.xxs, ";\n top: -").concat(theme.space.xxxs, ";\n z-index: -1;\n width: calc(100% + ").concat(theme.space.xs, ");\n height: calc(100% + ").concat(theme.space.xxs, ");\n background-color: #FFF9D3;\n border : 1px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 6px 10px 0 rgba(0,0,0,0.30);\n }\n }\n ") : undefined;
|
|
19
|
-
});
|
|
20
|
-
var StyledLabel = /*#__PURE__*/styled.label.withConfig({
|
|
5
|
+
})(["position:relative;padding:0;margin:0;display:grid;", " ", ";", " align-items:center;", ""], ({
|
|
6
|
+
fitContent
|
|
7
|
+
}) => fitContent ? 'width: fit-content;' : undefined, ({
|
|
8
|
+
isGroup
|
|
9
|
+
}) => isGroup ? 'border: none' : '', ({
|
|
10
|
+
leftLabel,
|
|
11
|
+
hideLabel
|
|
12
|
+
}) => leftLabel && !hideLabel ? 'grid-template-columns: max-content auto;' : undefined, ({
|
|
13
|
+
theme,
|
|
14
|
+
withHighlight
|
|
15
|
+
}) => withHighlight ? "\n &::after {\n position: absolute;\n content: '';\n left: -".concat(theme.space.xxs, ";\n top: -").concat(theme.space.xxxs, ";\n z-index: -1;\n width: calc(100% + ").concat(theme.space.xs, ");\n height: calc(100% + ").concat(theme.space.xxs, ");\n background-color: #FEFBEE;\n border : 1px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 1px 3px 0 rgba(0,0,0,0.35);\n }\n &:hover, \n &:focus-within {\n &::after {\n position: absolute;\n content: '';\n left: -").concat(theme.space.xxs, ";\n top: -").concat(theme.space.xxxs, ";\n z-index: -1;\n width: calc(100% + ").concat(theme.space.xs, ");\n height: calc(100% + ").concat(theme.space.xxs, ");\n background-color: #FFF9D3;\n border : 1px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 6px 10px 0 rgba(0,0,0,0.30);\n }\n }\n ") : undefined);
|
|
16
|
+
const StyledLabel = /*#__PURE__*/styled.label.withConfig({
|
|
21
17
|
componentId: "sc-196zgtg-1"
|
|
22
|
-
})(["display:flex;", " ", ""],
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
var StyledMessage = /*#__PURE__*/styled.div.withConfig({
|
|
18
|
+
})(["display:flex;", " ", ""], ({
|
|
19
|
+
theme,
|
|
20
|
+
leftLabel
|
|
21
|
+
}) => leftLabel ? "padding-right: ".concat(theme.space.xxs, ";") : undefined, ({
|
|
22
|
+
hideLabel
|
|
23
|
+
}) => hideLabel ? "position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n " : undefined);
|
|
24
|
+
const StyledMessage = /*#__PURE__*/styled.div.withConfig({
|
|
31
25
|
componentId: "sc-196zgtg-2"
|
|
32
|
-
})(["font-size:", ";font-style:italic;text-align:right;line-height:15px;height:15px;overflow:hidden;text-overflow:ellipsis;color:", ";", ""],
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return leftLabel && !hideLabel ? 'grid-column: 1/3;' : undefined;
|
|
43
|
-
});
|
|
44
|
-
var StyledMark = /*#__PURE__*/styled.span.withConfig({
|
|
26
|
+
})(["font-size:", ";font-style:italic;text-align:right;line-height:15px;height:15px;overflow:hidden;text-overflow:ellipsis;color:", ";", ""], ({
|
|
27
|
+
theme
|
|
28
|
+
}) => theme.fontSizes.microText[200], ({
|
|
29
|
+
theme,
|
|
30
|
+
hasError
|
|
31
|
+
}) => hasError ? theme.colors.danger[900] : theme.colors.neutral[500], ({
|
|
32
|
+
leftLabel,
|
|
33
|
+
hideLabel
|
|
34
|
+
}) => leftLabel && !hideLabel ? 'grid-column: 1/3;' : undefined);
|
|
35
|
+
const StyledMark = /*#__PURE__*/styled.span.withConfig({
|
|
45
36
|
componentId: "sc-196zgtg-3"
|
|
46
|
-
})(["width:6px;height:6px;border-radius:50%;margin-left:", ";", ""],
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
var ScreenReaderOnly = /*#__PURE__*/styled.div.withConfig({
|
|
37
|
+
})(["width:6px;height:6px;border-radius:50%;margin-left:", ";", ""], ({
|
|
38
|
+
theme
|
|
39
|
+
}) => theme.space.xxxs, ({
|
|
40
|
+
theme,
|
|
41
|
+
required
|
|
42
|
+
}) => required ? "\n background-color: ".concat(theme.colors.danger[900], ";\n ") : "\n border: 1px solid ".concat(theme.colors.brand[600], ";\n "));
|
|
43
|
+
const ScreenReaderOnly = /*#__PURE__*/styled.div.withConfig({
|
|
55
44
|
componentId: "sc-196zgtg-4"
|
|
56
45
|
})(["clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px;"]);
|
|
57
46
|
|
|
58
47
|
export { ScreenReaderOnly, StyledContainer, StyledLabel, StyledMark, StyledMessage };
|
|
59
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
2
3
|
import { describe } from 'react-desc';
|
|
3
4
|
import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';
|
|
4
5
|
import { propTypes } from './propTypes.js';
|
|
5
6
|
import { StyledContainer } from './styles.js';
|
|
6
7
|
import { defaultProps } from './defaultProps.js';
|
|
7
8
|
import { useValidateProps } from './config/useValidateProps.js';
|
|
8
|
-
import 'styled-components';
|
|
9
|
-
import '@babel/runtime/helpers/esm/typeof';
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
const DSFormLayoutCheckboxGroup = props => {
|
|
12
11
|
useValidateProps(props);
|
|
13
|
-
|
|
14
|
-
return /*#__PURE__*/
|
|
12
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
13
|
+
return /*#__PURE__*/_jsx(StyledContainer, {
|
|
15
14
|
direction: propsWithDefault.direction
|
|
16
|
-
}, propsWithDefault.children);
|
|
15
|
+
}, void 0, propsWithDefault.children);
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
var DSFormLayoutCheckboxGroupWithSchema = describe(DSFormLayoutCheckboxGroup);
|
|
18
|
+
const DSFormLayoutCheckboxGroupWithSchema = describe(DSFormLayoutCheckboxGroup);
|
|
21
19
|
DSFormLayoutCheckboxGroupWithSchema.propTypes = propTypes;
|
|
22
20
|
|
|
23
21
|
export { DSFormLayoutCheckboxGroup, DSFormLayoutCheckboxGroupWithSchema };
|
|
24
|
-
//# sourceMappingURL=DSFormLayoutCheckboxGroup.js.map
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import _typeof from '@babel/runtime/helpers/esm/typeof';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
const getVariableType = arg => {
|
|
5
4
|
if (Array.isArray(arg)) return 'array';
|
|
6
5
|
if (arg === null) return 'null';
|
|
7
6
|
if (arg === undefined) return 'undefined';
|
|
8
|
-
return
|
|
7
|
+
return typeof arg;
|
|
9
8
|
};
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
const throwCheckboxGroupDirectionError = invalidProp => {
|
|
12
11
|
throw new Error("You are trying to pass a not valid \"direction\" property value for a checkbox group, please provide a valid type.\n\n Received: ".concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: \"horizontal\" or \"vertical\" (string)\n "));
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
const throwCheckboxGroupChildrenError = () => {
|
|
16
15
|
throw new Error("You are trying to use a checkbox group without any React children, please provide at least one children to use.\n \n Received: (null)\n Expected: React children\n ");
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
const useValidateProps = props => {
|
|
20
19
|
if (props.direction !== undefined && props.direction !== 'vertical' && props.direction !== 'horizontal') {
|
|
21
20
|
throwCheckboxGroupDirectionError(props.direction);
|
|
22
21
|
}
|
|
@@ -27,4 +26,3 @@ var useValidateProps = function useValidateProps(props) {
|
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
export { useValidateProps };
|
|
30
|
-
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -1,11 +1 @@
|
|
|
1
1
|
export { DSFormLayoutCheckboxGroup, DSFormLayoutCheckboxGroupWithSchema } from './DSFormLayoutCheckboxGroup.js';
|
|
2
|
-
import 'react';
|
|
3
|
-
import 'react-desc';
|
|
4
|
-
import '@elliemae/ds-props-helpers';
|
|
5
|
-
import './propTypes.js';
|
|
6
|
-
import './styles.js';
|
|
7
|
-
import 'styled-components';
|
|
8
|
-
import './defaultProps.js';
|
|
9
|
-
import './config/useValidateProps.js';
|
|
10
|
-
import '@babel/runtime/helpers/esm/typeof';
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { PropTypes } from 'react-desc';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const propTypes = {
|
|
4
4
|
direction: PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.')
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export { propTypes };
|
|
8
|
-
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
|
4
4
|
componentId: "sc-1wopk9q-0"
|
|
5
|
-
})(["display:inline-flex;flex-wrap:wrap;flex-direction:", ";margin-left:", ";margin-right:", ";margin-top:", ";& div{padding:0;margin-bottom:", ";}& div:not(:last-child){margin-right:", ";}"],
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return theme.space.xxs;
|
|
20
|
-
}, function (_ref6) {
|
|
21
|
-
var theme = _ref6.theme,
|
|
22
|
-
direction = _ref6.direction;
|
|
23
|
-
return direction === 'horizontal' ? theme.space.s : '0';
|
|
24
|
-
});
|
|
5
|
+
})(["display:inline-flex;flex-wrap:wrap;flex-direction:", ";margin-left:", ";margin-right:", ";margin-top:", ";& div{padding:0;margin-bottom:", ";}& div:not(:last-child){margin-right:", ";}"], ({
|
|
6
|
+
direction
|
|
7
|
+
}) => direction === 'horizontal' ? 'row' : 'column', ({
|
|
8
|
+
theme
|
|
9
|
+
}) => theme.space.xs, ({
|
|
10
|
+
theme
|
|
11
|
+
}) => theme.space.xs, ({
|
|
12
|
+
theme
|
|
13
|
+
}) => theme.space.xxs, ({
|
|
14
|
+
theme
|
|
15
|
+
}) => theme.space.xxs, ({
|
|
16
|
+
theme,
|
|
17
|
+
direction
|
|
18
|
+
}) => direction === 'horizontal' ? theme.space.s : '0');
|
|
25
19
|
|
|
26
20
|
export { StyledContainer };
|
|
27
|
-
//# sourceMappingURL=styles.js.map
|
package/esm/index.d.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
1
|
export { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema } from './form-layout-block-item/DSFormLayoutBlockItem.js';
|
|
2
2
|
export { DSFormLayoutCheckboxGroup, DSFormLayoutCheckboxGroupWithSchema } from './form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import 'react-desc';
|
|
5
|
-
import 'uid';
|
|
6
|
-
import './form-layout-block-item/propTypes.js';
|
|
7
|
-
import './form-layout-block-item/styles.js';
|
|
8
|
-
import 'styled-components';
|
|
9
|
-
import '@elliemae/ds-props-helpers';
|
|
10
|
-
import './form-layout-checkbox-group/propTypes.js';
|
|
11
|
-
import './form-layout-checkbox-group/styles.js';
|
|
12
|
-
import './form-layout-checkbox-group/defaultProps.js';
|
|
13
|
-
import './form-layout-checkbox-group/config/useValidateProps.js';
|
|
14
|
-
import '@babel/runtime/helpers/esm/typeof';
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-layout-blocks",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.11",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"module": "esm/index.js",
|
|
7
|
-
"main": "cjs/index.js",
|
|
5
|
+
"description": "ICE MT - Dimsum - Form Layout",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./form-layout-checkbox-group/styles": {
|
|
15
|
+
"import": "./esm/form-layout-checkbox-group/styles.js",
|
|
16
|
+
"require": "./cjs/form-layout-checkbox-group/styles.js"
|
|
17
|
+
},
|
|
18
|
+
"./form-layout-checkbox-group/propTypes": {
|
|
19
|
+
"import": "./esm/form-layout-checkbox-group/propTypes.js",
|
|
20
|
+
"require": "./cjs/form-layout-checkbox-group/propTypes.js"
|
|
21
|
+
},
|
|
22
|
+
"./form-layout-checkbox-group": {
|
|
23
|
+
"import": "./esm/form-layout-checkbox-group/index.js",
|
|
24
|
+
"require": "./cjs/form-layout-checkbox-group/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./form-layout-checkbox-group/DSFormLayoutCheckboxGroup": {
|
|
27
|
+
"import": "./esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js",
|
|
28
|
+
"require": "./cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js"
|
|
29
|
+
},
|
|
30
|
+
"./form-layout-checkbox-group/defaultProps": {
|
|
31
|
+
"import": "./esm/form-layout-checkbox-group/defaultProps.js",
|
|
32
|
+
"require": "./cjs/form-layout-checkbox-group/defaultProps.js"
|
|
33
|
+
},
|
|
34
|
+
"./form-layout-checkbox-group/config/useValidateProps": {
|
|
35
|
+
"import": "./esm/form-layout-checkbox-group/config/useValidateProps.js",
|
|
36
|
+
"require": "./cjs/form-layout-checkbox-group/config/useValidateProps.js"
|
|
37
|
+
},
|
|
38
|
+
"./form-layout-block-item/styles": {
|
|
39
|
+
"import": "./esm/form-layout-block-item/styles.js",
|
|
40
|
+
"require": "./cjs/form-layout-block-item/styles.js"
|
|
41
|
+
},
|
|
42
|
+
"./form-layout-block-item/propTypes": {
|
|
43
|
+
"import": "./esm/form-layout-block-item/propTypes.js",
|
|
44
|
+
"require": "./cjs/form-layout-block-item/propTypes.js"
|
|
45
|
+
},
|
|
46
|
+
"./form-layout-block-item": {
|
|
47
|
+
"import": "./esm/form-layout-block-item/index.js",
|
|
48
|
+
"require": "./cjs/form-layout-block-item/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./form-layout-block-item/DSFormLayoutBlockItem": {
|
|
51
|
+
"import": "./esm/form-layout-block-item/DSFormLayoutBlockItem.js",
|
|
52
|
+
"require": "./cjs/form-layout-block-item/DSFormLayoutBlockItem.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
8
55
|
"sideEffects": [
|
|
9
56
|
"*.css",
|
|
10
57
|
"*.scss"
|
|
11
58
|
],
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"npm": ">=7",
|
|
65
|
+
"node": ">=14"
|
|
66
|
+
},
|
|
67
|
+
"author": "ICE MT",
|
|
12
68
|
"scripts": {
|
|
13
69
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
70
|
"prebuild": "exit 0",
|
|
@@ -16,19 +72,20 @@
|
|
|
16
72
|
"build": "node ../../scripts/build/build.js"
|
|
17
73
|
},
|
|
18
74
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-props-helpers": "
|
|
20
|
-
"react-desc": "
|
|
75
|
+
"@elliemae/ds-props-helpers": "2.0.0-alpha.11",
|
|
76
|
+
"react-desc": "~4.1.3"
|
|
21
77
|
},
|
|
22
78
|
"devDependencies": {
|
|
23
|
-
"styled-components": "~5.3.
|
|
79
|
+
"styled-components": "~5.3.1"
|
|
24
80
|
},
|
|
25
81
|
"peerDependencies": {
|
|
26
|
-
"react": "
|
|
27
|
-
"react-dom": "^17.0.
|
|
28
|
-
"styled-components": "^5.3.
|
|
82
|
+
"react": "~17.0.2",
|
|
83
|
+
"react-dom": "^17.0.2",
|
|
84
|
+
"styled-components": "^5.3.1"
|
|
29
85
|
},
|
|
30
86
|
"publishConfig": {
|
|
31
87
|
"access": "public",
|
|
32
|
-
"directory": "dist"
|
|
88
|
+
"directory": "dist",
|
|
89
|
+
"generateSubmodules": true
|
|
33
90
|
}
|
|
34
91
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DSFormLayoutBlockItemPropsT as Props } from './index.d';
|
|
3
|
+
declare const DSFormLayoutBlockItem: {
|
|
4
|
+
(props: Props): JSX.Element;
|
|
5
|
+
propTypes: {
|
|
6
|
+
children: any;
|
|
7
|
+
label: any;
|
|
8
|
+
inputID: any;
|
|
9
|
+
feedbackMessage: any;
|
|
10
|
+
validationMessage: any;
|
|
11
|
+
hasError: any;
|
|
12
|
+
required: any;
|
|
13
|
+
optional: any;
|
|
14
|
+
fitContent: any;
|
|
15
|
+
leftLabel: any;
|
|
16
|
+
hideLabel: any;
|
|
17
|
+
withHighlight: any;
|
|
18
|
+
isGroup: any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
declare const DSFormLayoutBlockItemWithSchema: any;
|
|
22
|
+
export { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DSFormLayoutBlockItemPropsT {
|
|
3
|
+
children: JSX.Element;
|
|
4
|
+
label: string;
|
|
5
|
+
inputID: string;
|
|
6
|
+
validationMessage?: string;
|
|
7
|
+
feedbackMessage?: string;
|
|
8
|
+
hasError?: boolean;
|
|
9
|
+
leftLabel?: boolean;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
fitContent?: boolean;
|
|
12
|
+
optional?: boolean;
|
|
13
|
+
hideLabel?: boolean;
|
|
14
|
+
withHighlight?: boolean;
|
|
15
|
+
isGroup?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface DSFormLayoutBlockItemStyledMessageT {
|
|
18
|
+
hasError?: boolean;
|
|
19
|
+
leftLabel?: boolean;
|
|
20
|
+
hideLabel?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface DSFormLayoutBlockItemStyledContainerT {
|
|
23
|
+
leftLabel?: boolean;
|
|
24
|
+
fitContent?: boolean;
|
|
25
|
+
hideLabel?: boolean;
|
|
26
|
+
withHighlight?: boolean;
|
|
27
|
+
isGroup?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface DSFormLayoutBlockItemStyledLabelT {
|
|
30
|
+
leftLabel?: boolean;
|
|
31
|
+
hideLabel?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface DSFormLayoutBlockItemStyledMarkT {
|
|
34
|
+
required?: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DSFormLayoutBlockItem';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const propTypes: {
|
|
2
|
+
children: any;
|
|
3
|
+
label: any;
|
|
4
|
+
inputID: any;
|
|
5
|
+
feedbackMessage: any;
|
|
6
|
+
validationMessage: any;
|
|
7
|
+
hasError: any;
|
|
8
|
+
required: any;
|
|
9
|
+
optional: any;
|
|
10
|
+
fitContent: any;
|
|
11
|
+
leftLabel: any;
|
|
12
|
+
hideLabel: any;
|
|
13
|
+
withHighlight: any;
|
|
14
|
+
isGroup: any;
|
|
15
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DSFormLayoutBlockItemStyledContainerT, DSFormLayoutBlockItemStyledLabelT, DSFormLayoutBlockItemStyledMessageT, DSFormLayoutBlockItemStyledMarkT } from './index.d';
|
|
2
|
+
export declare const StyledContainer: import("styled-components").StyledComponent<"div", any, DSFormLayoutBlockItemStyledContainerT, never>;
|
|
3
|
+
export declare const StyledLabel: import("styled-components").StyledComponent<"label", any, DSFormLayoutBlockItemStyledLabelT, never>;
|
|
4
|
+
export declare const StyledMessage: import("styled-components").StyledComponent<"div", any, DSFormLayoutBlockItemStyledMessageT, never>;
|
|
5
|
+
export declare const StyledMark: import("styled-components").StyledComponent<"span", any, DSFormLayoutBlockItemStyledMarkT, never>;
|
|
6
|
+
export declare const ScreenReaderOnly: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DSControlledCheckboxGroupT } from './index.d';
|
|
3
|
+
declare const DSFormLayoutCheckboxGroup: {
|
|
4
|
+
(props: DSControlledCheckboxGroupT): JSX.Element;
|
|
5
|
+
propTypes: {
|
|
6
|
+
direction: any;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare const DSFormLayoutCheckboxGroupWithSchema: any;
|
|
10
|
+
export { DSFormLayoutCheckboxGroup, DSFormLayoutCheckboxGroupWithSchema };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type DirectionsT = 'horizontal' | 'vertical';
|
|
3
|
+
export interface DSControlledCheckboxGroupT {
|
|
4
|
+
direction: DirectionsT;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface DSControlledCheckboxGroupStyledContainerT {
|
|
8
|
+
direction: DirectionsT;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DSFormLayoutCheckboxGroup';
|
package/types/index.d.ts
ADDED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSFormLayoutBlockItem.js","sources":["../../../src/form-layout-block-item/DSFormLayoutBlockItem.tsx"],"sourcesContent":["/* eslint-disable complexity */\nimport React, { useMemo } from 'react';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport type { DSFormLayoutBlockItemPropsT as Props } from './index.d';\nimport { propTypes } from './propTypes';\nimport { StyledMessage, StyledLabel, StyledContainer, StyledMark, ScreenReaderOnly } from './styles';\n\nconst DSFormLayoutBlockItem = (props: Props): JSX.Element => {\n const {\n label,\n feedbackMessage,\n validationMessage,\n inputID,\n children,\n hasError,\n leftLabel,\n required,\n optional,\n hideLabel,\n fitContent,\n withHighlight,\n isGroup = false,\n } = props;\n\n const instanceUID = useMemo(() => uid(6), []);\n\n return (\n <StyledContainer\n leftLabel={leftLabel}\n fitContent={fitContent}\n hideLabel={hideLabel}\n withHighlight={withHighlight}\n as={isGroup ? 'fieldset' : 'div'}\n isGroup={isGroup}\n aria-describedby={`${inputID || instanceUID}_feedback_message`}\n >\n <StyledLabel htmlFor={inputID} leftLabel={leftLabel} hideLabel={hideLabel} aria-hidden={isGroup}>\n {label}\n {(required || optional) && <StyledMark required={required} />}\n </StyledLabel>\n {isGroup && <ScreenReaderOnly as=\"legend\">{label}</ScreenReaderOnly>}\n {children}\n {feedbackMessage && !hasError && (\n <StyledMessage\n leftLabel={leftLabel}\n hideLabel={hideLabel}\n aria-hidden={isGroup}\n id={`${inputID || instanceUID}_feedback_message`}\n >\n {feedbackMessage}\n </StyledMessage>\n )}\n {validationMessage && hasError && (\n <StyledMessage hasError={hasError} leftLabel={leftLabel} hideLabel={hideLabel} role=\"alert\">\n {validationMessage}\n </StyledMessage>\n )}\n </StyledContainer>\n );\n};\n\nDSFormLayoutBlockItem.propTypes = propTypes;\nconst DSFormLayoutBlockItemWithSchema = describe(DSFormLayoutBlockItem);\nDSFormLayoutBlockItemWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema };\n"],"names":["DSFormLayoutBlockItem","props","label","feedbackMessage","validationMessage","inputID","children","hasError","leftLabel","required","optional","hideLabel","fitContent","withHighlight","isGroup","instanceUID","useMemo","uid","React","StyledContainer","StyledLabel","StyledMark","ScreenReaderOnly","StyledMessage","propTypes","DSFormLayoutBlockItemWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;AAAA;;IAQMA,qBAAqB,GAAG,SAAxBA,qBAAwB,CAACC,KAAD,EAA+B;AAC3D,MACEC,KADF,GAcID,KAdJ,CACEC,KADF;AAAA,MAEEC,eAFF,GAcIF,KAdJ,CAEEE,eAFF;AAAA,MAGEC,iBAHF,GAcIH,KAdJ,CAGEG,iBAHF;AAAA,MAIEC,OAJF,GAcIJ,KAdJ,CAIEI,OAJF;AAAA,MAKEC,QALF,GAcIL,KAdJ,CAKEK,QALF;AAAA,MAMEC,QANF,GAcIN,KAdJ,CAMEM,QANF;AAAA,MAOEC,SAPF,GAcIP,KAdJ,CAOEO,SAPF;AAAA,MAQEC,QARF,GAcIR,KAdJ,CAQEQ,QARF;AAAA,MASEC,QATF,GAcIT,KAdJ,CASES,QATF;AAAA,MAUEC,SAVF,GAcIV,KAdJ,CAUEU,SAVF;AAAA,MAWEC,UAXF,GAcIX,KAdJ,CAWEW,UAXF;AAAA,MAYEC,aAZF,GAcIZ,KAdJ,CAYEY,aAZF;AAAA,uBAcIZ,KAdJ,CAaEa,OAbF;AAAA,MAaEA,OAbF,+BAaY,KAbZ;AAgBA,MAAMC,WAAW,GAAGC,aAAO,CAAC;AAAA,WAAMC,OAAG,CAAC,CAAD,CAAT;AAAA,GAAD,EAAe,EAAf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@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.js","sources":["../../../src/form-layout-block-item/propTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n children: PropTypes.node.isRequired.description('Input component. '),\n label: PropTypes.string.isRequired.description(\n 'Label property for the input component. This property is required for accesibility purposes.',\n ),\n inputID: PropTypes.string.isRequired.description(\n \"String that matches the input component's id. This property is required for accesibility purposes.\",\n ),\n feedbackMessage: PropTypes.string.description('Feedback message to show below the input component.'),\n validationMessage: PropTypes.string.description(\n 'Validation message to show below the input component. It requires hasError property set to true to be visible.',\n ),\n hasError: PropTypes.bool.description('Helper boolean property for the validation message.'),\n required: PropTypes.bool.description('Adds required extra styling.'),\n optional: PropTypes.bool.description('Adds optional extra styling.'),\n fitContent: PropTypes.bool.description('Set the width of the layout to the input component.'),\n leftLabel: PropTypes.bool.description('Adds the label at the left of the input component.'),\n hideLabel: PropTypes.bool.description(\n 'Hides the input label. It still requires label and labelFor property for accesibility purposes',\n ),\n withHighlight: PropTypes.bool.description(\n 'Adds highlight extra styling. It requires extra spacing, please check withHighlight explanation tab.',\n ),\n isGroup: PropTypes.bool.description(\n 'Sets the HTML elements as fieldset and legend. This should be used when you want to group more than one input.',\n ),\n};\n"],"names":["propTypes","children","PropTypes","node","isRequired","description","label","string","inputID","feedbackMessage","validationMessage","hasError","bool","required","optional","fitContent","leftLabel","hideLabel","withHighlight","isGroup"],"mappings":";;;;;;IAEaA,SAAS,GAAG;AACvBC,EAAAA,QAAQ,EAAEC,mBAAS,CAACC,IAAV,CAAeC,UAAf,CAA0BC,WAA1B,CAAsC,mBAAtC,CADa;AAEvBC,EAAAA,KAAK,EAAEJ,mBAAS,CAACK,MAAV,CAAiBH,UAAjB,CAA4BC,WAA5B,CACL,8FADK,CAFgB;AAKvBG,EAAAA,OAAO,EAAEN,mBAAS,CAACK,MAAV,CAAiBH,UAAjB,CAA4BC,WAA5B,CACP,oGADO,CALc;AAQvBI,EAAAA,eAAe,EAAEP,mBAAS,CAACK,MAAV,CAAiBF,WAAjB,CAA6B,qDAA7B,CARM;AASvBK,EAAAA,iBAAiB,EAAER,mBAAS,CAACK,MAAV,CAAiBF,WAAjB,CACjB,gHADiB,CATI;AAYvBM,EAAAA,QAAQ,EAAET,mBAAS,CAACU,IAAV,CAAeP,WAAf,CAA2B,qDAA3B,CAZa;AAavBQ,EAAAA,QAAQ,EAAEX,mBAAS,CAACU,IAAV,CAAeP,WAAf,CAA2B,8BAA3B,CAba;AAcvBS,EAAAA,QAAQ,EAAEZ,mBAAS,CAACU,IAAV,CAAeP,WAAf,CAA2B,8BAA3B,CAda;AAevBU,EAAAA,UAAU,EAAEb,mBAAS,CAACU,IAAV,CAAeP,WAAf,CAA2B,qDAA3B,CAfW;AAgBvBW,EAAAA,SAAS,EAAEd,mBAAS,CAACU,IAAV,CAAeP,WAAf,CAA2B,oDAA3B,CAhBY;AAiBvBY,EAAAA,SAAS,EAAEf,mBAAS,CAACU,IAAV,CAAeP,WAAf,CACT,gGADS,CAjBY;AAoBvBa,EAAAA,aAAa,EAAEhB,mBAAS,CAACU,IAAV,CAAeP,WAAf,CACb,sGADa,CApBQ;AAuBvBc,EAAAA,OAAO,EAAEjB,mBAAS,CAACU,IAAV,CAAeP,WAAf,CACP,gHADO;AAvBc;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/form-layout-block-item/styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type {\n DSFormLayoutBlockItemStyledContainerT,\n DSFormLayoutBlockItemStyledLabelT,\n DSFormLayoutBlockItemStyledMessageT,\n DSFormLayoutBlockItemStyledMarkT,\n} from './index.d';\n\nexport const StyledContainer = styled.div<DSFormLayoutBlockItemStyledContainerT>`\n position: relative;\n padding: 0;\n margin: 0;\n display: grid;\n ${({ fitContent }) => (fitContent ? 'width: fit-content;' : undefined)}\n ${({ isGroup }) => (isGroup ? 'border: none' : '')};\n ${({ leftLabel, hideLabel }) => (leftLabel && !hideLabel ? 'grid-template-columns: max-content auto;' : undefined)}\n align-items: center;\n ${({ theme, withHighlight }) =>\n withHighlight\n ? `\n &::after {\n position: absolute;\n content: '';\n left: -${theme.space.xxs};\n top: -${theme.space.xxxs};\n z-index: -1;\n width: calc(100% + ${theme.space.xs});\n height: calc(100% + ${theme.space.xxs});\n background-color: #FEFBEE;\n border : 1px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 1px 3px 0 rgba(0,0,0,0.35);\n }\n &:hover, \n &:focus-within {\n &::after {\n position: absolute;\n content: '';\n left: -${theme.space.xxs};\n top: -${theme.space.xxxs};\n z-index: -1;\n width: calc(100% + ${theme.space.xs});\n height: calc(100% + ${theme.space.xxs});\n background-color: #FFF9D3;\n border : 1px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 6px 10px 0 rgba(0,0,0,0.30);\n }\n }\n `\n : undefined}\n`;\n\nexport const StyledLabel = styled.label<DSFormLayoutBlockItemStyledLabelT>`\n display: flex;\n ${({ theme, leftLabel }) => (leftLabel ? `padding-right: ${theme.space.xxs};` : undefined)}\n ${({ hideLabel }) =>\n hideLabel\n ? `position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n `\n : undefined}\n`;\n\nexport const StyledMessage = styled.div<DSFormLayoutBlockItemStyledMessageT>`\n font-size: ${({ theme }) => theme.fontSizes.microText[200]};\n font-style: italic;\n text-align: right;\n line-height: 15px;\n height: 15px;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[500])};\n ${({ leftLabel, hideLabel }) => (leftLabel && !hideLabel ? 'grid-column: 1/3;' : undefined)}\n`;\n\nexport const StyledMark = styled.span<DSFormLayoutBlockItemStyledMarkT>`\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-left: ${({ theme }) => theme.space.xxxs};\n ${({ theme, required }) =>\n required\n ? `\n background-color: ${theme.colors.danger[900]};\n `\n : `\n border: 1px solid ${theme.colors.brand[600]};\n `}\n`;\n\nexport const ScreenReaderOnly = styled.div`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n"],"names":["StyledContainer","styled","div","fitContent","undefined","isGroup","leftLabel","hideLabel","theme","withHighlight","space","xxs","xxxs","xs","StyledLabel","label","StyledMessage","fontSizes","microText","hasError","colors","danger","neutral","StyledMark","span","required","brand","ScreenReaderOnly"],"mappings":";;;;;;;;;;IAQaA,eAAe,gBAAGC,0BAAM,CAACC,GAAV;AAAA;AAAA,iGAKxB;AAAA,MAAGC,UAAH,QAAGA,UAAH;AAAA,SAAqBA,UAAU,GAAG,qBAAH,GAA2BC,SAA1D;AAAA,CALwB,EAMxB;AAAA,MAAGC,OAAH,SAAGA,OAAH;AAAA,SAAkBA,OAAO,GAAG,cAAH,GAAoB,EAA7C;AAAA,CANwB,EAOxB;AAAA,MAAGC,SAAH,SAAGA,SAAH;AAAA,MAAcC,SAAd,SAAcA,SAAd;AAAA,SAA+BD,SAAS,IAAI,CAACC,SAAd,GAA0B,0CAA1B,GAAuEH,SAAtG;AAAA,CAPwB,EASxB;AAAA,MAAGI,KAAH,SAAGA,KAAH;AAAA,MAAUC,aAAV,SAAUA,aAAV;AAAA,SACAA,aAAa,+FAKAD,KAAK,CAACE,KAAN,CAAYC,GALZ,8BAMDH,KAAK,CAACE,KAAN,CAAYE,IANX,iEAQYJ,KAAK,CAACE,KAAN,CAAYG,EARxB,8CAScL,KAAK,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CAJM,EAKnB;AAAA,MAAGJ,KAAH,UAAGA,KAAH;AAAA,MAAUiB,QAAV,UAAUA,QAAV;AAAA,SACAA,QAAQ,mCAEUjB,KAAK,CAACY,MAAN,CAAaC,MAAb,CAAoB,GAApB,CAFV,6CAKUb,KAAK,CAACY,MAAN,CAAaM,KAAb,CAAmB,GAAnB,CALV,UADR;AAAA,CALmB;IAeVC,gBAAgB,gBAAG1B,0BAAM,CAACC,GAAV;AAAA;AAAA;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSFormLayoutCheckboxGroup.js","sources":["../../../src/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { propTypes } from './propTypes';\nimport { StyledContainer } from './styles';\nimport { defaultProps } from './defaultProps';\nimport type { DSControlledCheckboxGroupT } from './index.d';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst DSFormLayoutCheckboxGroup = (props: DSControlledCheckboxGroupT): JSX.Element => {\n useValidateProps(props);\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);\n\n return <StyledContainer direction={propsWithDefault.direction}>{propsWithDefault.children}</StyledContainer>;\n};\n\nDSFormLayoutCheckboxGroup.propTypes = propTypes;\nconst DSFormLayoutCheckboxGroupWithSchema = describe(DSFormLayoutCheckboxGroup);\nDSFormLayoutCheckboxGroupWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutCheckboxGroup, DSFormLayoutCheckboxGroupWithSchema };\n"],"names":["DSFormLayoutCheckboxGroup","props","useValidateProps","propsWithDefault","useMemoMergePropsWithDefault","defaultProps","React","StyledContainer","direction","children","propTypes","DSFormLayoutCheckboxGroupWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;IASMA,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,KAAD,EAAoD;AACpFC,EAAAA,gEAAgB,CAACD,KAAD,CAAhB;AACA,MAAME,gBAAgB,GAAGC,2CAA4B,CAACH,KAAD,EAAQI,iDAAR,CAArD;AAEA,sBAAOC,wCAACC,8CAAD;AAAiB,IAAA,SAAS,EAAEJ,gBAAgB,CAACK;AAA7C,KAAyDL,gBAAgB,CAACM,QAA1E,CAAP;AACD;;AAEDT,yBAAyB,CAACU,SAA1B,GAAsCA,2CAAtC;IACMC,mCAAmC,GAAGC,kBAAQ,CAACZ,yBAAD;AACpDW,mCAAmC,CAACD,SAApC,GAAgDA,2CAAhD;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useValidateProps.js","sources":["../../../../src/form-layout-checkbox-group/config/useValidateProps.tsx"],"sourcesContent":["import React from 'react';\nimport type { DSControlledCheckboxGroupT } from '../index.d';\n\nconst getVariableType = (arg: unknown): string => {\n if (Array.isArray(arg)) return 'array';\n if (arg === null) return 'null';\n if (arg === undefined) return 'undefined';\n return typeof arg;\n};\n\nconst throwCheckboxGroupDirectionError = (invalidProp: unknown): void => {\n throw new Error(\n `You are trying to pass a not valid \"direction\" property value for a checkbox group, please provide a valid type.\n\n Received: ${invalidProp} (${getVariableType(invalidProp)})\n Expected: \"horizontal\" or \"vertical\" (string)\n `,\n );\n};\n\nconst throwCheckboxGroupChildrenError = (): void => {\n throw new Error(\n `You are trying to use a checkbox group without any React children, please provide at least one children to use.\n \n Received: (null)\n Expected: React children\n `,\n );\n};\n\nexport const useValidateProps = (props: DSControlledCheckboxGroupT): void => {\n if (props.direction !== undefined && props.direction !== 'vertical' && props.direction !== 'horizontal') {\n throwCheckboxGroupDirectionError(props.direction);\n }\n if (!React.Children.count(props.children)) {\n throwCheckboxGroupChildrenError();\n }\n};\n"],"names":["getVariableType","arg","Array","isArray","undefined","throwCheckboxGroupDirectionError","invalidProp","Error","throwCheckboxGroupChildrenError","useValidateProps","props","direction","React","Children","count","children"],"mappings":";;;;;;;;;;;;AAGA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,GAAD,EAA0B;AAChD,MAAIC,KAAK,CAACC,OAAN,CAAcF,GAAd,CAAJ,EAAwB,OAAO,OAAP;AACxB,MAAIA,GAAG,KAAK,IAAZ,EAAkB,OAAO,MAAP;AAClB,MAAIA,GAAG,KAAKG,SAAZ,EAAuB,OAAO,WAAP;AACvB,qCAAcH,GAAd;AACD,CALD;;AAOA,IAAMI,gCAAgC,GAAG,SAAnCA,gCAAmC,CAACC,WAAD,EAAgC;AACvE,QAAM,IAAIC,KAAJ,6IAGMD,WAHN,eAGsBN,eAAe,CAACM,WAAD,CAHrC,gEAAN;AAOD,CARD;;AAUA,IAAME,+BAA+B,GAAG,SAAlCA,+BAAkC,GAAY;AAClD,QAAM,IAAID,KAAJ,6KAAN;AAOD,CARD;;IAUaE,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAA6C;AAC3E,MAAIA,KAAK,CAACC,SAAN,KAAoBP,SAApB,IAAiCM,KAAK,CAACC,SAAN,KAAoB,UAArD,IAAmED,KAAK,CAACC,SAAN,KAAoB,YAA3F,EAAyG;AACvGN,IAAAA,gCAAgC,CAACK,KAAK,CAACC,SAAP,CAAhC;AACD;;AACD,MAAI,CAACC,yBAAK,CAACC,QAAN,CAAeC,KAAf,CAAqBJ,KAAK,CAACK,QAA3B,CAAL,EAA2C;AACzCP,IAAAA,+BAA+B;AAChC;AACF;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../../src/form-layout-checkbox-group/defaultProps.tsx"],"sourcesContent":["export const defaultProps = {\n direction: 'horizontal',\n};\n"],"names":["defaultProps","direction"],"mappings":";;;;IAAaA,YAAY,GAAG;AAC1BC,EAAAA,SAAS,EAAE;AADe;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.js","sources":["../../../src/form-layout-checkbox-group/propTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n direction: PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.'),\n};\n"],"names":["propTypes","direction","PropTypes","oneOf","description"],"mappings":";;;;;;IAEaA,SAAS,GAAG;AACvBC,EAAAA,SAAS,EAAEC,mBAAS,CAACC,KAAV,CAAgB,CAAC,YAAD,EAAe,UAAf,CAAhB,EAA4CC,WAA5C,CAAwD,uCAAxD;AADY;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/form-layout-checkbox-group/styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type { DSControlledCheckboxGroupStyledContainerT } from './index.d';\n\nexport const StyledContainer = styled.div<DSControlledCheckboxGroupStyledContainerT>`\n display: inline-flex;\n flex-wrap: wrap;\n flex-direction: ${({ direction }) => (direction === 'horizontal' ? 'row' : 'column')};\n margin-left: ${({ theme }) => theme.space.xs};\n margin-right: ${({ theme }) => theme.space.xs};\n margin-top: ${({ theme }) => theme.space.xxs};\n & div {\n padding: 0;\n margin-bottom: ${({ theme }) => theme.space.xxs};\n }\n & div:not(:last-child) {\n margin-right: ${({ theme, direction }) => (direction === 'horizontal' ? theme.space.s : '0')};\n }\n`;\n"],"names":["StyledContainer","styled","div","direction","theme","space","xs","xxs","s"],"mappings":";;;;;;;;;;IAGaA,eAAe,gBAAGC,0BAAM,CAACC,GAAV;AAAA;AAAA,iMAGR;AAAA,MAAGC,SAAH,QAAGA,SAAH;AAAA,SAAoBA,SAAS,KAAK,YAAd,GAA6B,KAA7B,GAAqC,QAAzD;AAAA,CAHQ,EAIX;AAAA,MAAGC,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,KAAN,CAAYC,EAA3B;AAAA,CAJW,EAKV;AAAA,MAAGF,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,KAAN,CAAYC,EAA3B;AAAA,CALU,EAMZ;AAAA,MAAGF,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,KAAN,CAAYE,GAA3B;AAAA,CANY,EASP;AAAA,MAAGH,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,KAAN,CAAYE,GAA3B;AAAA,CATO,EAYR;AAAA,MAAGH,KAAH,SAAGA,KAAH;AAAA,MAAUD,SAAV,SAAUA,SAAV;AAAA,SAA2BA,SAAS,KAAK,YAAd,GAA6BC,KAAK,CAACC,KAAN,CAAYG,CAAzC,GAA6C,GAAxE;AAAA,CAZQ;;;;"}
|
package/cjs/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSFormLayoutBlockItem.js","sources":["../../../src/form-layout-block-item/DSFormLayoutBlockItem.tsx"],"sourcesContent":["/* eslint-disable complexity */\nimport React, { useMemo } from 'react';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport type { DSFormLayoutBlockItemPropsT as Props } from './index.d';\nimport { propTypes } from './propTypes';\nimport { StyledMessage, StyledLabel, StyledContainer, StyledMark, ScreenReaderOnly } from './styles';\n\nconst DSFormLayoutBlockItem = (props: Props): JSX.Element => {\n const {\n label,\n feedbackMessage,\n validationMessage,\n inputID,\n children,\n hasError,\n leftLabel,\n required,\n optional,\n hideLabel,\n fitContent,\n withHighlight,\n isGroup = false,\n } = props;\n\n const instanceUID = useMemo(() => uid(6), []);\n\n return (\n <StyledContainer\n leftLabel={leftLabel}\n fitContent={fitContent}\n hideLabel={hideLabel}\n withHighlight={withHighlight}\n as={isGroup ? 'fieldset' : 'div'}\n isGroup={isGroup}\n aria-describedby={`${inputID || instanceUID}_feedback_message`}\n >\n <StyledLabel htmlFor={inputID} leftLabel={leftLabel} hideLabel={hideLabel} aria-hidden={isGroup}>\n {label}\n {(required || optional) && <StyledMark required={required} />}\n </StyledLabel>\n {isGroup && <ScreenReaderOnly as=\"legend\">{label}</ScreenReaderOnly>}\n {children}\n {feedbackMessage && !hasError && (\n <StyledMessage\n leftLabel={leftLabel}\n hideLabel={hideLabel}\n aria-hidden={isGroup}\n id={`${inputID || instanceUID}_feedback_message`}\n >\n {feedbackMessage}\n </StyledMessage>\n )}\n {validationMessage && hasError && (\n <StyledMessage hasError={hasError} leftLabel={leftLabel} hideLabel={hideLabel} role=\"alert\">\n {validationMessage}\n </StyledMessage>\n )}\n </StyledContainer>\n );\n};\n\nDSFormLayoutBlockItem.propTypes = propTypes;\nconst DSFormLayoutBlockItemWithSchema = describe(DSFormLayoutBlockItem);\nDSFormLayoutBlockItemWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema };\n"],"names":["DSFormLayoutBlockItem","props","label","feedbackMessage","validationMessage","inputID","children","hasError","leftLabel","required","optional","hideLabel","fitContent","withHighlight","isGroup","instanceUID","useMemo","uid","propTypes","DSFormLayoutBlockItemWithSchema","describe"],"mappings":";;;;;;;AAAA;;IAQMA,qBAAqB,GAAG,SAAxBA,qBAAwB,CAACC,KAAD,EAA+B;AAC3D,MACEC,KADF,GAcID,KAdJ,CACEC,KADF;AAAA,MAEEC,eAFF,GAcIF,KAdJ,CAEEE,eAFF;AAAA,MAGEC,iBAHF,GAcIH,KAdJ,CAGEG,iBAHF;AAAA,MAIEC,OAJF,GAcIJ,KAdJ,CAIEI,OAJF;AAAA,MAKEC,Q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