@elliemae/ds-form-layout-blocks 2.3.0-alpha.8 → 2.3.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/form-layout-block-item/DSFormLayoutBlockItem.js +67 -0
- package/cjs/form-layout-block-item/index.d.js +2 -0
- package/cjs/form-layout-block-item/index.js +10 -0
- package/cjs/form-layout-block-item/propTypes.js +23 -0
- package/cjs/form-layout-block-item/styles.js +92 -0
- package/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +30 -0
- package/cjs/form-layout-checkbox-group/config/useValidateProps.js +36 -0
- package/cjs/form-layout-checkbox-group/defaultProps.js +9 -0
- package/cjs/form-layout-checkbox-group/index.d.js +2 -0
- package/cjs/form-layout-checkbox-group/index.js +10 -0
- package/cjs/form-layout-checkbox-group/propTypes.js +11 -0
- package/cjs/form-layout-checkbox-group/styles.js +46 -0
- package/cjs/index.d.js +2 -0
- package/cjs/index.js +13 -0
- package/esm/form-layout-block-item/DSFormLayoutBlockItem.js +58 -0
- package/esm/form-layout-block-item/index.d.js +1 -0
- package/esm/form-layout-block-item/index.js +1 -0
- package/esm/form-layout-block-item/propTypes.js +19 -0
- package/esm/form-layout-block-item/styles.js +80 -0
- package/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +21 -0
- package/esm/form-layout-checkbox-group/config/useValidateProps.js +28 -0
- package/esm/form-layout-checkbox-group/defaultProps.js +5 -0
- package/esm/form-layout-checkbox-group/index.d.js +1 -0
- package/esm/form-layout-checkbox-group/index.js +1 -0
- package/esm/form-layout-checkbox-group/propTypes.js +7 -0
- package/esm/form-layout-checkbox-group/styles.js +38 -0
- package/esm/index.d.js +1 -0
- package/esm/index.js +2 -0
- package/package.json +37 -39
- package/types/form-layout-block-item/DSFormLayoutBlockItem.d.ts +77 -0
- package/types/form-layout-block-item/index.d.d.ts +35 -0
- package/types/form-layout-block-item/index.d.ts +1 -0
- package/types/form-layout-block-item/propTypes.d.ts +66 -0
- package/types/form-layout-block-item/styles.d.ts +6 -0
- package/types/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.d.ts +20 -0
- package/types/form-layout-checkbox-group/config/useValidateProps.d.ts +2 -0
- package/types/form-layout-checkbox-group/defaultProps.d.ts +3 -0
- package/types/form-layout-checkbox-group/index.d.d.ts +10 -0
- package/types/form-layout-checkbox-group/index.d.ts +1 -0
- package/types/form-layout-checkbox-group/propTypes.d.ts +9 -0
- package/types/form-layout-checkbox-group/styles.d.ts +2 -0
- package/types/index.d.ts +2 -0
- package/dist/cjs/form-layout-block-item/DSFormLayoutBlockItem.js +0 -89
- package/dist/cjs/form-layout-block-item/DSFormLayoutBlockItem.js.map +0 -7
- package/dist/cjs/form-layout-block-item/index.d.js +0 -27
- package/dist/cjs/form-layout-block-item/index.d.js.map +0 -7
- package/dist/cjs/form-layout-block-item/index.js +0 -28
- package/dist/cjs/form-layout-block-item/index.js.map +0 -7
- package/dist/cjs/form-layout-block-item/propTypes.js +0 -50
- package/dist/cjs/form-layout-block-item/propTypes.js.map +0 -7
- package/dist/cjs/form-layout-block-item/styles.js +0 -125
- package/dist/cjs/form-layout-block-item/styles.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +0 -52
- package/dist/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/config/useValidateProps.js +0 -66
- package/dist/cjs/form-layout-checkbox-group/config/useValidateProps.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/defaultProps.js +0 -37
- package/dist/cjs/form-layout-checkbox-group/defaultProps.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/index.d.js +0 -27
- package/dist/cjs/form-layout-checkbox-group/index.d.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/index.js +0 -28
- package/dist/cjs/form-layout-checkbox-group/index.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/propTypes.js +0 -38
- package/dist/cjs/form-layout-checkbox-group/propTypes.js.map +0 -7
- package/dist/cjs/form-layout-checkbox-group/styles.js +0 -50
- package/dist/cjs/form-layout-checkbox-group/styles.js.map +0 -7
- package/dist/cjs/index.d.js +0 -29
- package/dist/cjs/index.d.js.map +0 -7
- package/dist/cjs/index.js +0 -29
- package/dist/cjs/index.js.map +0 -7
- package/dist/esm/form-layout-block-item/DSFormLayoutBlockItem.js +0 -60
- package/dist/esm/form-layout-block-item/DSFormLayoutBlockItem.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-block-item/index.js +0 -3
- package/dist/esm/form-layout-block-item/index.js.map +0 -7
- package/dist/esm/form-layout-block-item/propTypes.js +0 -21
- package/dist/esm/form-layout-block-item/propTypes.js.map +0 -7
- package/dist/esm/form-layout-block-item/styles.js +0 -96
- package/dist/esm/form-layout-block-item/styles.js.map +0 -7
- package/dist/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +0 -23
- package/dist/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +0 -7
- package/dist/esm/form-layout-checkbox-group/config/useValidateProps.js +0 -37
- 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
- package/dist/esm/form-layout-checkbox-group/index.js +0 -3
- package/dist/esm/form-layout-checkbox-group/index.js.map +0 -7
- package/dist/esm/form-layout-checkbox-group/propTypes.js +0 -9
- package/dist/esm/form-layout-checkbox-group/propTypes.js.map +0 -7
- package/dist/esm/form-layout-checkbox-group/styles.js +0 -21
- package/dist/esm/form-layout-checkbox-group/styles.js.map +0 -7
- package/dist/esm/index.d.js +0 -4
- package/dist/esm/index.d.js.map +0 -7
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -7
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2, { useMemo } from "react";
|
|
3
|
-
import { describe } from "react-desc";
|
|
4
|
-
import { uid } from "uid";
|
|
5
|
-
import { propTypes } from "./propTypes";
|
|
6
|
-
import { StyledMessage, StyledLabel, StyledContainer, StyledMark, ScreenReaderOnly } from "./styles";
|
|
7
|
-
const DSFormLayoutBlockItem = (props) => {
|
|
8
|
-
const {
|
|
9
|
-
label,
|
|
10
|
-
feedbackMessage,
|
|
11
|
-
validationMessage,
|
|
12
|
-
inputID,
|
|
13
|
-
children,
|
|
14
|
-
hasError,
|
|
15
|
-
leftLabel,
|
|
16
|
-
required,
|
|
17
|
-
optional,
|
|
18
|
-
hideLabel,
|
|
19
|
-
fitContent,
|
|
20
|
-
withHighlight,
|
|
21
|
-
isGroup = false
|
|
22
|
-
} = props;
|
|
23
|
-
const instanceUID = useMemo(() => uid(6), []);
|
|
24
|
-
return /* @__PURE__ */ React2.createElement(StyledContainer, {
|
|
25
|
-
leftLabel,
|
|
26
|
-
fitContent,
|
|
27
|
-
hideLabel,
|
|
28
|
-
withHighlight,
|
|
29
|
-
as: isGroup ? "fieldset" : "div",
|
|
30
|
-
isGroup,
|
|
31
|
-
"aria-describedby": `${inputID || instanceUID}_feedback_message`
|
|
32
|
-
}, /* @__PURE__ */ React2.createElement(StyledLabel, {
|
|
33
|
-
htmlFor: inputID,
|
|
34
|
-
leftLabel,
|
|
35
|
-
hideLabel,
|
|
36
|
-
"aria-hidden": isGroup
|
|
37
|
-
}, label, (required || optional) && /* @__PURE__ */ React2.createElement(StyledMark, {
|
|
38
|
-
required
|
|
39
|
-
})), isGroup && /* @__PURE__ */ React2.createElement(ScreenReaderOnly, {
|
|
40
|
-
as: "legend"
|
|
41
|
-
}, label), children, feedbackMessage && !hasError && /* @__PURE__ */ React2.createElement(StyledMessage, {
|
|
42
|
-
leftLabel,
|
|
43
|
-
hideLabel,
|
|
44
|
-
"aria-hidden": isGroup,
|
|
45
|
-
id: `${inputID || instanceUID}_feedback_message`
|
|
46
|
-
}, feedbackMessage), validationMessage && hasError && /* @__PURE__ */ React2.createElement(StyledMessage, {
|
|
47
|
-
hasError,
|
|
48
|
-
leftLabel,
|
|
49
|
-
hideLabel,
|
|
50
|
-
role: "alert"
|
|
51
|
-
}, validationMessage));
|
|
52
|
-
};
|
|
53
|
-
DSFormLayoutBlockItem.propTypes = propTypes;
|
|
54
|
-
const DSFormLayoutBlockItemWithSchema = describe(DSFormLayoutBlockItem);
|
|
55
|
-
DSFormLayoutBlockItemWithSchema.propTypes = propTypes;
|
|
56
|
-
export {
|
|
57
|
-
DSFormLayoutBlockItem,
|
|
58
|
-
DSFormLayoutBlockItemWithSchema
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=DSFormLayoutBlockItem.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport type { DSFormLayoutBlockItemPropsT as Props } from './index.d';\nimport { propTypes } from './propTypes';\nimport { StyledMessage, StyledLabel, StyledContainer, StyledMark, ScreenReaderOnly } from './styles';\n\nconst DSFormLayoutBlockItem = (props: Props): JSX.Element => {\n const {\n label,\n feedbackMessage,\n validationMessage,\n inputID,\n children,\n hasError,\n leftLabel,\n required,\n optional,\n hideLabel,\n fitContent,\n withHighlight,\n isGroup = false,\n } = props;\n\n const instanceUID = useMemo(() => uid(6), []);\n\n return (\n <StyledContainer\n leftLabel={leftLabel}\n fitContent={fitContent}\n hideLabel={hideLabel}\n withHighlight={withHighlight}\n as={isGroup ? 'fieldset' : 'div'}\n isGroup={isGroup}\n aria-describedby={`${inputID || instanceUID}_feedback_message`}\n >\n <StyledLabel htmlFor={inputID} leftLabel={leftLabel} hideLabel={hideLabel} aria-hidden={isGroup}>\n {label}\n {(required || optional) && <StyledMark required={required} />}\n </StyledLabel>\n {isGroup && <ScreenReaderOnly as=\"legend\">{label}</ScreenReaderOnly>}\n {children}\n {feedbackMessage && !hasError && (\n <StyledMessage\n leftLabel={leftLabel}\n hideLabel={hideLabel}\n aria-hidden={isGroup}\n id={`${inputID || instanceUID}_feedback_message`}\n >\n {feedbackMessage}\n </StyledMessage>\n )}\n {validationMessage && hasError && (\n <StyledMessage hasError={hasError} leftLabel={leftLabel} hideLabel={hideLabel} role=\"alert\">\n {validationMessage}\n </StyledMessage>\n )}\n </StyledContainer>\n );\n};\n\nDSFormLayoutBlockItem.propTypes = propTypes;\nconst DSFormLayoutBlockItemWithSchema = describe(DSFormLayoutBlockItem);\nDSFormLayoutBlockItemWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AAEA;AACA;AAEA,MAAM,wBAAwB,CAAC,UAA8B;AAC3D,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,UAAU;AAAA,MACR;AAEJ,QAAM,cAAc,QAAQ,MAAM,IAAI,IAAI;AAE1C,SACE,qCAAC,iBAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,IAAI,UAAU,aAAa;AAAA,IAC3B;AAAA,IACA,oBAAkB,GAAG,WAAW;AAAA,KAEhC,qCAAC,aAAD;AAAA,IAAa,SAAS;AAAA,IAAS;AAAA,IAAsB;AAAA,IAAsB,eAAa;AAAA,KACrF,OACC,aAAY,aAAa,qCAAC,YAAD;AAAA,IAAY;AAAA,OAExC,WAAW,qCAAC,kBAAD;AAAA,IAAkB,IAAG;AAAA,KAAU,QAC1C,UACA,mBAAmB,CAAC,YACnB,qCAAC,eAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA,eAAa;AAAA,IACb,IAAI,GAAG,WAAW;AAAA,KAEjB,kBAGJ,qBAAqB,YACpB,qCAAC,eAAD;AAAA,IAAe;AAAA,IAAoB;AAAA,IAAsB;AAAA,IAAsB,MAAK;AAAA,KACjF;AAAA;AAOX,sBAAsB,YAAY;AAClC,MAAM,kCAAkC,SAAS;AACjD,gCAAgC,YAAY;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-block-item/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSFormLayoutBlockItem';\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { PropTypes } from "react-desc";
|
|
3
|
-
const propTypes = {
|
|
4
|
-
children: PropTypes.node.isRequired.description("Input component. "),
|
|
5
|
-
label: PropTypes.string.isRequired.description("Label property for the input component. This property is required for accesibility purposes."),
|
|
6
|
-
inputID: PropTypes.string.isRequired.description("String that matches the input component's id. This property is required for accesibility purposes."),
|
|
7
|
-
feedbackMessage: PropTypes.string.description("Feedback message to show below the input component."),
|
|
8
|
-
validationMessage: PropTypes.string.description("Validation message to show below the input component. It requires hasError property set to true to be visible."),
|
|
9
|
-
hasError: PropTypes.bool.description("Helper boolean property for the validation message."),
|
|
10
|
-
required: PropTypes.bool.description("Adds required extra styling."),
|
|
11
|
-
optional: PropTypes.bool.description("Adds optional extra styling."),
|
|
12
|
-
fitContent: PropTypes.bool.description("Set the width of the layout to the input component."),
|
|
13
|
-
leftLabel: PropTypes.bool.description("Adds the label at the left of the input component."),
|
|
14
|
-
hideLabel: PropTypes.bool.description("Hides the input label. It still requires label and labelFor property for accesibility purposes"),
|
|
15
|
-
withHighlight: PropTypes.bool.description("Adds highlight extra styling. It requires extra spacing, please check withHighlight explanation tab."),
|
|
16
|
-
isGroup: PropTypes.bool.description("Sets the HTML elements as fieldset and legend. This should be used when you want to group more than one input.")
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
propTypes
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 'react-desc';\n\nexport const propTypes = {\n children: PropTypes.node.isRequired.description('Input component. '),\n label: PropTypes.string.isRequired.description(\n 'Label property for the input component. This property is required for accesibility purposes.',\n ),\n inputID: PropTypes.string.isRequired.description(\n \"String that matches the input component's id. This property is required for accesibility purposes.\",\n ),\n feedbackMessage: PropTypes.string.description('Feedback message to show below the input component.'),\n validationMessage: PropTypes.string.description(\n 'Validation message to show below the input component. It requires hasError property set to true to be visible.',\n ),\n hasError: PropTypes.bool.description('Helper boolean property for the validation message.'),\n required: PropTypes.bool.description('Adds required extra styling.'),\n optional: PropTypes.bool.description('Adds optional extra styling.'),\n fitContent: PropTypes.bool.description('Set the width of the layout to the input component.'),\n leftLabel: PropTypes.bool.description('Adds the label at the left of the input component.'),\n hideLabel: PropTypes.bool.description(\n 'Hides the input label. It still requires label and labelFor property for accesibility purposes',\n ),\n withHighlight: PropTypes.bool.description(\n 'Adds highlight extra styling. It requires extra spacing, please check withHighlight explanation tab.',\n ),\n isGroup: PropTypes.bool.description(\n 'Sets the HTML elements as fieldset and legend. This should be used when you want to group more than one input.',\n ),\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAEO,MAAM,YAAY;AAAA,EACvB,UAAU,UAAU,KAAK,WAAW,YAAY;AAAA,EAChD,OAAO,UAAU,OAAO,WAAW,YACjC;AAAA,EAEF,SAAS,UAAU,OAAO,WAAW,YACnC;AAAA,EAEF,iBAAiB,UAAU,OAAO,YAAY;AAAA,EAC9C,mBAAmB,UAAU,OAAO,YAClC;AAAA,EAEF,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,YAAY,UAAU,KAAK,YAAY;AAAA,EACvC,WAAW,UAAU,KAAK,YAAY;AAAA,EACtC,WAAW,UAAU,KAAK,YACxB;AAAA,EAEF,eAAe,UAAU,KAAK,YAC5B;AAAA,EAEF,SAAS,UAAU,KAAK,YACtB;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
const StyledContainer = styled.div`
|
|
4
|
-
position: relative;
|
|
5
|
-
padding: 0;
|
|
6
|
-
margin: 0;
|
|
7
|
-
display: grid;
|
|
8
|
-
${({ fitContent }) => fitContent ? "width: fit-content;" : void 0}
|
|
9
|
-
${({ isGroup }) => isGroup ? "border: none" : ""};
|
|
10
|
-
${({ leftLabel, hideLabel }) => leftLabel && !hideLabel ? "grid-template-columns: max-content auto;" : void 0}
|
|
11
|
-
align-items: center;
|
|
12
|
-
${({ theme, withHighlight }) => withHighlight ? `
|
|
13
|
-
&::after {
|
|
14
|
-
position: absolute;
|
|
15
|
-
content: '';
|
|
16
|
-
left: -${theme.space.xxs};
|
|
17
|
-
top: -${theme.space.xxxs};
|
|
18
|
-
z-index: -1;
|
|
19
|
-
width: calc(100% + ${theme.space.xs});
|
|
20
|
-
height: calc(100% + ${theme.space.xxs});
|
|
21
|
-
background-color: #FEFBEE;
|
|
22
|
-
border : 1px solid #8F6326;
|
|
23
|
-
border-radius : 4px;
|
|
24
|
-
box-shadow: 0 1px 3px 0 rgba(0,0,0,0.35);
|
|
25
|
-
}
|
|
26
|
-
&:hover,
|
|
27
|
-
&:focus-within {
|
|
28
|
-
&::after {
|
|
29
|
-
position: absolute;
|
|
30
|
-
content: '';
|
|
31
|
-
left: -${theme.space.xxs};
|
|
32
|
-
top: -${theme.space.xxxs};
|
|
33
|
-
z-index: -1;
|
|
34
|
-
width: calc(100% + ${theme.space.xs});
|
|
35
|
-
height: calc(100% + ${theme.space.xxs});
|
|
36
|
-
background-color: #FFF9D3;
|
|
37
|
-
border : 2px solid #8F6326;
|
|
38
|
-
border-radius : 4px;
|
|
39
|
-
box-shadow: 0 6px 10px 0 rgba(0,0,0,0.30);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
` : void 0}
|
|
43
|
-
`;
|
|
44
|
-
const StyledLabel = styled.label`
|
|
45
|
-
display: flex;
|
|
46
|
-
${({ theme, leftLabel }) => leftLabel ? `padding-right: ${theme.space.xxs};` : void 0}
|
|
47
|
-
${({ hideLabel }) => hideLabel ? `position: absolute;
|
|
48
|
-
width: 1px;
|
|
49
|
-
height: 1px;
|
|
50
|
-
padding: 0;
|
|
51
|
-
margin: -1px;
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
clip: rect(0, 0, 0, 0);
|
|
54
|
-
white-space: nowrap;
|
|
55
|
-
border: 0;
|
|
56
|
-
` : void 0}
|
|
57
|
-
`;
|
|
58
|
-
const StyledMessage = styled.div`
|
|
59
|
-
font-size: ${({ theme }) => theme.fontSizes.microText[200]};
|
|
60
|
-
font-style: italic;
|
|
61
|
-
text-align: right;
|
|
62
|
-
line-height: 15px;
|
|
63
|
-
height: 15px;
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
text-overflow: ellipsis;
|
|
66
|
-
color: ${({ theme, hasError }) => hasError ? theme.colors.danger[900] : theme.colors.neutral[500]};
|
|
67
|
-
${({ leftLabel, hideLabel }) => leftLabel && !hideLabel ? "grid-column: 1/3;" : void 0}
|
|
68
|
-
`;
|
|
69
|
-
const StyledMark = styled.span`
|
|
70
|
-
width: 6px;
|
|
71
|
-
height: 6px;
|
|
72
|
-
border-radius: 50%;
|
|
73
|
-
margin-left: ${({ theme }) => theme.space.xxxs};
|
|
74
|
-
${({ theme, required }) => required ? `
|
|
75
|
-
background-color: ${theme.colors.danger[900]};
|
|
76
|
-
` : `
|
|
77
|
-
border: 1px solid ${theme.colors.brand[600]};
|
|
78
|
-
`}
|
|
79
|
-
`;
|
|
80
|
-
const ScreenReaderOnly = styled.div`
|
|
81
|
-
clip: rect(0 0 0 0);
|
|
82
|
-
clip-path: inset(50%);
|
|
83
|
-
height: 1px;
|
|
84
|
-
overflow: hidden;
|
|
85
|
-
position: absolute;
|
|
86
|
-
white-space: nowrap;
|
|
87
|
-
width: 1px;
|
|
88
|
-
`;
|
|
89
|
-
export {
|
|
90
|
-
ScreenReaderOnly,
|
|
91
|
-
StyledContainer,
|
|
92
|
-
StyledLabel,
|
|
93
|
-
StyledMark,
|
|
94
|
-
StyledMessage
|
|
95
|
-
};
|
|
96
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 'styled-components';\nimport type {\n DSFormLayoutBlockItemStyledContainerT,\n DSFormLayoutBlockItemStyledLabelT,\n DSFormLayoutBlockItemStyledMessageT,\n DSFormLayoutBlockItemStyledMarkT,\n} from './index.d';\n\nexport const StyledContainer = styled.div<DSFormLayoutBlockItemStyledContainerT>`\n position: relative;\n padding: 0;\n margin: 0;\n display: grid;\n ${({ fitContent }) => (fitContent ? 'width: fit-content;' : undefined)}\n ${({ isGroup }) => (isGroup ? 'border: none' : '')};\n ${({ leftLabel, hideLabel }) => (leftLabel && !hideLabel ? 'grid-template-columns: max-content auto;' : undefined)}\n align-items: center;\n ${({ theme, withHighlight }) =>\n withHighlight\n ? `\n &::after {\n position: absolute;\n content: '';\n left: -${theme.space.xxs};\n top: -${theme.space.xxxs};\n z-index: -1;\n width: calc(100% + ${theme.space.xs});\n height: calc(100% + ${theme.space.xxs});\n background-color: #FEFBEE;\n border : 1px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 1px 3px 0 rgba(0,0,0,0.35);\n }\n &:hover, \n &:focus-within {\n &::after {\n position: absolute;\n content: '';\n left: -${theme.space.xxs};\n top: -${theme.space.xxxs};\n z-index: -1;\n width: calc(100% + ${theme.space.xs});\n height: calc(100% + ${theme.space.xxs});\n background-color: #FFF9D3;\n border : 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`;\n\nexport const StyledLabel = styled.label<DSFormLayoutBlockItemStyledLabelT>`\n display: flex;\n ${({ theme, leftLabel }) => (leftLabel ? `padding-right: ${theme.space.xxs};` : undefined)}\n ${({ hideLabel }) =>\n hideLabel\n ? `position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n `\n : undefined}\n`;\n\nexport const StyledMessage = styled.div<DSFormLayoutBlockItemStyledMessageT>`\n font-size: ${({ theme }) => theme.fontSizes.microText[200]};\n font-style: italic;\n text-align: right;\n line-height: 15px;\n height: 15px;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[500])};\n ${({ leftLabel, hideLabel }) => (leftLabel && !hideLabel ? 'grid-column: 1/3;' : undefined)}\n`;\n\nexport const StyledMark = styled.span<DSFormLayoutBlockItemStyledMarkT>`\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-left: ${({ theme }) => theme.space.xxxs};\n ${({ theme, required }) =>\n required\n ? `\n background-color: ${theme.colors.danger[900]};\n `\n : `\n border: 1px solid ${theme.colors.brand[600]};\n `}\n`;\n\nexport const ScreenReaderOnly = styled.div`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAQO,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKlC,CAAC,EAAE,iBAAkB,aAAa,wBAAwB;AAAA,IAC1D,CAAC,EAAE,cAAe,UAAU,iBAAiB;AAAA,IAC7C,CAAC,EAAE,WAAW,gBAAiB,aAAa,CAAC,YAAY,6CAA6C;AAAA;AAAA,IAEtG,CAAC,EAAE,OAAO,oBACV,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;AAGD,MAAM,cAAc,OAAO;AAAA;AAAA,IAE9B,CAAC,EAAE,OAAO,gBAAiB,YAAY,kBAAkB,MAAM,MAAM,SAAS;AAAA,IAC9E,CAAC,EAAE,gBACH,YACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUA;AAAA;AAGD,MAAM,gBAAgB,OAAO;AAAA,eACrB,CAAC,EAAE,YAAY,MAAM,UAAU,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAO7C,CAAC,EAAE,OAAO,eAAgB,WAAW,MAAM,OAAO,OAAO,OAAO,MAAM,OAAO,QAAQ;AAAA,IAC5F,CAAC,EAAE,WAAW,gBAAiB,aAAa,CAAC,YAAY,sBAAsB;AAAA;AAG5E,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;AAAA,iBAIhB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,IACxC,CAAC,EAAE,OAAO,eACV,WACI;AAAA,sBACc,MAAM,OAAO,OAAO;AAAA,MAElC;AAAA,sBACc,MAAM,OAAO,MAAM;AAAA;AAAA;AAIlC,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
import { describe } from "react-desc";
|
|
4
|
-
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
5
|
-
import { propTypes } from "./propTypes";
|
|
6
|
-
import { StyledContainer } from "./styles";
|
|
7
|
-
import { defaultProps } from "./defaultProps";
|
|
8
|
-
import { useValidateProps } from "./config/useValidateProps";
|
|
9
|
-
const DSFormLayoutCheckboxGroup = (props) => {
|
|
10
|
-
useValidateProps(props);
|
|
11
|
-
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
12
|
-
return /* @__PURE__ */ React2.createElement(StyledContainer, {
|
|
13
|
-
direction: propsWithDefault.direction
|
|
14
|
-
}, propsWithDefault.children);
|
|
15
|
-
};
|
|
16
|
-
DSFormLayoutCheckboxGroup.propTypes = propTypes;
|
|
17
|
-
const DSFormLayoutCheckboxGroupWithSchema = describe(DSFormLayoutCheckboxGroup);
|
|
18
|
-
DSFormLayoutCheckboxGroupWithSchema.propTypes = propTypes;
|
|
19
|
-
export {
|
|
20
|
-
DSFormLayoutCheckboxGroup,
|
|
21
|
-
DSFormLayoutCheckboxGroupWithSchema
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=DSFormLayoutCheckboxGroup.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 } from 'react-desc';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { propTypes } from './propTypes';\nimport { StyledContainer } from './styles';\nimport { defaultProps } from './defaultProps';\nimport type { DSControlledCheckboxGroupT } from './index.d';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst DSFormLayoutCheckboxGroup = (props: DSControlledCheckboxGroupT): JSX.Element => {\n useValidateProps(props);\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);\n\n return <StyledContainer direction={propsWithDefault.direction}>{propsWithDefault.children}</StyledContainer>;\n};\n\nDSFormLayoutCheckboxGroup.propTypes = propTypes;\nconst DSFormLayoutCheckboxGroupWithSchema = describe(DSFormLayoutCheckboxGroup);\nDSFormLayoutCheckboxGroupWithSchema.propTypes = propTypes;\n\nexport { DSFormLayoutCheckboxGroup, DSFormLayoutCheckboxGroupWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA,MAAM,4BAA4B,CAAC,UAAmD;AACpF,mBAAiB;AACjB,QAAM,mBAAmB,6BAA6B,OAAO;AAE7D,SAAO,qCAAC,iBAAD;AAAA,IAAiB,WAAW,iBAAiB;AAAA,KAAY,iBAAiB;AAAA;AAGnF,0BAA0B,YAAY;AACtC,MAAM,sCAAsC,SAAS;AACrD,oCAAoC,YAAY;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,37 +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(`You are trying to pass a not valid "direction" property value for a checkbox group, please provide a valid type.
|
|
14
|
-
|
|
15
|
-
Received: ${invalidProp} (${getVariableType(invalidProp)})
|
|
16
|
-
Expected: "horizontal" or "vertical" (string)
|
|
17
|
-
`);
|
|
18
|
-
};
|
|
19
|
-
const throwCheckboxGroupChildrenError = () => {
|
|
20
|
-
throw new Error(`You are trying to use a checkbox group without any React children, please provide at least one children to use.
|
|
21
|
-
|
|
22
|
-
Received: (null)
|
|
23
|
-
Expected: React children
|
|
24
|
-
`);
|
|
25
|
-
};
|
|
26
|
-
const useValidateProps = (props) => {
|
|
27
|
-
if (props.direction !== void 0 && props.direction !== "vertical" && props.direction !== "horizontal") {
|
|
28
|
-
throwCheckboxGroupDirectionError(props.direction);
|
|
29
|
-
}
|
|
30
|
-
if (!React2.Children.count(props.children)) {
|
|
31
|
-
throwCheckboxGroupChildrenError();
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
useValidateProps
|
|
36
|
-
};
|
|
37
|
-
//# 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;ACAA;AAGA,MAAM,kBAAkB,CAAC,QAAyB;AAChD,MAAI,MAAM,QAAQ;AAAM,WAAO;AAC/B,MAAI,QAAQ;AAAM,WAAO;AACzB,MAAI,QAAQ;AAAW,WAAO;AAC9B,SAAO,OAAO;AAAA;AAGhB,MAAM,mCAAmC,CAAC,gBAA+B;AACvE,QAAM,IAAI,MACR;AAAA;AAAA,cAEU,gBAAgB,gBAAgB;AAAA;AAAA;AAAA;AAM9C,MAAM,kCAAkC,MAAY;AAClD,QAAM,IAAI,MACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAQG,MAAM,mBAAmB,CAAC,UAA4C;AAC3E,MAAI,MAAM,cAAc,UAAa,MAAM,cAAc,cAAc,MAAM,cAAc,cAAc;AACvG,qCAAiC,MAAM;AAAA;AAEzC,MAAI,CAAC,OAAM,SAAS,MAAM,MAAM,WAAW;AACzC;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
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;ACAO,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/form-layout-checkbox-group/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSFormLayoutCheckboxGroup';\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { PropTypes } from "react-desc";
|
|
3
|
-
const propTypes = {
|
|
4
|
-
direction: PropTypes.oneOf(["horizontal", "vertical"]).description("Set direction for the checkbox group.")
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
propTypes
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 } from 'react-desc';\n\nexport const propTypes = {\n direction: PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.'),\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAEO,MAAM,YAAY;AAAA,EACvB,WAAW,UAAU,MAAM,CAAC,cAAc,aAAa,YAAY;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
const StyledContainer = styled.div`
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
flex-wrap: wrap;
|
|
6
|
-
flex-direction: ${({ direction }) => direction === "horizontal" ? "row" : "column"};
|
|
7
|
-
margin-left: ${({ theme }) => theme.space.xs};
|
|
8
|
-
margin-right: ${({ theme }) => theme.space.xs};
|
|
9
|
-
margin-top: ${({ theme }) => theme.space.xxs};
|
|
10
|
-
& div {
|
|
11
|
-
padding: 0;
|
|
12
|
-
margin-bottom: ${({ theme }) => theme.space.xxs};
|
|
13
|
-
}
|
|
14
|
-
& div:not(:last-child) {
|
|
15
|
-
margin-right: ${({ theme, direction }) => direction === "horizontal" ? theme.space.s : "0"};
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
export {
|
|
19
|
-
StyledContainer
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 'styled-components';\nimport type { DSControlledCheckboxGroupStyledContainerT } from './index.d';\n\nexport const StyledContainer = styled.div<DSControlledCheckboxGroupStyledContainerT>`\n display: inline-flex;\n flex-wrap: wrap;\n flex-direction: ${({ direction }) => (direction === 'horizontal' ? 'row' : 'column')};\n margin-left: ${({ theme }) => theme.space.xs};\n margin-right: ${({ theme }) => theme.space.xs};\n margin-top: ${({ theme }) => theme.space.xxs};\n & div {\n padding: 0;\n margin-bottom: ${({ theme }) => theme.space.xxs};\n }\n & div:not(:last-child) {\n margin-right: ${({ theme, direction }) => (direction === 'horizontal' ? theme.space.s : '0')};\n }\n`;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAGO,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA,oBAGlB,CAAC,EAAE,gBAAiB,cAAc,eAAe,QAAQ;AAAA,iBAC5D,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,kBAC1B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,gBAC7B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA,qBAGtB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA,oBAG5B,CAAC,EAAE,OAAO,gBAAiB,cAAc,eAAe,MAAM,MAAM,IAAI;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/index.d.js
DELETED
package/dist/esm/index.d.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.d.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './form-layout-block-item/index.d'\nexport * from './form-layout-checkbox-group/index.d'"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/index.js
DELETED
package/dist/esm/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './form-layout-block-item';\nexport * from './form-layout-checkbox-group';\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|