@elliemae/ds-form-layout-blocks 3.5.1-next.0 → 3.6.0-next.1
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/dist/cjs/form-layout-block-item/DSFormLayoutBlockItem.js +22 -4
- package/dist/cjs/form-layout-block-item/DSFormLayoutBlockItem.js.map +2 -2
- package/dist/cjs/{form-layout-checkbox-group/defaultProps.js → form-layout-block-item/config/useFormLayoutBlockItem.js} +17 -7
- package/dist/cjs/form-layout-block-item/config/useFormLayoutBlockItem.js.map +7 -0
- package/dist/cjs/form-layout-block-item/propTypes.js +10 -3
- package/dist/cjs/form-layout-block-item/propTypes.js.map +2 -2
- package/dist/cjs/form-layout-block-item/styles.js +5 -1
- package/dist/cjs/form-layout-block-item/styles.js.map +2 -2
- package/dist/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +9 -7
- package/dist/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +2 -2
- package/dist/cjs/form-layout-checkbox-group/config/useFormLayoutCheckboxGroup.js +44 -0
- package/dist/cjs/form-layout-checkbox-group/config/useFormLayoutCheckboxGroup.js.map +7 -0
- package/dist/cjs/form-layout-checkbox-group/propTypes.js +5 -0
- package/dist/cjs/form-layout-checkbox-group/propTypes.js.map +2 -2
- package/dist/cjs/form-layout-checkbox-group/styles.js +3 -0
- package/dist/cjs/form-layout-checkbox-group/styles.js.map +2 -2
- package/dist/esm/form-layout-block-item/DSFormLayoutBlockItem.js +22 -4
- package/dist/esm/form-layout-block-item/DSFormLayoutBlockItem.js.map +2 -2
- package/dist/esm/form-layout-block-item/config/useFormLayoutBlockItem.js +23 -0
- package/dist/esm/form-layout-block-item/config/useFormLayoutBlockItem.js.map +7 -0
- package/dist/esm/form-layout-block-item/propTypes.js +11 -4
- package/dist/esm/form-layout-block-item/propTypes.js.map +2 -2
- package/dist/esm/form-layout-block-item/styles.js +6 -2
- package/dist/esm/form-layout-block-item/styles.js.map +2 -2
- package/dist/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +10 -8
- package/dist/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +2 -2
- package/dist/esm/form-layout-checkbox-group/config/useFormLayoutCheckboxGroup.js +23 -0
- package/dist/esm/form-layout-checkbox-group/config/useFormLayoutCheckboxGroup.js.map +7 -0
- package/dist/esm/form-layout-checkbox-group/propTypes.js +6 -1
- package/dist/esm/form-layout-checkbox-group/propTypes.js.map +2 -2
- package/dist/esm/form-layout-checkbox-group/styles.js +4 -1
- package/dist/esm/form-layout-checkbox-group/styles.js.map +2 -2
- package/package.json +3 -3
- package/dist/cjs/form-layout-block-item/index.d.js +0 -24
- package/dist/cjs/form-layout-block-item/index.d.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/config/useValidateProps.js +0 -67
- package/dist/cjs/form-layout-checkbox-group/config/useValidateProps.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/defaultProps.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/index.d.js +0 -24
- package/dist/cjs/form-layout-checkbox-group/index.d.js.map +0 -7
- package/dist/esm/form-layout-block-item/index.d.js +0 -2
- package/dist/esm/form-layout-block-item/index.d.js.map +0 -7
- package/dist/esm/form-layout-checkbox-group/config/useValidateProps.js +0 -41
- package/dist/esm/form-layout-checkbox-group/config/useValidateProps.js.map +0 -7
- package/dist/esm/form-layout-checkbox-group/defaultProps.js +0 -8
- package/dist/esm/form-layout-checkbox-group/defaultProps.js.map +0 -7
- package/dist/esm/form-layout-checkbox-group/index.d.js +0 -2
- package/dist/esm/form-layout-checkbox-group/index.d.js.map +0 -7
|
@@ -34,10 +34,17 @@ var import_react = require("react");
|
|
|
34
34
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
35
35
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
36
36
|
var import_uid = require("uid");
|
|
37
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
37
38
|
var import_DSFormLayoutBlockItemDataTestId = require("../exported-related/DSFormLayoutBlockItemDataTestId");
|
|
38
39
|
var import_propTypes = require("./propTypes");
|
|
39
40
|
var import_styles = require("./styles");
|
|
41
|
+
var import_useFormLayoutBlockItem = require("./config/useFormLayoutBlockItem");
|
|
40
42
|
const DSFormLayoutBlockItem = (props) => {
|
|
43
|
+
const {
|
|
44
|
+
globalAttributes: { ...othersGlobalAttributes },
|
|
45
|
+
xstyledProps,
|
|
46
|
+
propsWithDefault
|
|
47
|
+
} = (0, import_useFormLayoutBlockItem.useFormLayoutBlockItem)(props);
|
|
41
48
|
const {
|
|
42
49
|
label,
|
|
43
50
|
feedbackMessage,
|
|
@@ -53,8 +60,8 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
53
60
|
hideLabel,
|
|
54
61
|
fitContent,
|
|
55
62
|
withHighlight,
|
|
56
|
-
isGroup
|
|
57
|
-
} =
|
|
63
|
+
isGroup
|
|
64
|
+
} = propsWithDefault;
|
|
58
65
|
const instanceUID = (0, import_react.useMemo)(() => (0, import_uid.uid)(6), []);
|
|
59
66
|
const cols = (0, import_react.useMemo)(() => maxCharCounter !== void 0 ? ["1fr", "auto"] : ["1fr"], [maxCharCounter]);
|
|
60
67
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledContainer, {
|
|
@@ -66,6 +73,8 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
66
73
|
as: isGroup ? "fieldset" : "div",
|
|
67
74
|
isGroup,
|
|
68
75
|
"aria-describedby": !isGroup ? `${inputID || instanceUID}_feedback_message` : void 0,
|
|
76
|
+
...othersGlobalAttributes,
|
|
77
|
+
...xstyledProps,
|
|
69
78
|
children: [
|
|
70
79
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, {
|
|
71
80
|
cols,
|
|
@@ -77,6 +86,7 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
77
86
|
leftLabel,
|
|
78
87
|
hideLabel,
|
|
79
88
|
"aria-hidden": isGroup,
|
|
89
|
+
...othersGlobalAttributes,
|
|
80
90
|
children: [
|
|
81
91
|
label,
|
|
82
92
|
(required || optional) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledMark, {
|
|
@@ -104,13 +114,21 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
104
114
|
id: `${inputID || instanceUID}_feedback_message`,
|
|
105
115
|
children: feedbackMessage
|
|
106
116
|
}),
|
|
107
|
-
validationMessage && hasError && /* @__PURE__ */ (0, import_jsx_runtime.
|
|
117
|
+
validationMessage && hasError && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledMessage, {
|
|
108
118
|
"data-testid": import_DSFormLayoutBlockItemDataTestId.DSFormLayoutBlockItemDataTestId.ERROR_MESSAGE,
|
|
109
119
|
hasError,
|
|
110
120
|
leftLabel,
|
|
111
121
|
hideLabel,
|
|
112
122
|
role: "alert",
|
|
113
|
-
children:
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.AlertsSmallFill, {
|
|
125
|
+
width: 8,
|
|
126
|
+
height: 8,
|
|
127
|
+
color: ["danger", 900]
|
|
128
|
+
}),
|
|
129
|
+
"\xA0",
|
|
130
|
+
validationMessage
|
|
131
|
+
]
|
|
114
132
|
})
|
|
115
133
|
]
|
|
116
134
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/form-layout-block-item/DSFormLayoutBlockItem.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useMemo } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAA+B;AAC/B,qBAAqB;AACrB,0BAAyB;AACzB,iBAAoB;AACpB,6CAAgD;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useMemo } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { AlertsSmallFill } from '@elliemae/ds-icons';\nimport { DSFormLayoutBlockItemDataTestId } from '../exported-related/DSFormLayoutBlockItemDataTestId';\nimport { DSFormLayoutBlockItemT, propTypes } from './propTypes';\nimport { StyledMessage, StyledLabel, StyledContainer, StyledMark, ScreenReaderOnly, StyledCharCount } from './styles';\nimport { useFormLayoutBlockItem } from './config/useFormLayoutBlockItem';\n\nconst DSFormLayoutBlockItem = (props: DSFormLayoutBlockItemT.Props) => {\n const {\n globalAttributes: { ...othersGlobalAttributes },\n xstyledProps,\n propsWithDefault,\n } = useFormLayoutBlockItem(props);\n const {\n label,\n feedbackMessage,\n maxCharCounter,\n currentChar,\n validationMessage,\n inputID,\n children,\n hasError,\n leftLabel,\n required,\n optional,\n hideLabel,\n fitContent,\n withHighlight,\n isGroup,\n } = propsWithDefault;\n\n const instanceUID = useMemo(() => uid(6), []);\n\n const cols = useMemo(() => (maxCharCounter !== undefined ? ['1fr', 'auto'] : ['1fr']), [maxCharCounter]);\n\n return (\n <StyledContainer\n data-testid={DSFormLayoutBlockItemDataTestId.CONTAINER}\n leftLabel={leftLabel}\n fitContent={fitContent}\n hideLabel={hideLabel}\n withHighlight={withHighlight}\n as={isGroup ? 'fieldset' : 'div'}\n isGroup={isGroup}\n aria-describedby={!isGroup ? `${inputID || instanceUID}_feedback_message` : undefined}\n {...othersGlobalAttributes}\n {...xstyledProps}\n >\n <Grid cols={cols} gutter=\"xxs\">\n <StyledLabel\n data-testid={DSFormLayoutBlockItemDataTestId.LABEL}\n htmlFor={inputID}\n leftLabel={leftLabel}\n hideLabel={hideLabel}\n aria-hidden={isGroup}\n {...othersGlobalAttributes}\n >\n {label}\n {(required || optional) && <StyledMark required={required} />}\n </StyledLabel>\n {maxCharCounter !== undefined && currentChar !== undefined ? (\n <StyledCharCount\n data-testid={DSFormLayoutBlockItemDataTestId.COUNTER}\n hasError={currentChar > maxCharCounter}\n >{`${currentChar}/${maxCharCounter}`}</StyledCharCount>\n ) : null}\n </Grid>\n {isGroup && <ScreenReaderOnly as=\"legend\">{`${label}. ${feedbackMessage || ''}`}</ScreenReaderOnly>}\n {children}\n {feedbackMessage && !hasError && (\n <StyledMessage\n data-testid={DSFormLayoutBlockItemDataTestId.MESSAGE}\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\n data-testid={DSFormLayoutBlockItemDataTestId.ERROR_MESSAGE}\n hasError={hasError}\n leftLabel={leftLabel}\n hideLabel={hideLabel}\n role=\"alert\"\n >\n <AlertsSmallFill width={8} height={8} color={['danger', 900]} />\n \n {validationMessage}\n </StyledMessage>\n )}\n </StyledContainer>\n );\n};\n\nDSFormLayoutBlockItem.propTypes = propTypes;\nDSFormLayoutBlockItem.displayName = 'DSFormLayoutBlockItem';\nconst DSFormLayoutBlockItemWithSchema = describe(DSFormLayoutBlockItem);\nDSFormLayoutBlockItemWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAA+B;AAC/B,qBAAqB;AACrB,0BAAyB;AACzB,iBAAoB;AACpB,sBAAgC;AAChC,6CAAgD;AAChD,uBAAkD;AAClD,oBAA2G;AAC3G,oCAAuC;AAEvC,MAAM,wBAAwB,CAAC,UAAwC;AACrE,QAAM;AAAA,IACJ,kBAAkB,KAAK,uBAAuB;AAAA,IAC9C;AAAA,IACA;AAAA,EACF,QAAI,sDAAuB,KAAK;AAChC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,kBAAc,sBAAQ,UAAM,gBAAI,CAAC,GAAG,CAAC,CAAC;AAE5C,QAAM,WAAO,sBAAQ,MAAO,mBAAmB,SAAY,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,GAAI,CAAC,cAAc,CAAC;AAEvG,SACE,6CAAC;AAAA,IACC,eAAa,uEAAgC;AAAA,IAC7C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,IAAI,UAAU,aAAa;AAAA,IAC3B;AAAA,IACA,oBAAkB,CAAC,UAAU,GAAG,WAAW,iCAAiC;AAAA,IAC3E,GAAG;AAAA,IACH,GAAG;AAAA,IAEJ;AAAA,mDAAC;AAAA,QAAK;AAAA,QAAY,QAAO;AAAA,QACvB;AAAA,uDAAC;AAAA,YACC,eAAa,uEAAgC;AAAA,YAC7C,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA,eAAa;AAAA,YACZ,GAAG;AAAA,YAEH;AAAA;AAAA,eACC,YAAY,aAAa,4CAAC;AAAA,gBAAW;AAAA,eAAoB;AAAA;AAAA,WAC7D;AAAA,UACC,mBAAmB,UAAa,gBAAgB,SAC/C,4CAAC;AAAA,YACC,eAAa,uEAAgC;AAAA,YAC7C,UAAU,cAAc;AAAA,YACxB,aAAG,eAAe;AAAA,WAAiB,IACnC;AAAA;AAAA,OACN;AAAA,MACC,WAAW,4CAAC;AAAA,QAAiB,IAAG;AAAA,QAAU,aAAG,UAAU,mBAAmB;AAAA,OAAK;AAAA,MAC/E;AAAA,MACA,mBAAmB,CAAC,YACnB,4CAAC;AAAA,QACC,eAAa,uEAAgC;AAAA,QAC7C;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QACb,IAAI,GAAG,WAAW;AAAA,QAEjB;AAAA,OACH;AAAA,MAED,qBAAqB,YACpB,6CAAC;AAAA,QACC,eAAa,uEAAgC;AAAA,QAC7C;AAAA,QACA;AAAA,QACA;AAAA,QACA,MAAK;AAAA,QAEL;AAAA,sDAAC;AAAA,YAAgB,OAAO;AAAA,YAAG,QAAQ;AAAA,YAAG,OAAO,CAAC,UAAU,GAAG;AAAA,WAAG;AAAA,UAAE;AAAA,UAE/D;AAAA;AAAA,OACH;AAAA;AAAA,GAEJ;AAEJ;AAEA,sBAAsB,YAAY;AAClC,sBAAsB,cAAc;AACpC,MAAM,sCAAkC,8BAAS,qBAAqB;AACtE,gCAAgC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,13 +22,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var
|
|
26
|
-
__export(
|
|
27
|
-
|
|
25
|
+
var useFormLayoutBlockItem_exports = {};
|
|
26
|
+
__export(useFormLayoutBlockItem_exports, {
|
|
27
|
+
useFormLayoutBlockItem: () => useFormLayoutBlockItem
|
|
28
28
|
});
|
|
29
|
-
module.exports = __toCommonJS(
|
|
29
|
+
module.exports = __toCommonJS(useFormLayoutBlockItem_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
var import_react = __toESM(require("react"));
|
|
32
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
33
|
+
var import_propTypes = require("../propTypes");
|
|
34
|
+
const useFormLayoutBlockItem = (props) => {
|
|
35
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(props, import_propTypes.propTypes);
|
|
36
|
+
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_propTypes.defaultProps);
|
|
37
|
+
const globalAttributes = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefault);
|
|
38
|
+
const xstyledProps = (0, import_ds_utilities.useGetXstyledProps)(propsWithDefault);
|
|
39
|
+
return import_react.default.useMemo(
|
|
40
|
+
() => ({ globalAttributes, xstyledProps, propsWithDefault }),
|
|
41
|
+
[globalAttributes, xstyledProps, propsWithDefault]
|
|
42
|
+
);
|
|
33
43
|
};
|
|
34
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=useFormLayoutBlockItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form-layout-block-item/config/useFormLayoutBlockItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-utilities';\n\nimport { propTypes, defaultProps, type DSFormLayoutBlockItemT } from '../propTypes';\n\ninterface UseFormLayoutBlockItemT {\n propsWithDefault: DSFormLayoutBlockItemT.InternalProps;\n globalAttributes: GlobalAttributesT;\n xstyledProps: XstyledProps;\n}\n\nexport const useFormLayoutBlockItem = (props: DSFormLayoutBlockItemT.Props): UseFormLayoutBlockItemT => {\n useValidateTypescriptPropTypes(props, propTypes);\n const propsWithDefault = useMemoMergePropsWithDefault<DSFormLayoutBlockItemT.InternalProps>(props, defaultProps);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n return React.useMemo(\n () => ({ globalAttributes, xstyledProps, propsWithDefault }),\n [globalAttributes, xstyledProps, propsWithDefault],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,0BAOO;AAEP,uBAAqE;AAQ9D,MAAM,yBAAyB,CAAC,UAAiE;AACtG,0DAA+B,OAAO,0BAAS;AAC/C,QAAM,uBAAmB,kDAAmE,OAAO,6BAAY;AAC/G,QAAM,uBAAmB,4CAAuB,gBAAgB;AAEhE,QAAM,mBAAe,wCAAmB,gBAAgB;AACxD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO,EAAE,kBAAkB,cAAc,iBAAiB;AAAA,IAC1D,CAAC,kBAAkB,cAAc,gBAAgB;AAAA,EACnD;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -24,17 +24,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
25
|
var propTypes_exports = {};
|
|
26
26
|
__export(propTypes_exports, {
|
|
27
|
+
defaultProps: () => defaultProps,
|
|
27
28
|
propTypes: () => propTypes
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(propTypes_exports);
|
|
30
31
|
var React = __toESM(require("react"));
|
|
31
32
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
33
|
+
const defaultProps = {
|
|
34
|
+
isGroup: false
|
|
35
|
+
};
|
|
32
36
|
const propTypes = {
|
|
37
|
+
...import_ds_utilities.globalAttributesPropTypes,
|
|
38
|
+
...import_ds_utilities.xstyledPropTypes,
|
|
33
39
|
children: import_ds_utilities.PropTypes.node.isRequired.description("Input component. "),
|
|
34
|
-
label: import_ds_utilities.PropTypes.string.
|
|
40
|
+
label: import_ds_utilities.PropTypes.string.description(
|
|
35
41
|
"Label property for the input component. This property is required for accesibility purposes."
|
|
36
42
|
),
|
|
37
|
-
inputID: import_ds_utilities.PropTypes.string.
|
|
43
|
+
inputID: import_ds_utilities.PropTypes.string.description(
|
|
38
44
|
"String that matches the input component's id. This property is required for accesibility purposes."
|
|
39
45
|
),
|
|
40
46
|
maxCharCounter: import_ds_utilities.PropTypes.number.description("Max of characters allowed."),
|
|
@@ -56,6 +62,7 @@ const propTypes = {
|
|
|
56
62
|
),
|
|
57
63
|
isGroup: import_ds_utilities.PropTypes.bool.description(
|
|
58
64
|
"Sets the HTML elements as fieldset and legend. This should be used when you want to group more than one input."
|
|
59
|
-
)
|
|
65
|
+
),
|
|
66
|
+
iconError: import_ds_utilities.PropTypes.bool.description("Adds icon error extra styling.")
|
|
60
67
|
};
|
|
61
68
|
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/form-layout-block-item/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n children: PropTypes.node.isRequired.description('Input component. '),\n label: PropTypes.string.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport const defaultProps = {\n isGroup: false,\n};\n\nexport declare namespace DSFormLayoutBlockItemT {\n export interface PropsOptional {\n maxCharCounter?: number;\n currentChar?: number;\n inputID: string;\n iconError: boolean;\n validationMessage?: string;\n feedbackMessage?: string;\n hasError?: boolean;\n leftLabel?: boolean;\n required?: boolean;\n fitContent?: boolean;\n optional?: boolean;\n hideLabel?: boolean;\n withHighlight?: boolean;\n }\n\n export interface DefaultProps {\n isGroup?: boolean;\n }\n\n export interface PropsRequired {\n children: JSX.Element;\n label: string;\n }\n\n export interface Props extends PropsOptional, PropsRequired, DefaultProps {}\n export interface InternalProps extends PropsOptional, PropsRequired, Required<DefaultProps> {}\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.node.isRequired.description('Input component. '),\n label: PropTypes.string.description(\n 'Label property for the input component. This property is required for accesibility purposes.',\n ),\n inputID: PropTypes.string.description(\n \"String that matches the input component's id. This property is required for accesibility purposes.\",\n ),\n maxCharCounter: PropTypes.number.description('Max of characters allowed.'),\n currentChar: PropTypes.number.description('Current counter of input text area'),\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 iconError: PropTypes.bool.description('Adds icon error extra styling.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAAuE;AAEhE,MAAM,eAAe;AAAA,EAC1B,SAAS;AACX;AAgCO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,8BAAU,KAAK,WAAW,YAAY,mBAAmB;AAAA,EACnE,OAAO,8BAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,SAAS,8BAAU,OAAO;AAAA,IACxB;AAAA,EACF;AAAA,EACA,gBAAgB,8BAAU,OAAO,YAAY,4BAA4B;AAAA,EACzE,aAAa,8BAAU,OAAO,YAAY,oCAAoC;AAAA,EAC9E,iBAAiB,8BAAU,OAAO,YAAY,qDAAqD;AAAA,EACnG,mBAAmB,8BAAU,OAAO;AAAA,IAClC;AAAA,EACF;AAAA,EACA,UAAU,8BAAU,KAAK,YAAY,qDAAqD;AAAA,EAC1F,UAAU,8BAAU,KAAK,YAAY,8BAA8B;AAAA,EACnE,UAAU,8BAAU,KAAK,YAAY,8BAA8B;AAAA,EACnE,YAAY,8BAAU,KAAK,YAAY,qDAAqD;AAAA,EAC5F,WAAW,8BAAU,KAAK,YAAY,oDAAoD;AAAA,EAC1F,WAAW,8BAAU,KAAK;AAAA,IACxB;AAAA,EACF;AAAA,EACA,eAAe,8BAAU,KAAK;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,SAAS,8BAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA,EACA,WAAW,8BAAU,KAAK,YAAY,gCAAgC;AACxE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -38,7 +38,11 @@ const StyledContainer = import_ds_system.styled.div`
|
|
|
38
38
|
position: relative;
|
|
39
39
|
padding: 0;
|
|
40
40
|
margin: 0;
|
|
41
|
+
padding-bottom: 4px;
|
|
41
42
|
display: grid;
|
|
43
|
+
${import_ds_system.layout}
|
|
44
|
+
${import_ds_system.space}
|
|
45
|
+
${import_ds_system.sizing}
|
|
42
46
|
${({ fitContent }) => fitContent ? "width: fit-content;" : void 0}
|
|
43
47
|
${({ isGroup }) => isGroup ? "border: none" : ""};
|
|
44
48
|
${({ leftLabel, hideLabel }) => leftLabel && !hideLabel ? "grid-template-columns: auto 1fr;" : void 0}
|
|
@@ -93,7 +97,7 @@ const StyledMessage = import_ds_system.styled.div`
|
|
|
93
97
|
font-size: ${({ theme }) => theme.fontSizes.microText[200]};
|
|
94
98
|
text-align: right;
|
|
95
99
|
line-height: 15px;
|
|
96
|
-
height:
|
|
100
|
+
height: 50px;
|
|
97
101
|
overflow: hidden;
|
|
98
102
|
text-overflow: ellipsis;
|
|
99
103
|
color: ${({ theme, hasError }) => hasError ? theme.colors.danger[900] : theme.colors.neutral[500]};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/form-layout-block-item/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { styled, space, sizing, layout } from '@elliemae/ds-system';\n\ninterface DSFormLayoutBlockItemStyledMessageT {\n hasError?: boolean;\n leftLabel?: boolean;\n hideLabel?: boolean;\n}\n\ninterface DSFormLayoutBlockItemStyledContainerT {\n leftLabel?: boolean;\n fitContent?: boolean;\n hideLabel?: boolean;\n withHighlight?: boolean;\n isGroup?: boolean;\n}\n\ninterface DSFormLayoutBlockItemStyledLabelT {\n leftLabel?: boolean;\n hideLabel?: boolean;\n}\n\ninterface DSFormLayoutBlockItemStyledMarkT {\n required?: boolean;\n}\n\n// interface DSFormLayoutBlockItemStyledIconErrorT {\n// iconError?: string;\n// }\n\ninterface DSFormLayoutBlockItemStyledCharCounterT {\n hasError?: boolean;\n}\nexport const StyledContainer = styled.div<DSFormLayoutBlockItemStyledContainerT>`\n position: relative;\n padding: 0;\n margin: 0;\n padding-bottom: 4px;\n display: grid;\n ${layout}\n ${space}\n ${sizing}\n ${({ fitContent }) => (fitContent ? 'width: fit-content;' : undefined)}\n ${({ isGroup }) => (isGroup ? 'border: none' : '')};\n ${({ leftLabel, hideLabel }) => (leftLabel && !hideLabel ? 'grid-template-columns: auto 1fr;' : 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 : 2px 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`;\nexport const StyledLabel = styled.label<DSFormLayoutBlockItemStyledLabelT>`\n display: flex;\n ${({ theme, leftLabel }) => (leftLabel ? `padding-right: ${theme.space.xxxs};` : 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`;\nexport const StyledMessage = styled.div<DSFormLayoutBlockItemStyledMessageT>`\n font-size: ${({ theme }) => theme.fontSizes.microText[200]};\n text-align: right;\n line-height: 15px;\n height: 50px;\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 padding-right: 1px;\n margin-right: -1px;\n font-style: normal;\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`;\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`;\nexport const StyledCharCount = styled.span<DSFormLayoutBlockItemStyledCharCounterT>`\njustify-self: flex-end;\nfont-size: ${({ theme }) => theme.fontSizes.microText[300]}\nmargin-left: 16px;\ncolor: ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[500])};\n`;\n// export const StyledErrorIcon = styled.span<DSFormLayoutBlockItemStyledIconErrorT>`\n// width: 8px;\n// height: 8px;\n// border-radius: 50%;\n// margin-right: ${({ theme }) => theme.space.xxxs};\n// color: ${({ theme }) => theme.colors.danger[900]};\n// `;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA8C;AAgCvC,MAAM,kBAAkB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlC;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,EAAE,WAAW,MAAO,aAAa,wBAAwB;AAAA,IAC1D,CAAC,EAAE,QAAQ,MAAO,UAAU,iBAAiB;AAAA,IAC7C,CAAC,EAAE,WAAW,UAAU,MAAO,aAAa,CAAC,YAAY,qCAAqC;AAAA;AAAA,IAE9F,CAAC,EAAE,OAAO,cAAc,MACxB,gBACI;AAAA;AAAA;AAAA;AAAA,iBAIS,MAAM,MAAM;AAAA,gBACb,MAAM,MAAM;AAAA;AAAA,6BAEC,MAAM,MAAM;AAAA,+BACV,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAWtB,MAAM,MAAM;AAAA,oBACb,MAAM,MAAM;AAAA;AAAA,iCAEC,MAAM,MAAM;AAAA,mCACV,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQvC;AAAA;AAED,MAAM,cAAc,wBAAO;AAAA;AAAA,IAE9B,CAAC,EAAE,OAAO,UAAU,MAAO,YAAY,kBAAkB,MAAM,MAAM,UAAU;AAAA,IAC/E,CAAC,EAAE,UAAU,MACb,YACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUA;AAAA;AAED,MAAM,gBAAgB,wBAAO;AAAA,eACrB,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAM7C,CAAC,EAAE,OAAO,SAAS,MAAO,WAAW,MAAM,OAAO,OAAO,OAAO,MAAM,OAAO,QAAQ;AAAA,IAC5F,CAAC,EAAE,WAAW,UAAU,MAAO,aAAa,CAAC,YAAY,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAK5E,MAAM,aAAa,wBAAO;AAAA;AAAA;AAAA;AAAA,iBAIhB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,IACxC,CAAC,EAAE,OAAO,SAAS,MACnB,WACI;AAAA,sBACc,MAAM,OAAO,OAAO;AAAA,MAElC;AAAA,sBACc,MAAM,OAAO,MAAM;AAAA;AAAA;AAGlC,MAAM,mBAAmB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShC,MAAM,kBAAkB,wBAAO;AAAA;AAAA,aAEzB,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,UAAU;AAAA;AAAA,SAE7C,CAAC,EAAE,OAAO,SAAS,MAAO,WAAW,MAAM,OAAO,OAAO,OAAO,MAAM,OAAO,QAAQ;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -31,18 +31,20 @@ module.exports = __toCommonJS(DSFormLayoutCheckboxGroup_exports);
|
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
34
|
-
var import_propTypes = require("./propTypes");
|
|
35
34
|
var import_styles = require("./styles");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
35
|
+
var import_propTypes = require("./propTypes");
|
|
36
|
+
var import_useFormLayoutCheckboxGroup = require("./config/useFormLayoutCheckboxGroup");
|
|
38
37
|
const DSFormLayoutCheckboxGroup = (props) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const {
|
|
39
|
+
globalAttributes: { ...othersGlobalAttributes },
|
|
40
|
+
xstyledProps,
|
|
41
|
+
propsWithDefault
|
|
42
|
+
} = (0, import_useFormLayoutCheckboxGroup.useFormLayoutCheckboxGroup)(props);
|
|
42
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledContainer, {
|
|
43
44
|
role: "group",
|
|
44
45
|
direction: propsWithDefault.direction,
|
|
45
|
-
...
|
|
46
|
+
...othersGlobalAttributes,
|
|
47
|
+
...xstyledProps,
|
|
46
48
|
children: propsWithDefault.children
|
|
47
49
|
});
|
|
48
50
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { StyledContainer } from './styles';\nimport { DSFormLayoutCheckboxGroupT, propTypes } from './propTypes';\nimport { useFormLayoutCheckboxGroup } from './config/useFormLayoutCheckboxGroup';\n\nconst DSFormLayoutCheckboxGroup = (props: DSFormLayoutCheckboxGroupT.Props): JSX.Element => {\n const {\n globalAttributes: { ...othersGlobalAttributes },\n xstyledProps,\n propsWithDefault,\n } = useFormLayoutCheckboxGroup(props);\n return (\n <StyledContainer role=\"group\" direction={propsWithDefault.direction} {...othersGlobalAttributes} {...xstyledProps}>\n {propsWithDefault.children}\n </StyledContainer>\n );\n};\n\nDSFormLayoutCheckboxGroup.propTypes = propTypes;\nDSFormLayoutCheckboxGroup.displayName = 'DSFormLayoutCheckboxGroup';\nconst DSFormLayoutCheckboxGroupWithSchema = describe(DSFormLayoutCheckboxGroup);\nDSFormLayoutCheckboxGroupWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutCheckboxGroup, DSFormLayoutCheckboxGroupWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,0BAAyB;AACzB,oBAAgC;AAChC,uBAAsD;AACtD,wCAA2C;AAE3C,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM;AAAA,IACJ,kBAAkB,KAAK,uBAAuB;AAAA,IAC9C;AAAA,IACA;AAAA,EACF,QAAI,8DAA2B,KAAK;AACpC,SACE,4CAAC;AAAA,IAAgB,MAAK;AAAA,IAAQ,WAAW,iBAAiB;AAAA,IAAY,GAAG;AAAA,IAAyB,GAAG;AAAA,IAClG,2BAAiB;AAAA,GACpB;AAEJ;AAEA,0BAA0B,YAAY;AACtC,0BAA0B,cAAc;AACxC,MAAM,0CAAsC,8BAAS,yBAAyB;AAC9E,oCAAoC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var useFormLayoutCheckboxGroup_exports = {};
|
|
26
|
+
__export(useFormLayoutCheckboxGroup_exports, {
|
|
27
|
+
useFormLayoutCheckboxGroup: () => useFormLayoutCheckboxGroup
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(useFormLayoutCheckboxGroup_exports);
|
|
30
|
+
var React = __toESM(require("react"));
|
|
31
|
+
var import_react = __toESM(require("react"));
|
|
32
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
33
|
+
var import_propTypes = require("../propTypes");
|
|
34
|
+
const useFormLayoutCheckboxGroup = (props) => {
|
|
35
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(props, import_propTypes.propTypes);
|
|
36
|
+
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_propTypes.defaultProps);
|
|
37
|
+
const globalAttributes = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefault);
|
|
38
|
+
const xstyledProps = (0, import_ds_utilities.useGetXstyledProps)(propsWithDefault);
|
|
39
|
+
return import_react.default.useMemo(
|
|
40
|
+
() => ({ globalAttributes, xstyledProps, propsWithDefault }),
|
|
41
|
+
[globalAttributes, xstyledProps, propsWithDefault]
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=useFormLayoutCheckboxGroup.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form-layout-checkbox-group/config/useFormLayoutCheckboxGroup.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-utilities';\n\nimport { propTypes, defaultProps, type DSFormLayoutCheckboxGroupT } from '../propTypes';\n\ninterface UseFormLayoutCheckboxGroupT {\n propsWithDefault: DSFormLayoutCheckboxGroupT.InternalProps;\n globalAttributes: GlobalAttributesT;\n xstyledProps: XstyledProps;\n}\n\nexport const useFormLayoutCheckboxGroup = (props: DSFormLayoutCheckboxGroupT.Props): UseFormLayoutCheckboxGroupT => {\n useValidateTypescriptPropTypes(props, propTypes);\n const propsWithDefault = useMemoMergePropsWithDefault<DSFormLayoutCheckboxGroupT.InternalProps>(props, defaultProps);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n return React.useMemo(\n () => ({ globalAttributes, xstyledProps, propsWithDefault }),\n [globalAttributes, xstyledProps, propsWithDefault],\n );\n};", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,0BAOO;AAEP,uBAAyE;AAQlE,MAAM,6BAA6B,CAAC,UAAyE;AAClH,0DAA+B,OAAO,0BAAS;AAC/C,QAAM,uBAAmB,kDAAuE,OAAO,6BAAY;AACnH,QAAM,uBAAmB,4CAAuB,gBAAgB;AAEhE,QAAM,mBAAe,wCAAmB,gBAAgB;AACxD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO,EAAE,kBAAkB,cAAc,iBAAiB;AAAA,IAC1D,CAAC,kBAAkB,cAAc,gBAAgB;AAAA,EACnD;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -24,13 +24,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
25
|
var propTypes_exports = {};
|
|
26
26
|
__export(propTypes_exports, {
|
|
27
|
+
defaultProps: () => defaultProps,
|
|
27
28
|
propTypes: () => propTypes
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(propTypes_exports);
|
|
30
31
|
var React = __toESM(require("react"));
|
|
31
32
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
33
|
+
const defaultProps = {
|
|
34
|
+
direction: "horizontal"
|
|
35
|
+
};
|
|
32
36
|
const propTypes = {
|
|
33
37
|
...import_ds_utilities.globalAttributesPropTypes,
|
|
38
|
+
...import_ds_utilities.xstyledPropTypes,
|
|
34
39
|
direction: import_ds_utilities.PropTypes.oneOf(["horizontal", "vertical"]).description("Set direction for the checkbox group.")
|
|
35
40
|
};
|
|
36
41
|
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/form-layout-checkbox-group/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n direction: PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport const defaultProps = {\n direction: 'horizontal',\n};\n\ntype DirectionsT = 'horizontal' | 'vertical';\n\nexport declare namespace DSFormLayoutCheckboxGroupT {\n export interface PropsRequired {\n direction: DirectionsT;\n children: JSX.Element;\n }\n\n export interface DefaultProps {\n direction?: string;\n }\n\n export interface Props extends PropsRequired, DefaultProps {}\n export interface InternalProps extends PropsRequired, Required<DefaultProps> {}\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n direction: PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAAuE;AAEhE,MAAM,eAAe;AAAA,EAC1B,WAAW;AACb;AAkBO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,WAAW,8BAAU,MAAM,CAAC,cAAc,UAAU,CAAC,EAAE,YAAY,uCAAuC;AAC5G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,6 +30,9 @@ module.exports = __toCommonJS(styles_exports);
|
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_ds_system = require("@elliemae/ds-system");
|
|
32
32
|
const StyledContainer = import_ds_system.styled.div`
|
|
33
|
+
${import_ds_system.layout}
|
|
34
|
+
${import_ds_system.space}
|
|
35
|
+
${import_ds_system.sizing}
|
|
33
36
|
display: inline-flex;
|
|
34
37
|
flex-wrap: wrap;
|
|
35
38
|
flex-direction: ${({ direction }) => direction === "horizontal" ? "row" : "column"};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/form-layout-checkbox-group/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { styled, layout, space, sizing } from '@elliemae/ds-system';\n\ntype DirectionsT = 'horizontal' | 'vertical';\n\ninterface DSControlledCheckboxGroupStyledContainerT {\n direction: DirectionsT;\n}\n\nexport const StyledContainer = styled.div<DSControlledCheckboxGroupStyledContainerT>`\n ${layout}\n ${space}\n ${sizing}\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:not([role='checkbox']) {\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA8C;AAQvC,MAAM,kBAAkB,wBAAO;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA,oBAGgB,CAAC,EAAE,UAAU,MAAO,cAAc,eAAe,QAAQ;AAAA,iBAC5D,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,kBAC1B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,gBAC7B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,qBAGtB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,oBAG5B,CAAC,EAAE,OAAO,UAAU,MAAO,cAAc,eAAe,MAAM,MAAM,IAAI;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,10 +4,17 @@ import { useMemo } from "react";
|
|
|
4
4
|
import { Grid } from "@elliemae/ds-grid";
|
|
5
5
|
import { describe } from "@elliemae/ds-utilities";
|
|
6
6
|
import { uid } from "uid";
|
|
7
|
+
import { AlertsSmallFill } from "@elliemae/ds-icons";
|
|
7
8
|
import { DSFormLayoutBlockItemDataTestId } from "../exported-related/DSFormLayoutBlockItemDataTestId";
|
|
8
9
|
import { propTypes } from "./propTypes";
|
|
9
10
|
import { StyledMessage, StyledLabel, StyledContainer, StyledMark, ScreenReaderOnly, StyledCharCount } from "./styles";
|
|
11
|
+
import { useFormLayoutBlockItem } from "./config/useFormLayoutBlockItem";
|
|
10
12
|
const DSFormLayoutBlockItem = (props) => {
|
|
13
|
+
const {
|
|
14
|
+
globalAttributes: { ...othersGlobalAttributes },
|
|
15
|
+
xstyledProps,
|
|
16
|
+
propsWithDefault
|
|
17
|
+
} = useFormLayoutBlockItem(props);
|
|
11
18
|
const {
|
|
12
19
|
label,
|
|
13
20
|
feedbackMessage,
|
|
@@ -23,8 +30,8 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
23
30
|
hideLabel,
|
|
24
31
|
fitContent,
|
|
25
32
|
withHighlight,
|
|
26
|
-
isGroup
|
|
27
|
-
} =
|
|
33
|
+
isGroup
|
|
34
|
+
} = propsWithDefault;
|
|
28
35
|
const instanceUID = useMemo(() => uid(6), []);
|
|
29
36
|
const cols = useMemo(() => maxCharCounter !== void 0 ? ["1fr", "auto"] : ["1fr"], [maxCharCounter]);
|
|
30
37
|
return /* @__PURE__ */ jsxs(StyledContainer, {
|
|
@@ -36,6 +43,8 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
36
43
|
as: isGroup ? "fieldset" : "div",
|
|
37
44
|
isGroup,
|
|
38
45
|
"aria-describedby": !isGroup ? `${inputID || instanceUID}_feedback_message` : void 0,
|
|
46
|
+
...othersGlobalAttributes,
|
|
47
|
+
...xstyledProps,
|
|
39
48
|
children: [
|
|
40
49
|
/* @__PURE__ */ jsxs(Grid, {
|
|
41
50
|
cols,
|
|
@@ -47,6 +56,7 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
47
56
|
leftLabel,
|
|
48
57
|
hideLabel,
|
|
49
58
|
"aria-hidden": isGroup,
|
|
59
|
+
...othersGlobalAttributes,
|
|
50
60
|
children: [
|
|
51
61
|
label,
|
|
52
62
|
(required || optional) && /* @__PURE__ */ jsx(StyledMark, {
|
|
@@ -74,13 +84,21 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
74
84
|
id: `${inputID || instanceUID}_feedback_message`,
|
|
75
85
|
children: feedbackMessage
|
|
76
86
|
}),
|
|
77
|
-
validationMessage && hasError && /* @__PURE__ */
|
|
87
|
+
validationMessage && hasError && /* @__PURE__ */ jsxs(StyledMessage, {
|
|
78
88
|
"data-testid": DSFormLayoutBlockItemDataTestId.ERROR_MESSAGE,
|
|
79
89
|
hasError,
|
|
80
90
|
leftLabel,
|
|
81
91
|
hideLabel,
|
|
82
92
|
role: "alert",
|
|
83
|
-
children:
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsx(AlertsSmallFill, {
|
|
95
|
+
width: 8,
|
|
96
|
+
height: 8,
|
|
97
|
+
color: ["danger", 900]
|
|
98
|
+
}),
|
|
99
|
+
"\xA0",
|
|
100
|
+
validationMessage
|
|
101
|
+
]
|
|
84
102
|
})
|
|
85
103
|
]
|
|
86
104
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-block-item/DSFormLayoutBlockItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useMemo } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,eAAe;AAC/B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAAS,WAAW;AACpB,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useMemo } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { AlertsSmallFill } from '@elliemae/ds-icons';\nimport { DSFormLayoutBlockItemDataTestId } from '../exported-related/DSFormLayoutBlockItemDataTestId';\nimport { DSFormLayoutBlockItemT, propTypes } from './propTypes';\nimport { StyledMessage, StyledLabel, StyledContainer, StyledMark, ScreenReaderOnly, StyledCharCount } from './styles';\nimport { useFormLayoutBlockItem } from './config/useFormLayoutBlockItem';\n\nconst DSFormLayoutBlockItem = (props: DSFormLayoutBlockItemT.Props) => {\n const {\n globalAttributes: { ...othersGlobalAttributes },\n xstyledProps,\n propsWithDefault,\n } = useFormLayoutBlockItem(props);\n const {\n label,\n feedbackMessage,\n maxCharCounter,\n currentChar,\n validationMessage,\n inputID,\n children,\n hasError,\n leftLabel,\n required,\n optional,\n hideLabel,\n fitContent,\n withHighlight,\n isGroup,\n } = propsWithDefault;\n\n const instanceUID = useMemo(() => uid(6), []);\n\n const cols = useMemo(() => (maxCharCounter !== undefined ? ['1fr', 'auto'] : ['1fr']), [maxCharCounter]);\n\n return (\n <StyledContainer\n data-testid={DSFormLayoutBlockItemDataTestId.CONTAINER}\n leftLabel={leftLabel}\n fitContent={fitContent}\n hideLabel={hideLabel}\n withHighlight={withHighlight}\n as={isGroup ? 'fieldset' : 'div'}\n isGroup={isGroup}\n aria-describedby={!isGroup ? `${inputID || instanceUID}_feedback_message` : undefined}\n {...othersGlobalAttributes}\n {...xstyledProps}\n >\n <Grid cols={cols} gutter=\"xxs\">\n <StyledLabel\n data-testid={DSFormLayoutBlockItemDataTestId.LABEL}\n htmlFor={inputID}\n leftLabel={leftLabel}\n hideLabel={hideLabel}\n aria-hidden={isGroup}\n {...othersGlobalAttributes}\n >\n {label}\n {(required || optional) && <StyledMark required={required} />}\n </StyledLabel>\n {maxCharCounter !== undefined && currentChar !== undefined ? (\n <StyledCharCount\n data-testid={DSFormLayoutBlockItemDataTestId.COUNTER}\n hasError={currentChar > maxCharCounter}\n >{`${currentChar}/${maxCharCounter}`}</StyledCharCount>\n ) : null}\n </Grid>\n {isGroup && <ScreenReaderOnly as=\"legend\">{`${label}. ${feedbackMessage || ''}`}</ScreenReaderOnly>}\n {children}\n {feedbackMessage && !hasError && (\n <StyledMessage\n data-testid={DSFormLayoutBlockItemDataTestId.MESSAGE}\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\n data-testid={DSFormLayoutBlockItemDataTestId.ERROR_MESSAGE}\n hasError={hasError}\n leftLabel={leftLabel}\n hideLabel={hideLabel}\n role=\"alert\"\n >\n <AlertsSmallFill width={8} height={8} color={['danger', 900]} />\n \n {validationMessage}\n </StyledMessage>\n )}\n </StyledContainer>\n );\n};\n\nDSFormLayoutBlockItem.propTypes = propTypes;\nDSFormLayoutBlockItem.displayName = 'DSFormLayoutBlockItem';\nconst DSFormLayoutBlockItemWithSchema = describe(DSFormLayoutBlockItem);\nDSFormLayoutBlockItemWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,eAAe;AAC/B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAAS,WAAW;AACpB,SAAS,uBAAuB;AAChC,SAAS,uCAAuC;AAChD,SAAiC,iBAAiB;AAClD,SAAS,eAAe,aAAa,iBAAiB,YAAY,kBAAkB,uBAAuB;AAC3G,SAAS,8BAA8B;AAEvC,MAAM,wBAAwB,CAAC,UAAwC;AACrE,QAAM;AAAA,IACJ,kBAAkB,KAAK,uBAAuB;AAAA,IAC9C;AAAA,IACA;AAAA,EACF,IAAI,uBAAuB,KAAK;AAChC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,cAAc,QAAQ,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;AAE5C,QAAM,OAAO,QAAQ,MAAO,mBAAmB,SAAY,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,GAAI,CAAC,cAAc,CAAC;AAEvG,SACE,qBAAC;AAAA,IACC,eAAa,gCAAgC;AAAA,IAC7C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,IAAI,UAAU,aAAa;AAAA,IAC3B;AAAA,IACA,oBAAkB,CAAC,UAAU,GAAG,WAAW,iCAAiC;AAAA,IAC3E,GAAG;AAAA,IACH,GAAG;AAAA,IAEJ;AAAA,2BAAC;AAAA,QAAK;AAAA,QAAY,QAAO;AAAA,QACvB;AAAA,+BAAC;AAAA,YACC,eAAa,gCAAgC;AAAA,YAC7C,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA,eAAa;AAAA,YACZ,GAAG;AAAA,YAEH;AAAA;AAAA,eACC,YAAY,aAAa,oBAAC;AAAA,gBAAW;AAAA,eAAoB;AAAA;AAAA,WAC7D;AAAA,UACC,mBAAmB,UAAa,gBAAgB,SAC/C,oBAAC;AAAA,YACC,eAAa,gCAAgC;AAAA,YAC7C,UAAU,cAAc;AAAA,YACxB,aAAG,eAAe;AAAA,WAAiB,IACnC;AAAA;AAAA,OACN;AAAA,MACC,WAAW,oBAAC;AAAA,QAAiB,IAAG;AAAA,QAAU,aAAG,UAAU,mBAAmB;AAAA,OAAK;AAAA,MAC/E;AAAA,MACA,mBAAmB,CAAC,YACnB,oBAAC;AAAA,QACC,eAAa,gCAAgC;AAAA,QAC7C;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QACb,IAAI,GAAG,WAAW;AAAA,QAEjB;AAAA,OACH;AAAA,MAED,qBAAqB,YACpB,qBAAC;AAAA,QACC,eAAa,gCAAgC;AAAA,QAC7C;AAAA,QACA;AAAA,QACA;AAAA,QACA,MAAK;AAAA,QAEL;AAAA,8BAAC;AAAA,YAAgB,OAAO;AAAA,YAAG,QAAQ;AAAA,YAAG,OAAO,CAAC,UAAU,GAAG;AAAA,WAAG;AAAA,UAAE;AAAA,UAE/D;AAAA;AAAA,OACH;AAAA;AAAA,GAEJ;AAEJ;AAEA,sBAAsB,YAAY;AAClC,sBAAsB,cAAc;AACpC,MAAM,kCAAkC,SAAS,qBAAqB;AACtE,gCAAgC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import {
|
|
4
|
+
useGetGlobalAttributes,
|
|
5
|
+
useGetXstyledProps,
|
|
6
|
+
useMemoMergePropsWithDefault,
|
|
7
|
+
useValidateTypescriptPropTypes
|
|
8
|
+
} from "@elliemae/ds-utilities";
|
|
9
|
+
import { propTypes, defaultProps } from "../propTypes";
|
|
10
|
+
const useFormLayoutBlockItem = (props) => {
|
|
11
|
+
useValidateTypescriptPropTypes(props, propTypes);
|
|
12
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
13
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefault);
|
|
14
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
15
|
+
return React2.useMemo(
|
|
16
|
+
() => ({ globalAttributes, xstyledProps, propsWithDefault }),
|
|
17
|
+
[globalAttributes, xstyledProps, propsWithDefault]
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
useFormLayoutBlockItem
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useFormLayoutBlockItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/form-layout-block-item/config/useFormLayoutBlockItem.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-utilities';\n\nimport { propTypes, defaultProps, type DSFormLayoutBlockItemT } from '../propTypes';\n\ninterface UseFormLayoutBlockItemT {\n propsWithDefault: DSFormLayoutBlockItemT.InternalProps;\n globalAttributes: GlobalAttributesT;\n xstyledProps: XstyledProps;\n}\n\nexport const useFormLayoutBlockItem = (props: DSFormLayoutBlockItemT.Props): UseFormLayoutBlockItemT => {\n useValidateTypescriptPropTypes(props, propTypes);\n const propsWithDefault = useMemoMergePropsWithDefault<DSFormLayoutBlockItemT.InternalProps>(props, defaultProps);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n return React.useMemo(\n () => ({ globalAttributes, xstyledProps, propsWithDefault }),\n [globalAttributes, xstyledProps, propsWithDefault],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,WAAW,oBAAiD;AAQ9D,MAAM,yBAAyB,CAAC,UAAiE;AACtG,iCAA+B,OAAO,SAAS;AAC/C,QAAM,mBAAmB,6BAAmE,OAAO,YAAY;AAC/G,QAAM,mBAAmB,uBAAuB,gBAAgB;AAEhE,QAAM,eAAe,mBAAmB,gBAAgB;AACxD,SAAOA,OAAM;AAAA,IACX,OAAO,EAAE,kBAAkB,cAAc,iBAAiB;AAAA,IAC1D,CAAC,kBAAkB,cAAc,gBAAgB;AAAA,EACnD;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PropTypes } from "@elliemae/ds-utilities";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-utilities";
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
isGroup: false
|
|
5
|
+
};
|
|
3
6
|
const propTypes = {
|
|
7
|
+
...globalAttributesPropTypes,
|
|
8
|
+
...xstyledPropTypes,
|
|
4
9
|
children: PropTypes.node.isRequired.description("Input component. "),
|
|
5
|
-
label: PropTypes.string.
|
|
10
|
+
label: PropTypes.string.description(
|
|
6
11
|
"Label property for the input component. This property is required for accesibility purposes."
|
|
7
12
|
),
|
|
8
|
-
inputID: PropTypes.string.
|
|
13
|
+
inputID: PropTypes.string.description(
|
|
9
14
|
"String that matches the input component's id. This property is required for accesibility purposes."
|
|
10
15
|
),
|
|
11
16
|
maxCharCounter: PropTypes.number.description("Max of characters allowed."),
|
|
@@ -27,9 +32,11 @@ const propTypes = {
|
|
|
27
32
|
),
|
|
28
33
|
isGroup: PropTypes.bool.description(
|
|
29
34
|
"Sets the HTML elements as fieldset and legend. This should be used when you want to group more than one input."
|
|
30
|
-
)
|
|
35
|
+
),
|
|
36
|
+
iconError: PropTypes.bool.description("Adds icon error extra styling.")
|
|
31
37
|
};
|
|
32
38
|
export {
|
|
39
|
+
defaultProps,
|
|
33
40
|
propTypes
|
|
34
41
|
};
|
|
35
42
|
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-block-item/propTypes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n children: PropTypes.node.isRequired.description('Input component. '),\n label: PropTypes.string.
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport const defaultProps = {\n isGroup: false,\n};\n\nexport declare namespace DSFormLayoutBlockItemT {\n export interface PropsOptional {\n maxCharCounter?: number;\n currentChar?: number;\n inputID: string;\n iconError: boolean;\n validationMessage?: string;\n feedbackMessage?: string;\n hasError?: boolean;\n leftLabel?: boolean;\n required?: boolean;\n fitContent?: boolean;\n optional?: boolean;\n hideLabel?: boolean;\n withHighlight?: boolean;\n }\n\n export interface DefaultProps {\n isGroup?: boolean;\n }\n\n export interface PropsRequired {\n children: JSX.Element;\n label: string;\n }\n\n export interface Props extends PropsOptional, PropsRequired, DefaultProps {}\n export interface InternalProps extends PropsOptional, PropsRequired, Required<DefaultProps> {}\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.node.isRequired.description('Input component. '),\n label: PropTypes.string.description(\n 'Label property for the input component. This property is required for accesibility purposes.',\n ),\n inputID: PropTypes.string.description(\n \"String that matches the input component's id. This property is required for accesibility purposes.\",\n ),\n maxCharCounter: PropTypes.number.description('Max of characters allowed.'),\n currentChar: PropTypes.number.description('Current counter of input text area'),\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 iconError: PropTypes.bool.description('Adds icon error extra styling.'),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,2BAA2B,wBAAwB;AAEhE,MAAM,eAAe;AAAA,EAC1B,SAAS;AACX;AAgCO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU,KAAK,WAAW,YAAY,mBAAmB;AAAA,EACnE,OAAO,UAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,SAAS,UAAU,OAAO;AAAA,IACxB;AAAA,EACF;AAAA,EACA,gBAAgB,UAAU,OAAO,YAAY,4BAA4B;AAAA,EACzE,aAAa,UAAU,OAAO,YAAY,oCAAoC;AAAA,EAC9E,iBAAiB,UAAU,OAAO,YAAY,qDAAqD;AAAA,EACnG,mBAAmB,UAAU,OAAO;AAAA,IAClC;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,qDAAqD;AAAA,EAC1F,UAAU,UAAU,KAAK,YAAY,8BAA8B;AAAA,EACnE,UAAU,UAAU,KAAK,YAAY,8BAA8B;AAAA,EACnE,YAAY,UAAU,KAAK,YAAY,qDAAqD;AAAA,EAC5F,WAAW,UAAU,KAAK,YAAY,oDAAoD;AAAA,EAC1F,WAAW,UAAU,KAAK;AAAA,IACxB;AAAA,EACF;AAAA,EACA,eAAe,UAAU,KAAK;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,SAAS,UAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA,EACA,WAAW,UAAU,KAAK,YAAY,gCAAgC;AACxE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { styled } from "@elliemae/ds-system";
|
|
2
|
+
import { styled, space, sizing, layout } from "@elliemae/ds-system";
|
|
3
3
|
const StyledContainer = styled.div`
|
|
4
4
|
position: relative;
|
|
5
5
|
padding: 0;
|
|
6
6
|
margin: 0;
|
|
7
|
+
padding-bottom: 4px;
|
|
7
8
|
display: grid;
|
|
9
|
+
${layout}
|
|
10
|
+
${space}
|
|
11
|
+
${sizing}
|
|
8
12
|
${({ fitContent }) => fitContent ? "width: fit-content;" : void 0}
|
|
9
13
|
${({ isGroup }) => isGroup ? "border: none" : ""};
|
|
10
14
|
${({ leftLabel, hideLabel }) => leftLabel && !hideLabel ? "grid-template-columns: auto 1fr;" : void 0}
|
|
@@ -59,7 +63,7 @@ const StyledMessage = styled.div`
|
|
|
59
63
|
font-size: ${({ theme }) => theme.fontSizes.microText[200]};
|
|
60
64
|
text-align: right;
|
|
61
65
|
line-height: 15px;
|
|
62
|
-
height:
|
|
66
|
+
height: 50px;
|
|
63
67
|
overflow: hidden;
|
|
64
68
|
text-overflow: ellipsis;
|
|
65
69
|
color: ${({ theme, hasError }) => hasError ? theme.colors.danger[900] : theme.colors.neutral[500]};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-block-item/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, space, sizing, layout } from '@elliemae/ds-system';\n\ninterface DSFormLayoutBlockItemStyledMessageT {\n hasError?: boolean;\n leftLabel?: boolean;\n hideLabel?: boolean;\n}\n\ninterface DSFormLayoutBlockItemStyledContainerT {\n leftLabel?: boolean;\n fitContent?: boolean;\n hideLabel?: boolean;\n withHighlight?: boolean;\n isGroup?: boolean;\n}\n\ninterface DSFormLayoutBlockItemStyledLabelT {\n leftLabel?: boolean;\n hideLabel?: boolean;\n}\n\ninterface DSFormLayoutBlockItemStyledMarkT {\n required?: boolean;\n}\n\n// interface DSFormLayoutBlockItemStyledIconErrorT {\n// iconError?: string;\n// }\n\ninterface DSFormLayoutBlockItemStyledCharCounterT {\n hasError?: boolean;\n}\nexport const StyledContainer = styled.div<DSFormLayoutBlockItemStyledContainerT>`\n position: relative;\n padding: 0;\n margin: 0;\n padding-bottom: 4px;\n display: grid;\n ${layout}\n ${space}\n ${sizing}\n ${({ fitContent }) => (fitContent ? 'width: fit-content;' : undefined)}\n ${({ isGroup }) => (isGroup ? 'border: none' : '')};\n ${({ leftLabel, hideLabel }) => (leftLabel && !hideLabel ? 'grid-template-columns: auto 1fr;' : 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 : 2px 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`;\nexport const StyledLabel = styled.label<DSFormLayoutBlockItemStyledLabelT>`\n display: flex;\n ${({ theme, leftLabel }) => (leftLabel ? `padding-right: ${theme.space.xxxs};` : 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`;\nexport const StyledMessage = styled.div<DSFormLayoutBlockItemStyledMessageT>`\n font-size: ${({ theme }) => theme.fontSizes.microText[200]};\n text-align: right;\n line-height: 15px;\n height: 50px;\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 padding-right: 1px;\n margin-right: -1px;\n font-style: normal;\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`;\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`;\nexport const StyledCharCount = styled.span<DSFormLayoutBlockItemStyledCharCounterT>`\njustify-self: flex-end;\nfont-size: ${({ theme }) => theme.fontSizes.microText[300]}\nmargin-left: 16px;\ncolor: ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[500])};\n`;\n// export const StyledErrorIcon = styled.span<DSFormLayoutBlockItemStyledIconErrorT>`\n// width: 8px;\n// height: 8px;\n// border-radius: 50%;\n// margin-right: ${({ theme }) => theme.space.xxxs};\n// color: ${({ theme }) => theme.colors.danger[900]};\n// `;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,OAAO,QAAQ,cAAc;AAgCvC,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlC;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,EAAE,WAAW,MAAO,aAAa,wBAAwB;AAAA,IAC1D,CAAC,EAAE,QAAQ,MAAO,UAAU,iBAAiB;AAAA,IAC7C,CAAC,EAAE,WAAW,UAAU,MAAO,aAAa,CAAC,YAAY,qCAAqC;AAAA;AAAA,IAE9F,CAAC,EAAE,OAAO,cAAc,MACxB,gBACI;AAAA;AAAA;AAAA;AAAA,iBAIS,MAAM,MAAM;AAAA,gBACb,MAAM,MAAM;AAAA;AAAA,6BAEC,MAAM,MAAM;AAAA,+BACV,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAWtB,MAAM,MAAM;AAAA,oBACb,MAAM,MAAM;AAAA;AAAA,iCAEC,MAAM,MAAM;AAAA,mCACV,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQvC;AAAA;AAED,MAAM,cAAc,OAAO;AAAA;AAAA,IAE9B,CAAC,EAAE,OAAO,UAAU,MAAO,YAAY,kBAAkB,MAAM,MAAM,UAAU;AAAA,IAC/E,CAAC,EAAE,UAAU,MACb,YACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUA;AAAA;AAED,MAAM,gBAAgB,OAAO;AAAA,eACrB,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAM7C,CAAC,EAAE,OAAO,SAAS,MAAO,WAAW,MAAM,OAAO,OAAO,OAAO,MAAM,OAAO,QAAQ;AAAA,IAC5F,CAAC,EAAE,WAAW,UAAU,MAAO,aAAa,CAAC,YAAY,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAK5E,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;AAAA,iBAIhB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,IACxC,CAAC,EAAE,OAAO,SAAS,MACnB,WACI;AAAA,sBACc,MAAM,OAAO,OAAO;AAAA,MAElC;AAAA,sBACc,MAAM,OAAO,MAAM;AAAA;AAAA;AAGlC,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShC,MAAM,kBAAkB,OAAO;AAAA;AAAA,aAEzB,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,UAAU;AAAA;AAAA,SAE7C,CAAC,EAAE,OAAO,SAAS,MAAO,WAAW,MAAM,OAAO,OAAO,OAAO,MAAM,OAAO,QAAQ;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { describe
|
|
4
|
-
import { propTypes } from "./propTypes";
|
|
3
|
+
import { describe } from "@elliemae/ds-utilities";
|
|
5
4
|
import { StyledContainer } from "./styles";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { propTypes } from "./propTypes";
|
|
6
|
+
import { useFormLayoutCheckboxGroup } from "./config/useFormLayoutCheckboxGroup";
|
|
8
7
|
const DSFormLayoutCheckboxGroup = (props) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const {
|
|
9
|
+
globalAttributes: { ...othersGlobalAttributes },
|
|
10
|
+
xstyledProps,
|
|
11
|
+
propsWithDefault
|
|
12
|
+
} = useFormLayoutCheckboxGroup(props);
|
|
12
13
|
return /* @__PURE__ */ jsx(StyledContainer, {
|
|
13
14
|
role: "group",
|
|
14
15
|
direction: propsWithDefault.direction,
|
|
15
|
-
...
|
|
16
|
+
...othersGlobalAttributes,
|
|
17
|
+
...xstyledProps,
|
|
16
18
|
children: propsWithDefault.children
|
|
17
19
|
});
|
|
18
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { StyledContainer } from './styles';\nimport { DSFormLayoutCheckboxGroupT, propTypes } from './propTypes';\nimport { useFormLayoutCheckboxGroup } from './config/useFormLayoutCheckboxGroup';\n\nconst DSFormLayoutCheckboxGroup = (props: DSFormLayoutCheckboxGroupT.Props): JSX.Element => {\n const {\n globalAttributes: { ...othersGlobalAttributes },\n xstyledProps,\n propsWithDefault,\n } = useFormLayoutCheckboxGroup(props);\n return (\n <StyledContainer role=\"group\" direction={propsWithDefault.direction} {...othersGlobalAttributes} {...xstyledProps}>\n {propsWithDefault.children}\n </StyledContainer>\n );\n};\n\nDSFormLayoutCheckboxGroup.propTypes = propTypes;\nDSFormLayoutCheckboxGroup.displayName = 'DSFormLayoutCheckboxGroup';\nconst DSFormLayoutCheckboxGroupWithSchema = describe(DSFormLayoutCheckboxGroup);\nDSFormLayoutCheckboxGroupWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutCheckboxGroup, DSFormLayoutCheckboxGroupWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAqC,iBAAiB;AACtD,SAAS,kCAAkC;AAE3C,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM;AAAA,IACJ,kBAAkB,KAAK,uBAAuB;AAAA,IAC9C;AAAA,IACA;AAAA,EACF,IAAI,2BAA2B,KAAK;AACpC,SACE,oBAAC;AAAA,IAAgB,MAAK;AAAA,IAAQ,WAAW,iBAAiB;AAAA,IAAY,GAAG;AAAA,IAAyB,GAAG;AAAA,IAClG,2BAAiB;AAAA,GACpB;AAEJ;AAEA,0BAA0B,YAAY;AACtC,0BAA0B,cAAc;AACxC,MAAM,sCAAsC,SAAS,yBAAyB;AAC9E,oCAAoC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import {
|
|
4
|
+
useGetGlobalAttributes,
|
|
5
|
+
useGetXstyledProps,
|
|
6
|
+
useMemoMergePropsWithDefault,
|
|
7
|
+
useValidateTypescriptPropTypes
|
|
8
|
+
} from "@elliemae/ds-utilities";
|
|
9
|
+
import { propTypes, defaultProps } from "../propTypes";
|
|
10
|
+
const useFormLayoutCheckboxGroup = (props) => {
|
|
11
|
+
useValidateTypescriptPropTypes(props, propTypes);
|
|
12
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
13
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefault);
|
|
14
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
15
|
+
return React2.useMemo(
|
|
16
|
+
() => ({ globalAttributes, xstyledProps, propsWithDefault }),
|
|
17
|
+
[globalAttributes, xstyledProps, propsWithDefault]
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
useFormLayoutCheckboxGroup
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useFormLayoutCheckboxGroup.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/form-layout-checkbox-group/config/useFormLayoutCheckboxGroup.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-utilities';\n\nimport { propTypes, defaultProps, type DSFormLayoutCheckboxGroupT } from '../propTypes';\n\ninterface UseFormLayoutCheckboxGroupT {\n propsWithDefault: DSFormLayoutCheckboxGroupT.InternalProps;\n globalAttributes: GlobalAttributesT;\n xstyledProps: XstyledProps;\n}\n\nexport const useFormLayoutCheckboxGroup = (props: DSFormLayoutCheckboxGroupT.Props): UseFormLayoutCheckboxGroupT => {\n useValidateTypescriptPropTypes(props, propTypes);\n const propsWithDefault = useMemoMergePropsWithDefault<DSFormLayoutCheckboxGroupT.InternalProps>(props, defaultProps);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n return React.useMemo(\n () => ({ globalAttributes, xstyledProps, propsWithDefault }),\n [globalAttributes, xstyledProps, propsWithDefault],\n );\n};"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,WAAW,oBAAqD;AAQlE,MAAM,6BAA6B,CAAC,UAAyE;AAClH,iCAA+B,OAAO,SAAS;AAC/C,QAAM,mBAAmB,6BAAuE,OAAO,YAAY;AACnH,QAAM,mBAAmB,uBAAuB,gBAAgB;AAEhE,QAAM,eAAe,mBAAmB,gBAAgB;AACxD,SAAOA,OAAM;AAAA,IACX,OAAO,EAAE,kBAAkB,cAAc,iBAAiB;AAAA,IAC1D,CAAC,kBAAkB,cAAc,gBAAgB;AAAA,EACnD;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PropTypes, globalAttributesPropTypes } from "@elliemae/ds-utilities";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-utilities";
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
direction: "horizontal"
|
|
5
|
+
};
|
|
3
6
|
const propTypes = {
|
|
4
7
|
...globalAttributesPropTypes,
|
|
8
|
+
...xstyledPropTypes,
|
|
5
9
|
direction: PropTypes.oneOf(["horizontal", "vertical"]).description("Set direction for the checkbox group.")
|
|
6
10
|
};
|
|
7
11
|
export {
|
|
12
|
+
defaultProps,
|
|
8
13
|
propTypes
|
|
9
14
|
};
|
|
10
15
|
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-checkbox-group/propTypes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n direction: PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.'),\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport const defaultProps = {\n direction: 'horizontal',\n};\n\ntype DirectionsT = 'horizontal' | 'vertical';\n\nexport declare namespace DSFormLayoutCheckboxGroupT {\n export interface PropsRequired {\n direction: DirectionsT;\n children: JSX.Element;\n }\n\n export interface DefaultProps {\n direction?: string;\n }\n\n export interface Props extends PropsRequired, DefaultProps {}\n export interface InternalProps extends PropsRequired, Required<DefaultProps> {}\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n direction: PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.'),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,2BAA2B,wBAAwB;AAEhE,MAAM,eAAe;AAAA,EAC1B,WAAW;AACb;AAkBO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,WAAW,UAAU,MAAM,CAAC,cAAc,UAAU,CAAC,EAAE,YAAY,uCAAuC;AAC5G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { styled } from "@elliemae/ds-system";
|
|
2
|
+
import { styled, layout, space, sizing } from "@elliemae/ds-system";
|
|
3
3
|
const StyledContainer = styled.div`
|
|
4
|
+
${layout}
|
|
5
|
+
${space}
|
|
6
|
+
${sizing}
|
|
4
7
|
display: inline-flex;
|
|
5
8
|
flex-wrap: wrap;
|
|
6
9
|
flex-direction: ${({ direction }) => direction === "horizontal" ? "row" : "column"};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-checkbox-group/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, layout, space, sizing } from '@elliemae/ds-system';\n\ntype DirectionsT = 'horizontal' | 'vertical';\n\ninterface DSControlledCheckboxGroupStyledContainerT {\n direction: DirectionsT;\n}\n\nexport const StyledContainer = styled.div<DSControlledCheckboxGroupStyledContainerT>`\n ${layout}\n ${space}\n ${sizing}\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:not([role='checkbox']) {\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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,QAAQ,OAAO,cAAc;AAQvC,MAAM,kBAAkB,OAAO;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA,oBAGgB,CAAC,EAAE,UAAU,MAAO,cAAc,eAAe,QAAQ;AAAA,iBAC5D,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,kBAC1B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,gBAC7B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,qBAGtB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,oBAG5B,CAAC,EAAE,OAAO,UAAU,MAAO,cAAc,eAAe,MAAM,MAAM,IAAI;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-layout-blocks",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-next.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Form Layout",
|
|
6
6
|
"files": [
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"indent": 4
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@elliemae/ds-system": "3.
|
|
79
|
-
"@elliemae/ds-utilities": "3.
|
|
78
|
+
"@elliemae/ds-system": "3.6.0-next.1",
|
|
79
|
+
"@elliemae/ds-utilities": "3.6.0-next.1",
|
|
80
80
|
"uid": "~2.0.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
-
mod
|
|
19
|
-
));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
var index_d_exports = {};
|
|
22
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
23
|
-
var React = __toESM(require("react"));
|
|
24
|
-
//# sourceMappingURL=index.d.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/form-layout-block-item/index.d.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export interface DSFormLayoutBlockItemPropsT {\n children: JSX.Element;\n label: string;\n maxCharCounter?: number;\n currentChar?: number;\n inputID: string;\n validationMessage?: string;\n feedbackMessage?: string;\n hasError?: boolean;\n leftLabel?: boolean;\n required?: boolean;\n fitContent?: boolean;\n optional?: boolean;\n hideLabel?: boolean;\n withHighlight?: boolean;\n isGroup?: boolean;\n}\n\nexport interface DSFormLayoutBlockItemStyledMessageT {\n hasError?: boolean;\n leftLabel?: boolean;\n hideLabel?: boolean;\n}\n\nexport interface DSFormLayoutBlockItemStyledContainerT {\n leftLabel?: boolean;\n fitContent?: boolean;\n hideLabel?: boolean;\n withHighlight?: boolean;\n isGroup?: boolean;\n}\n\nexport interface DSFormLayoutBlockItemStyledLabelT {\n leftLabel?: boolean;\n hideLabel?: boolean;\n}\n\nexport interface DSFormLayoutBlockItemStyledMarkT {\n required?: boolean;\n}\n\nexport interface DSFormLayoutBlockItemStyledCharCounterT {\n hasError?: boolean;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var useValidateProps_exports = {};
|
|
26
|
-
__export(useValidateProps_exports, {
|
|
27
|
-
useValidateProps: () => useValidateProps
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(useValidateProps_exports);
|
|
30
|
-
var React = __toESM(require("react"));
|
|
31
|
-
var import_react = __toESM(require("react"));
|
|
32
|
-
const getVariableType = (arg) => {
|
|
33
|
-
if (Array.isArray(arg))
|
|
34
|
-
return "array";
|
|
35
|
-
if (arg === null)
|
|
36
|
-
return "null";
|
|
37
|
-
if (arg === void 0)
|
|
38
|
-
return "undefined";
|
|
39
|
-
return typeof arg;
|
|
40
|
-
};
|
|
41
|
-
const throwCheckboxGroupDirectionError = (invalidProp) => {
|
|
42
|
-
throw new Error(
|
|
43
|
-
`You are trying to pass a not valid "direction" property value for a checkbox group, please provide a valid type.
|
|
44
|
-
|
|
45
|
-
Received: ${invalidProp} (${getVariableType(invalidProp)})
|
|
46
|
-
Expected: "horizontal" or "vertical" (string)
|
|
47
|
-
`
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
const throwCheckboxGroupChildrenError = () => {
|
|
51
|
-
throw new Error(
|
|
52
|
-
`You are trying to use a checkbox group without any React children, please provide at least one children to use.
|
|
53
|
-
|
|
54
|
-
Received: (null)
|
|
55
|
-
Expected: React children
|
|
56
|
-
`
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
const useValidateProps = (props) => {
|
|
60
|
-
if (props.direction !== void 0 && props.direction !== "vertical" && props.direction !== "horizontal") {
|
|
61
|
-
throwCheckboxGroupDirectionError(props.direction);
|
|
62
|
-
}
|
|
63
|
-
if (!import_react.default.Children.count(props.children)) {
|
|
64
|
-
throwCheckboxGroupChildrenError();
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/form-layout-checkbox-group/config/useValidateProps.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAGlB,MAAM,kBAAkB,CAAC,QAAyB;AAChD,MAAI,MAAM,QAAQ,GAAG;AAAG,WAAO;AAC/B,MAAI,QAAQ;AAAM,WAAO;AACzB,MAAI,QAAQ;AAAW,WAAO;AAC9B,SAAO,OAAO;AAChB;AAEA,MAAM,mCAAmC,CAAC,gBAA+B;AACvE,QAAM,IAAI;AAAA,IACR;AAAA;AAAA,cAEU,gBAAgB,gBAAgB,WAAW;AAAA;AAAA;AAAA,EAGvD;AACF;AAEA,MAAM,kCAAkC,MAAY;AAClD,QAAM,IAAI;AAAA,IACR;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF;AACF;AAEO,MAAM,mBAAmB,CAAC,UAA4C;AAC3E,MAAI,MAAM,cAAc,UAAa,MAAM,cAAc,cAAc,MAAM,cAAc,cAAc;AACvG,qCAAiC,MAAM,SAAS;AAAA,EAClD;AACA,MAAI,CAAC,aAAAA,QAAM,SAAS,MAAM,MAAM,QAAQ,GAAG;AACzC,oCAAgC;AAAA,EAClC;AACF;",
|
|
6
|
-
"names": ["React"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/form-layout-checkbox-group/defaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const defaultProps = {\n direction: 'horizontal',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,WAAW;AACb;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
-
mod
|
|
19
|
-
));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
var index_d_exports = {};
|
|
22
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
23
|
-
var React = __toESM(require("react"));
|
|
24
|
-
//# sourceMappingURL=index.d.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/form-layout-checkbox-group/index.d.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["type DirectionsT = 'horizontal' | 'vertical';\n\nexport interface DSControlledCheckboxGroupT {\n direction: DirectionsT;\n children: React.ReactNode;\n}\n\nexport interface DSControlledCheckboxGroupStyledContainerT {\n direction: DirectionsT;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
const getVariableType = (arg) => {
|
|
4
|
-
if (Array.isArray(arg))
|
|
5
|
-
return "array";
|
|
6
|
-
if (arg === null)
|
|
7
|
-
return "null";
|
|
8
|
-
if (arg === void 0)
|
|
9
|
-
return "undefined";
|
|
10
|
-
return typeof arg;
|
|
11
|
-
};
|
|
12
|
-
const throwCheckboxGroupDirectionError = (invalidProp) => {
|
|
13
|
-
throw new Error(
|
|
14
|
-
`You are trying to pass a not valid "direction" property value for a checkbox group, please provide a valid type.
|
|
15
|
-
|
|
16
|
-
Received: ${invalidProp} (${getVariableType(invalidProp)})
|
|
17
|
-
Expected: "horizontal" or "vertical" (string)
|
|
18
|
-
`
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
const throwCheckboxGroupChildrenError = () => {
|
|
22
|
-
throw new Error(
|
|
23
|
-
`You are trying to use a checkbox group without any React children, please provide at least one children to use.
|
|
24
|
-
|
|
25
|
-
Received: (null)
|
|
26
|
-
Expected: React children
|
|
27
|
-
`
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
const useValidateProps = (props) => {
|
|
31
|
-
if (props.direction !== void 0 && props.direction !== "vertical" && props.direction !== "horizontal") {
|
|
32
|
-
throwCheckboxGroupDirectionError(props.direction);
|
|
33
|
-
}
|
|
34
|
-
if (!React2.Children.count(props.children)) {
|
|
35
|
-
throwCheckboxGroupChildrenError();
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
export {
|
|
39
|
-
useValidateProps
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/form-layout-checkbox-group/config/useValidateProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAGlB,MAAM,kBAAkB,CAAC,QAAyB;AAChD,MAAI,MAAM,QAAQ,GAAG;AAAG,WAAO;AAC/B,MAAI,QAAQ;AAAM,WAAO;AACzB,MAAI,QAAQ;AAAW,WAAO;AAC9B,SAAO,OAAO;AAChB;AAEA,MAAM,mCAAmC,CAAC,gBAA+B;AACvE,QAAM,IAAI;AAAA,IACR;AAAA;AAAA,cAEU,gBAAgB,gBAAgB,WAAW;AAAA;AAAA;AAAA,EAGvD;AACF;AAEA,MAAM,kCAAkC,MAAY;AAClD,QAAM,IAAI;AAAA,IACR;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF;AACF;AAEO,MAAM,mBAAmB,CAAC,UAA4C;AAC3E,MAAI,MAAM,cAAc,UAAa,MAAM,cAAc,cAAc,MAAM,cAAc,cAAc;AACvG,qCAAiC,MAAM,SAAS;AAAA,EAClD;AACA,MAAI,CAACA,OAAM,SAAS,MAAM,MAAM,QAAQ,GAAG;AACzC,oCAAgC;AAAA,EAClC;AACF;",
|
|
6
|
-
"names": ["React"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-checkbox-group/defaultProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const defaultProps = {\n direction: 'horizontal',\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,eAAe;AAAA,EAC1B,WAAW;AACb;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|