@elliemae/ds-form-layout-blocks 2.3.0-rc.1 → 3.0.0-alpha.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.
Files changed (98) hide show
  1. package/dist/cjs/form-layout-block-item/DSFormLayoutBlockItem.js +89 -0
  2. package/dist/cjs/form-layout-block-item/DSFormLayoutBlockItem.js.map +7 -0
  3. package/dist/cjs/form-layout-block-item/index.d.js +27 -0
  4. package/dist/cjs/form-layout-block-item/index.d.js.map +7 -0
  5. package/dist/cjs/form-layout-block-item/index.js +28 -0
  6. package/dist/cjs/form-layout-block-item/index.js.map +7 -0
  7. package/dist/cjs/form-layout-block-item/propTypes.js +50 -0
  8. package/dist/cjs/form-layout-block-item/propTypes.js.map +7 -0
  9. package/dist/cjs/form-layout-block-item/styles.js +125 -0
  10. package/dist/cjs/form-layout-block-item/styles.js.map +7 -0
  11. package/dist/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +52 -0
  12. package/dist/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +7 -0
  13. package/dist/cjs/form-layout-checkbox-group/config/useValidateProps.js +66 -0
  14. package/dist/cjs/form-layout-checkbox-group/config/useValidateProps.js.map +7 -0
  15. package/dist/cjs/form-layout-checkbox-group/defaultProps.js +37 -0
  16. package/dist/cjs/form-layout-checkbox-group/defaultProps.js.map +7 -0
  17. package/dist/cjs/form-layout-checkbox-group/index.d.js +27 -0
  18. package/dist/cjs/form-layout-checkbox-group/index.d.js.map +7 -0
  19. package/dist/cjs/form-layout-checkbox-group/index.js +28 -0
  20. package/dist/cjs/form-layout-checkbox-group/index.js.map +7 -0
  21. package/dist/cjs/form-layout-checkbox-group/propTypes.js +38 -0
  22. package/dist/cjs/form-layout-checkbox-group/propTypes.js.map +7 -0
  23. package/dist/cjs/form-layout-checkbox-group/styles.js +50 -0
  24. package/dist/cjs/form-layout-checkbox-group/styles.js.map +7 -0
  25. package/dist/cjs/index.d.js +29 -0
  26. package/dist/cjs/index.d.js.map +7 -0
  27. package/dist/cjs/index.js +29 -0
  28. package/dist/cjs/index.js.map +7 -0
  29. package/dist/esm/form-layout-block-item/DSFormLayoutBlockItem.js +60 -0
  30. package/dist/esm/form-layout-block-item/DSFormLayoutBlockItem.js.map +7 -0
  31. package/dist/esm/form-layout-block-item/index.d.js +2 -0
  32. package/dist/esm/form-layout-block-item/index.d.js.map +7 -0
  33. package/dist/esm/form-layout-block-item/index.js +3 -0
  34. package/dist/esm/form-layout-block-item/index.js.map +7 -0
  35. package/dist/esm/form-layout-block-item/propTypes.js +21 -0
  36. package/dist/esm/form-layout-block-item/propTypes.js.map +7 -0
  37. package/dist/esm/form-layout-block-item/styles.js +96 -0
  38. package/dist/esm/form-layout-block-item/styles.js.map +7 -0
  39. package/dist/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +23 -0
  40. package/dist/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +7 -0
  41. package/dist/esm/form-layout-checkbox-group/config/useValidateProps.js +37 -0
  42. package/dist/esm/form-layout-checkbox-group/config/useValidateProps.js.map +7 -0
  43. package/dist/esm/form-layout-checkbox-group/defaultProps.js +8 -0
  44. package/dist/esm/form-layout-checkbox-group/defaultProps.js.map +7 -0
  45. package/dist/esm/form-layout-checkbox-group/index.d.js +2 -0
  46. package/dist/esm/form-layout-checkbox-group/index.d.js.map +7 -0
  47. package/dist/esm/form-layout-checkbox-group/index.js +3 -0
  48. package/dist/esm/form-layout-checkbox-group/index.js.map +7 -0
  49. package/dist/esm/form-layout-checkbox-group/propTypes.js +9 -0
  50. package/dist/esm/form-layout-checkbox-group/propTypes.js.map +7 -0
  51. package/dist/esm/form-layout-checkbox-group/styles.js +21 -0
  52. package/dist/esm/form-layout-checkbox-group/styles.js.map +7 -0
  53. package/dist/esm/index.d.js +4 -0
  54. package/dist/esm/index.d.js.map +7 -0
  55. package/dist/esm/index.js +4 -0
  56. package/dist/esm/index.js.map +7 -0
  57. package/package.json +45 -36
  58. package/cjs/form-layout-block-item/DSFormLayoutBlockItem.js +0 -67
  59. package/cjs/form-layout-block-item/index.d.js +0 -2
  60. package/cjs/form-layout-block-item/index.js +0 -10
  61. package/cjs/form-layout-block-item/propTypes.js +0 -23
  62. package/cjs/form-layout-block-item/styles.js +0 -92
  63. package/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +0 -30
  64. package/cjs/form-layout-checkbox-group/config/useValidateProps.js +0 -36
  65. package/cjs/form-layout-checkbox-group/defaultProps.js +0 -9
  66. package/cjs/form-layout-checkbox-group/index.d.js +0 -2
  67. package/cjs/form-layout-checkbox-group/index.js +0 -10
  68. package/cjs/form-layout-checkbox-group/propTypes.js +0 -11
  69. package/cjs/form-layout-checkbox-group/styles.js +0 -46
  70. package/cjs/index.d.js +0 -2
  71. package/cjs/index.js +0 -13
  72. package/esm/form-layout-block-item/DSFormLayoutBlockItem.js +0 -58
  73. package/esm/form-layout-block-item/index.d.js +0 -1
  74. package/esm/form-layout-block-item/index.js +0 -1
  75. package/esm/form-layout-block-item/propTypes.js +0 -19
  76. package/esm/form-layout-block-item/styles.js +0 -80
  77. package/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +0 -21
  78. package/esm/form-layout-checkbox-group/config/useValidateProps.js +0 -28
  79. package/esm/form-layout-checkbox-group/defaultProps.js +0 -5
  80. package/esm/form-layout-checkbox-group/index.d.js +0 -1
  81. package/esm/form-layout-checkbox-group/index.js +0 -1
  82. package/esm/form-layout-checkbox-group/propTypes.js +0 -7
  83. package/esm/form-layout-checkbox-group/styles.js +0 -38
  84. package/esm/index.d.js +0 -1
  85. package/esm/index.js +0 -2
  86. package/types/form-layout-block-item/DSFormLayoutBlockItem.d.ts +0 -77
  87. package/types/form-layout-block-item/index.d.d.ts +0 -35
  88. package/types/form-layout-block-item/index.d.ts +0 -1
  89. package/types/form-layout-block-item/propTypes.d.ts +0 -66
  90. package/types/form-layout-block-item/styles.d.ts +0 -6
  91. package/types/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.d.ts +0 -20
  92. package/types/form-layout-checkbox-group/config/useValidateProps.d.ts +0 -2
  93. package/types/form-layout-checkbox-group/defaultProps.d.ts +0 -3
  94. package/types/form-layout-checkbox-group/index.d.d.ts +0 -10
  95. package/types/form-layout-checkbox-group/index.d.ts +0 -1
  96. package/types/form-layout-checkbox-group/propTypes.d.ts +0 -9
  97. package/types/form-layout-checkbox-group/styles.d.ts +0 -2
  98. package/types/index.d.ts +0 -2
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ export * from "./form-layout-block-item/index.d";
3
+ export * from "./form-layout-checkbox-group/index.d";
4
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ export * from "./form-layout-block-item";
3
+ export * from "./form-layout-checkbox-group";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
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
+ }
package/package.json CHANGED
@@ -1,55 +1,58 @@
1
1
  {
2
2
  "name": "@elliemae/ds-form-layout-blocks",
3
- "version": "2.3.0-rc.1",
3
+ "version": "3.0.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Form Layout",
6
- "module": "./esm/index.js",
7
- "main": "./cjs/index.js",
8
- "types": "./types/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
9
12
  "exports": {
10
13
  ".": {
11
- "import": "./esm/index.js",
12
- "require": "./cjs/index.js"
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
13
16
  },
14
17
  "./form-layout-checkbox-group/styles": {
15
- "import": "./esm/form-layout-checkbox-group/styles.js",
16
- "require": "./cjs/form-layout-checkbox-group/styles.js"
18
+ "import": "./dist/esm/form-layout-checkbox-group/styles.js",
19
+ "require": "./dist/cjs/form-layout-checkbox-group/styles.js"
17
20
  },
18
21
  "./form-layout-checkbox-group/propTypes": {
19
- "import": "./esm/form-layout-checkbox-group/propTypes.js",
20
- "require": "./cjs/form-layout-checkbox-group/propTypes.js"
22
+ "import": "./dist/esm/form-layout-checkbox-group/propTypes.js",
23
+ "require": "./dist/cjs/form-layout-checkbox-group/propTypes.js"
21
24
  },
22
25
  "./form-layout-checkbox-group": {
23
- "import": "./esm/form-layout-checkbox-group/index.js",
24
- "require": "./cjs/form-layout-checkbox-group/index.js"
26
+ "import": "./dist/esm/form-layout-checkbox-group/index.js",
27
+ "require": "./dist/cjs/form-layout-checkbox-group/index.js"
25
28
  },
26
29
  "./form-layout-checkbox-group/DSFormLayoutCheckboxGroup": {
27
- "import": "./esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js",
28
- "require": "./cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js"
30
+ "import": "./dist/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js",
31
+ "require": "./dist/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js"
29
32
  },
30
33
  "./form-layout-checkbox-group/defaultProps": {
31
- "import": "./esm/form-layout-checkbox-group/defaultProps.js",
32
- "require": "./cjs/form-layout-checkbox-group/defaultProps.js"
34
+ "import": "./dist/esm/form-layout-checkbox-group/defaultProps.js",
35
+ "require": "./dist/cjs/form-layout-checkbox-group/defaultProps.js"
33
36
  },
34
37
  "./form-layout-checkbox-group/config/useValidateProps": {
35
- "import": "./esm/form-layout-checkbox-group/config/useValidateProps.js",
36
- "require": "./cjs/form-layout-checkbox-group/config/useValidateProps.js"
38
+ "import": "./dist/esm/form-layout-checkbox-group/config/useValidateProps.js",
39
+ "require": "./dist/cjs/form-layout-checkbox-group/config/useValidateProps.js"
37
40
  },
38
41
  "./form-layout-block-item/styles": {
39
- "import": "./esm/form-layout-block-item/styles.js",
40
- "require": "./cjs/form-layout-block-item/styles.js"
42
+ "import": "./dist/esm/form-layout-block-item/styles.js",
43
+ "require": "./dist/cjs/form-layout-block-item/styles.js"
41
44
  },
42
45
  "./form-layout-block-item/propTypes": {
43
- "import": "./esm/form-layout-block-item/propTypes.js",
44
- "require": "./cjs/form-layout-block-item/propTypes.js"
46
+ "import": "./dist/esm/form-layout-block-item/propTypes.js",
47
+ "require": "./dist/cjs/form-layout-block-item/propTypes.js"
45
48
  },
46
49
  "./form-layout-block-item": {
47
- "import": "./esm/form-layout-block-item/index.js",
48
- "require": "./cjs/form-layout-block-item/index.js"
50
+ "import": "./dist/esm/form-layout-block-item/index.js",
51
+ "require": "./dist/cjs/form-layout-block-item/index.js"
49
52
  },
50
53
  "./form-layout-block-item/DSFormLayoutBlockItem": {
51
- "import": "./esm/form-layout-block-item/DSFormLayoutBlockItem.js",
52
- "require": "./cjs/form-layout-block-item/DSFormLayoutBlockItem.js"
54
+ "import": "./dist/esm/form-layout-block-item/DSFormLayoutBlockItem.js",
55
+ "require": "./dist/cjs/form-layout-block-item/DSFormLayoutBlockItem.js"
53
56
  }
54
57
  },
55
58
  "sideEffects": [
@@ -61,18 +64,18 @@
61
64
  "url": "https://git.elliemae.io/platform-ui/dimsum.git"
62
65
  },
63
66
  "engines": {
64
- "npm": ">=7",
65
- "node": ">=14"
67
+ "pnpm": ">=6",
68
+ "node": ">=16"
66
69
  },
67
70
  "author": "ICE MT",
68
- "scripts": {
69
- "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
70
- "prebuild": "exit 0",
71
- "predev": "exit 0",
72
- "build": "node ../../scripts/build/build.js"
71
+ "jestSonar": {
72
+ "sonar56x": true,
73
+ "reportPath": "reports",
74
+ "reportFile": "tests.xml",
75
+ "indent": 4
73
76
  },
74
77
  "dependencies": {
75
- "@elliemae/ds-props-helpers": "2.3.0-rc.1",
78
+ "@elliemae/ds-props-helpers": "3.0.0-alpha.1",
76
79
  "react-desc": "~4.1.3",
77
80
  "uid": "~2.0.0"
78
81
  },
@@ -86,7 +89,13 @@
86
89
  },
87
90
  "publishConfig": {
88
91
  "access": "public",
89
- "directory": "dist",
90
- "generateSubmodules": true
92
+ "typeSafety": false
93
+ },
94
+ "scripts": {
95
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
96
+ "test": "node ../../scripts/testing/test.mjs",
97
+ "lint": "node ../../scripts/lint.mjs",
98
+ "dts": "node ../../scripts/dts.mjs",
99
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
91
100
  }
92
101
  }
@@ -1,67 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- var React = require('react');
7
- var reactDesc = require('react-desc');
8
- var uid = require('uid');
9
- var propTypes = require('./propTypes.js');
10
- var styles = require('./styles.js');
11
-
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
15
-
16
- const DSFormLayoutBlockItem = props => {
17
- const {
18
- label,
19
- feedbackMessage,
20
- validationMessage,
21
- inputID,
22
- children,
23
- hasError,
24
- leftLabel,
25
- required,
26
- optional,
27
- hideLabel,
28
- fitContent,
29
- withHighlight,
30
- isGroup = false
31
- } = props;
32
- const instanceUID = React.useMemo(() => uid.uid(6), []);
33
- return /*#__PURE__*/_jsx__default["default"](styles.StyledContainer, {
34
- leftLabel: leftLabel,
35
- fitContent: fitContent,
36
- hideLabel: hideLabel,
37
- withHighlight: withHighlight,
38
- as: isGroup ? 'fieldset' : 'div',
39
- isGroup: isGroup,
40
- "aria-describedby": "".concat(inputID || instanceUID, "_feedback_message")
41
- }, void 0, /*#__PURE__*/_jsx__default["default"](styles.StyledLabel, {
42
- htmlFor: inputID,
43
- leftLabel: leftLabel,
44
- hideLabel: hideLabel,
45
- "aria-hidden": isGroup
46
- }, void 0, label, (required || optional) && /*#__PURE__*/_jsx__default["default"](styles.StyledMark, {
47
- required: required
48
- })), isGroup && /*#__PURE__*/_jsx__default["default"](styles.ScreenReaderOnly, {
49
- as: "legend"
50
- }, void 0, "".concat(label, ". ").concat(feedbackMessage || '')), children, feedbackMessage && !hasError && /*#__PURE__*/_jsx__default["default"](styles.StyledMessage, {
51
- leftLabel: leftLabel,
52
- hideLabel: hideLabel,
53
- "aria-hidden": isGroup,
54
- id: "".concat(inputID || instanceUID, "_feedback_message")
55
- }, void 0, feedbackMessage), validationMessage && hasError && /*#__PURE__*/_jsx__default["default"](styles.StyledMessage, {
56
- hasError: hasError,
57
- leftLabel: leftLabel,
58
- hideLabel: hideLabel,
59
- role: "alert"
60
- }, void 0, validationMessage));
61
- };
62
-
63
- const DSFormLayoutBlockItemWithSchema = reactDesc.describe(DSFormLayoutBlockItem);
64
- DSFormLayoutBlockItemWithSchema.propTypes = propTypes.propTypes;
65
-
66
- exports.DSFormLayoutBlockItem = DSFormLayoutBlockItem;
67
- exports.DSFormLayoutBlockItemWithSchema = DSFormLayoutBlockItemWithSchema;
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var DSFormLayoutBlockItem = require('./DSFormLayoutBlockItem.js');
6
-
7
-
8
-
9
- exports.DSFormLayoutBlockItem = DSFormLayoutBlockItem.DSFormLayoutBlockItem;
10
- exports.DSFormLayoutBlockItemWithSchema = DSFormLayoutBlockItem.DSFormLayoutBlockItemWithSchema;
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
6
-
7
- const propTypes = {
8
- children: reactDesc.PropTypes.node.isRequired.description('Input component. '),
9
- label: reactDesc.PropTypes.string.isRequired.description('Label property for the input component. This property is required for accesibility purposes.'),
10
- inputID: reactDesc.PropTypes.string.isRequired.description("String that matches the input component's id. This property is required for accesibility purposes."),
11
- feedbackMessage: reactDesc.PropTypes.string.description('Feedback message to show below the input component.'),
12
- validationMessage: reactDesc.PropTypes.string.description('Validation message to show below the input component. It requires hasError property set to true to be visible.'),
13
- hasError: reactDesc.PropTypes.bool.description('Helper boolean property for the validation message.'),
14
- required: reactDesc.PropTypes.bool.description('Adds required extra styling.'),
15
- optional: reactDesc.PropTypes.bool.description('Adds optional extra styling.'),
16
- fitContent: reactDesc.PropTypes.bool.description('Set the width of the layout to the input component.'),
17
- leftLabel: reactDesc.PropTypes.bool.description('Adds the label at the left of the input component.'),
18
- hideLabel: reactDesc.PropTypes.bool.description('Hides the input label. It still requires label and labelFor property for accesibility purposes'),
19
- withHighlight: reactDesc.PropTypes.bool.description('Adds highlight extra styling. It requires extra spacing, please check withHighlight explanation tab.'),
20
- isGroup: reactDesc.PropTypes.bool.description('Sets the HTML elements as fieldset and legend. This should be used when you want to group more than one input.')
21
- };
22
-
23
- exports.propTypes = propTypes;
@@ -1,92 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var styled = require('styled-components');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
10
-
11
- const StyledContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
12
- componentId: "sc-196zgtg-0"
13
- })(["position:relative;padding:0;margin:0;display:grid;", " ", ";", " align-items:center;", ""], _ref => {
14
- let {
15
- fitContent
16
- } = _ref;
17
- return fitContent ? 'width: fit-content;' : undefined;
18
- }, _ref2 => {
19
- let {
20
- isGroup
21
- } = _ref2;
22
- return isGroup ? 'border: none' : '';
23
- }, _ref3 => {
24
- let {
25
- leftLabel,
26
- hideLabel
27
- } = _ref3;
28
- return leftLabel && !hideLabel ? 'grid-template-columns: max-content auto;' : undefined;
29
- }, _ref4 => {
30
- let {
31
- theme,
32
- withHighlight
33
- } = _ref4;
34
- return withHighlight ? "\n &::after {\n position: absolute;\n content: '';\n left: -".concat(theme.space.xxs, ";\n top: -").concat(theme.space.xxxs, ";\n z-index: -1;\n width: calc(100% + ").concat(theme.space.xs, ");\n height: calc(100% + ").concat(theme.space.xxs, ");\n background-color: #FEFBEE;\n border : 1px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 1px 3px 0 rgba(0,0,0,0.35);\n }\n &:hover, \n &:focus-within {\n &::after {\n position: absolute;\n content: '';\n left: -").concat(theme.space.xxs, ";\n top: -").concat(theme.space.xxxs, ";\n z-index: -1;\n width: calc(100% + ").concat(theme.space.xs, ");\n height: calc(100% + ").concat(theme.space.xxs, ");\n background-color: #FFF9D3;\n border : 2px solid #8F6326;\n border-radius : 4px;\n box-shadow: 0 6px 10px 0 rgba(0,0,0,0.30);\n }\n }\n ") : undefined;
35
- });
36
- const StyledLabel = /*#__PURE__*/styled__default["default"].label.withConfig({
37
- componentId: "sc-196zgtg-1"
38
- })(["display:flex;", " ", ""], _ref5 => {
39
- let {
40
- theme,
41
- leftLabel
42
- } = _ref5;
43
- return leftLabel ? "padding-right: ".concat(theme.space.xxs, ";") : undefined;
44
- }, _ref6 => {
45
- let {
46
- hideLabel
47
- } = _ref6;
48
- return hideLabel ? "position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n " : undefined;
49
- });
50
- const StyledMessage = /*#__PURE__*/styled__default["default"].div.withConfig({
51
- componentId: "sc-196zgtg-2"
52
- })(["font-size:", ";font-style:italic;text-align:right;line-height:15px;height:15px;overflow:hidden;text-overflow:ellipsis;color:", ";", ""], _ref7 => {
53
- let {
54
- theme
55
- } = _ref7;
56
- return theme.fontSizes.microText[200];
57
- }, _ref8 => {
58
- let {
59
- theme,
60
- hasError
61
- } = _ref8;
62
- return hasError ? theme.colors.danger[900] : theme.colors.neutral[500];
63
- }, _ref9 => {
64
- let {
65
- leftLabel,
66
- hideLabel
67
- } = _ref9;
68
- return leftLabel && !hideLabel ? 'grid-column: 1/3;' : undefined;
69
- });
70
- const StyledMark = /*#__PURE__*/styled__default["default"].span.withConfig({
71
- componentId: "sc-196zgtg-3"
72
- })(["width:6px;height:6px;border-radius:50%;margin-left:", ";", ""], _ref10 => {
73
- let {
74
- theme
75
- } = _ref10;
76
- return theme.space.xxxs;
77
- }, _ref11 => {
78
- let {
79
- theme,
80
- required
81
- } = _ref11;
82
- return required ? "\n background-color: ".concat(theme.colors.danger[900], ";\n ") : "\n border: 1px solid ".concat(theme.colors.brand[600], ";\n ");
83
- });
84
- const ScreenReaderOnly = /*#__PURE__*/styled__default["default"].div.withConfig({
85
- componentId: "sc-196zgtg-4"
86
- })(["clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px;"]);
87
-
88
- exports.ScreenReaderOnly = ScreenReaderOnly;
89
- exports.StyledContainer = StyledContainer;
90
- exports.StyledLabel = StyledLabel;
91
- exports.StyledMark = StyledMark;
92
- exports.StyledMessage = StyledMessage;
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('react');
7
- var reactDesc = require('react-desc');
8
- var dsPropsHelpers = require('@elliemae/ds-props-helpers');
9
- var propTypes = require('./propTypes.js');
10
- var styles = require('./styles.js');
11
- var defaultProps = require('./defaultProps.js');
12
- var useValidateProps = require('./config/useValidateProps.js');
13
-
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
-
18
- const DSFormLayoutCheckboxGroup = props => {
19
- useValidateProps.useValidateProps(props);
20
- const propsWithDefault = dsPropsHelpers.useMemoMergePropsWithDefault(props, defaultProps.defaultProps);
21
- return /*#__PURE__*/_jsx__default["default"](styles.StyledContainer, {
22
- direction: propsWithDefault.direction
23
- }, void 0, propsWithDefault.children);
24
- };
25
-
26
- const DSFormLayoutCheckboxGroupWithSchema = reactDesc.describe(DSFormLayoutCheckboxGroup);
27
- DSFormLayoutCheckboxGroupWithSchema.propTypes = propTypes.propTypes;
28
-
29
- exports.DSFormLayoutCheckboxGroup = DSFormLayoutCheckboxGroup;
30
- exports.DSFormLayoutCheckboxGroupWithSchema = DSFormLayoutCheckboxGroupWithSchema;
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
-
11
- const getVariableType = arg => {
12
- if (Array.isArray(arg)) return 'array';
13
- if (arg === null) return 'null';
14
- if (arg === undefined) return 'undefined';
15
- return typeof arg;
16
- };
17
-
18
- const throwCheckboxGroupDirectionError = invalidProp => {
19
- throw new Error("You are trying to pass a not valid \"direction\" property value for a checkbox group, please provide a valid type.\n\n Received: ".concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: \"horizontal\" or \"vertical\" (string)\n "));
20
- };
21
-
22
- const throwCheckboxGroupChildrenError = () => {
23
- throw new Error("You are trying to use a checkbox group without any React children, please provide at least one children to use.\n \n Received: (null)\n Expected: React children\n ");
24
- };
25
-
26
- const useValidateProps = props => {
27
- if (props.direction !== undefined && props.direction !== 'vertical' && props.direction !== 'horizontal') {
28
- throwCheckboxGroupDirectionError(props.direction);
29
- }
30
-
31
- if (!React__default["default"].Children.count(props.children)) {
32
- throwCheckboxGroupChildrenError();
33
- }
34
- };
35
-
36
- exports.useValidateProps = useValidateProps;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const defaultProps = {
6
- direction: 'horizontal'
7
- };
8
-
9
- exports.defaultProps = defaultProps;
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var DSFormLayoutCheckboxGroup = require('./DSFormLayoutCheckboxGroup.js');
6
-
7
-
8
-
9
- exports.DSFormLayoutCheckboxGroup = DSFormLayoutCheckboxGroup.DSFormLayoutCheckboxGroup;
10
- exports.DSFormLayoutCheckboxGroupWithSchema = DSFormLayoutCheckboxGroup.DSFormLayoutCheckboxGroupWithSchema;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
6
-
7
- const propTypes = {
8
- direction: reactDesc.PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.')
9
- };
10
-
11
- exports.propTypes = propTypes;
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var styled = require('styled-components');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
10
-
11
- const StyledContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
12
- componentId: "sc-1wopk9q-0"
13
- })(["display:inline-flex;flex-wrap:wrap;flex-direction:", ";margin-left:", ";margin-right:", ";margin-top:", ";& div{padding:0;margin-bottom:", ";}& div:not(:last-child){margin-right:", ";}"], _ref => {
14
- let {
15
- direction
16
- } = _ref;
17
- return direction === 'horizontal' ? 'row' : 'column';
18
- }, _ref2 => {
19
- let {
20
- theme
21
- } = _ref2;
22
- return theme.space.xs;
23
- }, _ref3 => {
24
- let {
25
- theme
26
- } = _ref3;
27
- return theme.space.xs;
28
- }, _ref4 => {
29
- let {
30
- theme
31
- } = _ref4;
32
- return theme.space.xxs;
33
- }, _ref5 => {
34
- let {
35
- theme
36
- } = _ref5;
37
- return theme.space.xxs;
38
- }, _ref6 => {
39
- let {
40
- theme,
41
- direction
42
- } = _ref6;
43
- return direction === 'horizontal' ? theme.space.s : '0';
44
- });
45
-
46
- exports.StyledContainer = StyledContainer;
package/cjs/index.d.js DELETED
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
package/cjs/index.js DELETED
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var DSFormLayoutBlockItem = require('./form-layout-block-item/DSFormLayoutBlockItem.js');
6
- var DSFormLayoutCheckboxGroup = require('./form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js');
7
-
8
-
9
-
10
- exports.DSFormLayoutBlockItem = DSFormLayoutBlockItem.DSFormLayoutBlockItem;
11
- exports.DSFormLayoutBlockItemWithSchema = DSFormLayoutBlockItem.DSFormLayoutBlockItemWithSchema;
12
- exports.DSFormLayoutCheckboxGroup = DSFormLayoutCheckboxGroup.DSFormLayoutCheckboxGroup;
13
- exports.DSFormLayoutCheckboxGroupWithSchema = DSFormLayoutCheckboxGroup.DSFormLayoutCheckboxGroupWithSchema;
@@ -1,58 +0,0 @@
1
- import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import { useMemo } from 'react';
3
- import { describe } from 'react-desc';
4
- import { uid } from 'uid';
5
- import { propTypes } from './propTypes.js';
6
- import { StyledContainer, StyledLabel, StyledMark, ScreenReaderOnly, StyledMessage } from './styles.js';
7
-
8
- const DSFormLayoutBlockItem = props => {
9
- const {
10
- label,
11
- feedbackMessage,
12
- validationMessage,
13
- inputID,
14
- children,
15
- hasError,
16
- leftLabel,
17
- required,
18
- optional,
19
- hideLabel,
20
- fitContent,
21
- withHighlight,
22
- isGroup = false
23
- } = props;
24
- const instanceUID = useMemo(() => uid(6), []);
25
- return /*#__PURE__*/_jsx(StyledContainer, {
26
- leftLabel: leftLabel,
27
- fitContent: fitContent,
28
- hideLabel: hideLabel,
29
- withHighlight: withHighlight,
30
- as: isGroup ? 'fieldset' : 'div',
31
- isGroup: isGroup,
32
- "aria-describedby": "".concat(inputID || instanceUID, "_feedback_message")
33
- }, void 0, /*#__PURE__*/_jsx(StyledLabel, {
34
- htmlFor: inputID,
35
- leftLabel: leftLabel,
36
- hideLabel: hideLabel,
37
- "aria-hidden": isGroup
38
- }, void 0, label, (required || optional) && /*#__PURE__*/_jsx(StyledMark, {
39
- required: required
40
- })), isGroup && /*#__PURE__*/_jsx(ScreenReaderOnly, {
41
- as: "legend"
42
- }, void 0, "".concat(label, ". ").concat(feedbackMessage || '')), children, feedbackMessage && !hasError && /*#__PURE__*/_jsx(StyledMessage, {
43
- leftLabel: leftLabel,
44
- hideLabel: hideLabel,
45
- "aria-hidden": isGroup,
46
- id: "".concat(inputID || instanceUID, "_feedback_message")
47
- }, void 0, feedbackMessage), validationMessage && hasError && /*#__PURE__*/_jsx(StyledMessage, {
48
- hasError: hasError,
49
- leftLabel: leftLabel,
50
- hideLabel: hideLabel,
51
- role: "alert"
52
- }, void 0, validationMessage));
53
- };
54
-
55
- const DSFormLayoutBlockItemWithSchema = describe(DSFormLayoutBlockItem);
56
- DSFormLayoutBlockItemWithSchema.propTypes = propTypes;
57
-
58
- export { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema };
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
- export { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema } from './DSFormLayoutBlockItem.js';