@elliemae/ds-form-layout-label 3.22.0-next.0

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 (39) hide show
  1. package/dist/cjs/DSFormLayoutLabel.js +54 -0
  2. package/dist/cjs/DSFormLayoutLabel.js.map +7 -0
  3. package/dist/cjs/config/useFormLayoutLabel.js +58 -0
  4. package/dist/cjs/config/useFormLayoutLabel.js.map +7 -0
  5. package/dist/cjs/config/useValidateProps.js +40 -0
  6. package/dist/cjs/config/useValidateProps.js.map +7 -0
  7. package/dist/cjs/constants/index.js +44 -0
  8. package/dist/cjs/constants/index.js.map +7 -0
  9. package/dist/cjs/index.js +42 -0
  10. package/dist/cjs/index.js.map +7 -0
  11. package/dist/cjs/package.json +7 -0
  12. package/dist/cjs/react-desc-prop-types.js +46 -0
  13. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  14. package/dist/cjs/styled.js +69 -0
  15. package/dist/cjs/styled.js.map +7 -0
  16. package/dist/esm/DSFormLayoutLabel.js +24 -0
  17. package/dist/esm/DSFormLayoutLabel.js.map +7 -0
  18. package/dist/esm/config/useFormLayoutLabel.js +28 -0
  19. package/dist/esm/config/useFormLayoutLabel.js.map +7 -0
  20. package/dist/esm/config/useValidateProps.js +10 -0
  21. package/dist/esm/config/useValidateProps.js.map +7 -0
  22. package/dist/esm/constants/index.js +14 -0
  23. package/dist/esm/constants/index.js.map +7 -0
  24. package/dist/esm/index.js +12 -0
  25. package/dist/esm/index.js.map +7 -0
  26. package/dist/esm/package.json +7 -0
  27. package/dist/esm/react-desc-prop-types.js +20 -0
  28. package/dist/esm/react-desc-prop-types.js.map +7 -0
  29. package/dist/esm/styled.js +39 -0
  30. package/dist/esm/styled.js.map +7 -0
  31. package/dist/types/DSFormLayoutLabel.d.ts +5 -0
  32. package/dist/types/config/useFormLayoutLabel.d.ts +13 -0
  33. package/dist/types/config/useValidateProps.d.ts +3 -0
  34. package/dist/types/constants/index.d.ts +6 -0
  35. package/dist/types/index.d.ts +3 -0
  36. package/dist/types/react-desc-prop-types.d.ts +21 -0
  37. package/dist/types/styled.d.ts +9 -0
  38. package/dist/types/tests/DSFormLayoutLabel.test.d.ts +1 -0
  39. package/package.json +71 -0
@@ -0,0 +1,54 @@
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
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var DSFormLayoutLabel_exports = {};
30
+ __export(DSFormLayoutLabel_exports, {
31
+ DSFormLayoutLabel: () => DSFormLayoutLabel,
32
+ DSFormLayoutLabelWithSchema: () => DSFormLayoutLabelWithSchema
33
+ });
34
+ module.exports = __toCommonJS(DSFormLayoutLabel_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
39
+ var import_useFormLayoutLabel = require("./config/useFormLayoutLabel.js");
40
+ var import_constants = require("./constants/index.js");
41
+ var import_styled = require("./styled.js");
42
+ const DSFormLayoutLabel = (props) => {
43
+ const { propsWithDefault, globalProps, xstyledProps } = (0, import_useFormLayoutLabel.useFormLayoutLabel)(props);
44
+ const { children, required, hideLabel, optional } = propsWithDefault;
45
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledLabel, { ...globalProps, ...xstyledProps, hideLabel, children: [
46
+ children,
47
+ (required || optional) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledMark, { required })
48
+ ] });
49
+ };
50
+ DSFormLayoutLabel.propTypes = import_react_desc_prop_types.DSFormLayoutLabelPropTypes;
51
+ DSFormLayoutLabel.displayName = import_constants.DSFormLayoutLabelName;
52
+ const DSFormLayoutLabelWithSchema = (0, import_ds_props_helpers.describe)(DSFormLayoutLabel);
53
+ DSFormLayoutLabelWithSchema.propTypes = import_react_desc_prop_types.DSFormLayoutLabelPropTypes;
54
+ //# sourceMappingURL=DSFormLayoutLabel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSFormLayoutLabel.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSFormLayoutLabelT, DSFormLayoutLabelPropTypes } from './react-desc-prop-types.js';\nimport { useFormLayoutLabel } from './config/useFormLayoutLabel.js';\nimport { DSFormLayoutLabelName } from './constants/index.js';\nimport { StyledLabel, StyledMark } from './styled.js';\nconst DSFormLayoutLabel: React.ComponentType<DSFormLayoutLabelT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useFormLayoutLabel(props);\n const { children, required, hideLabel, optional } = propsWithDefault;\n return (\n <StyledLabel {...globalProps} {...xstyledProps} hideLabel={hideLabel}>\n {children}\n {(required || optional) && <StyledMark required={required} />}\n </StyledLabel>\n );\n};\n\nDSFormLayoutLabel.propTypes = DSFormLayoutLabelPropTypes;\nDSFormLayoutLabel.displayName = DSFormLayoutLabelName;\nconst DSFormLayoutLabelWithSchema = describe(DSFormLayoutLabel);\nDSFormLayoutLabelWithSchema.propTypes = DSFormLayoutLabelPropTypes;\n\nexport { DSFormLayoutLabel, DSFormLayoutLabelWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADUnB;AATJ,8BAAyB;AACzB,mCAAoE;AACpE,gCAAmC;AACnC,uBAAsC;AACtC,oBAAwC;AACxC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,8CAAmB,KAAK;AAChF,QAAM,EAAE,UAAU,UAAU,WAAW,SAAS,IAAI;AACpD,SACE,6CAAC,6BAAa,GAAG,aAAc,GAAG,cAAc,WAC7C;AAAA;AAAA,KACC,YAAY,aAAa,4CAAC,4BAAW,UAAoB;AAAA,KAC7D;AAEJ;AAEA,kBAAkB,YAAY;AAC9B,kBAAkB,cAAc;AAChC,MAAM,kCAA8B,kCAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,58 @@
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
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useFormLayoutLabel_exports = {};
30
+ __export(useFormLayoutLabel_exports, {
31
+ useFormLayoutLabel: () => useFormLayoutLabel
32
+ });
33
+ module.exports = __toCommonJS(useFormLayoutLabel_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_lodash = require("lodash");
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_react_desc_prop_types = require("../react-desc-prop-types.js");
39
+ var import_useValidateProps = require("./useValidateProps.js");
40
+ const useFormLayoutLabel = (propsFromUser) => {
41
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
42
+ (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSFormLayoutLabelPropTypes);
43
+ const globalProps = (0, import_lodash.omit)((0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault), [
44
+ "cols",
45
+ "rows",
46
+ "wrap"
47
+ ]);
48
+ const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
49
+ return import_react.default.useMemo(
50
+ () => ({
51
+ propsWithDefault,
52
+ globalProps,
53
+ xstyledProps
54
+ }),
55
+ [propsWithDefault, globalProps, xstyledProps]
56
+ );
57
+ };
58
+ //# sourceMappingURL=useFormLayoutLabel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useFormLayoutLabel.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSFormLayoutLabelT, DSFormLayoutLabelPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface FormLayoutLabelCTX {\n propsWithDefault: DSFormLayoutLabelT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useFormLayoutLabel = (propsFromUser: DSFormLayoutLabelT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSFormLayoutLabelT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSFormLayoutLabelPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSFormLayoutLabelT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAAqB;AACrB,8BAAyF;AACzF,mCAAkF;AAClF,8BAAiC;AAQ1B,MAAM,qBAAqB,CAAC,kBAA4C;AAI7E,QAAM,uBAAmB,sDAA+D,eAAe,yCAAY;AACnH,gDAAiB,kBAAkB,uDAA0B;AAI7D,QAAM,kBAAc,wBAAK,gDAAyD,gBAAgB,GAAG;AAAA,IACnG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,40 @@
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
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useValidateProps_exports = {};
30
+ __export(useValidateProps_exports, {
31
+ useValidateProps: () => useValidateProps
32
+ });
33
+ module.exports = __toCommonJS(useValidateProps_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ var import_constants = require("../constants/index.js");
37
+ const useValidateProps = (props, propTypes) => {
38
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSFormLayoutLabelName);
39
+ };
40
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useValidateProps.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { type WeakValidationMap } from 'react';\nimport { type DSFormLayoutLabelT } from '../react-desc-prop-types.js';\nimport { DSFormLayoutLabelName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSFormLayoutLabelT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSFormLayoutLabelName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAAsC;AAE/B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,sCAAqB;AACxE;",
6
+ "names": []
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
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var constants_exports = {};
30
+ __export(constants_exports, {
31
+ DSFormLayoutBlockItemDataTestId: () => DSFormLayoutBlockItemDataTestId,
32
+ DSFormLayoutLabelName: () => DSFormLayoutLabelName,
33
+ DSFormLayoutLabelSlots: () => DSFormLayoutLabelSlots
34
+ });
35
+ module.exports = __toCommonJS(constants_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_system = require("@elliemae/ds-system");
38
+ const DSFormLayoutLabelName = "DSFormLayoutLabel";
39
+ const DSFormLayoutLabelSlots = {
40
+ LABEL: "label",
41
+ MARK: "mark"
42
+ };
43
+ const DSFormLayoutBlockItemDataTestId = (0, import_ds_system.slotObjectToDataTestIds)(DSFormLayoutLabelName, DSFormLayoutLabelSlots);
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSFormLayoutLabelName = 'DSFormLayoutLabel';\n\nexport const DSFormLayoutLabelSlots = {\n LABEL: 'label',\n MARK: 'mark',\n};\n\nexport const DSFormLayoutBlockItemDataTestId = slotObjectToDataTestIds(DSFormLayoutLabelName, DSFormLayoutLabelSlots);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,wBAAwB;AAE9B,MAAM,yBAAyB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AACR;AAEO,MAAM,sCAAkC,0CAAwB,uBAAuB,sBAAsB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,42 @@
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
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var src_exports = {};
30
+ __export(src_exports, {
31
+ DSFormLayoutBlockItemDataTestId: () => import_constants.DSFormLayoutBlockItemDataTestId,
32
+ DSFormLayoutLabel: () => import_DSFormLayoutLabel.DSFormLayoutLabel,
33
+ DSFormLayoutLabelName: () => import_constants.DSFormLayoutLabelName,
34
+ DSFormLayoutLabelSlots: () => import_constants.DSFormLayoutLabelSlots,
35
+ DSFormLayoutLabelWithSchema: () => import_DSFormLayoutLabel.DSFormLayoutLabelWithSchema
36
+ });
37
+ module.exports = __toCommonJS(src_exports);
38
+ var React = __toESM(require("react"));
39
+ var import_DSFormLayoutLabel = require("./DSFormLayoutLabel.js");
40
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
41
+ var import_constants = require("./constants/index.js");
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSFormLayoutLabel, DSFormLayoutLabelWithSchema } from './DSFormLayoutLabel.js';\nexport { type DSFormLayoutLabelT } from './react-desc-prop-types.js';\nexport { DSFormLayoutBlockItemDataTestId, DSFormLayoutLabelName, DSFormLayoutLabelSlots } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,+BAA+D;AAC/D,mCAAwC;AACxC,uBAA+F;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,46 @@
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
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSFormLayoutLabelPropTypes: () => DSFormLayoutLabelPropTypes,
32
+ defaultProps: () => defaultProps
33
+ });
34
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
+ const defaultProps = {};
38
+ const DSFormLayoutLabelPropTypes = {
39
+ ...import_ds_props_helpers.globalAttributesPropTypes,
40
+ ...import_ds_props_helpers.xstyledPropTypes,
41
+ children: import_ds_props_helpers.PropTypes.node.isRequired.description("label string"),
42
+ required: import_ds_props_helpers.PropTypes.bool.description("Adds required extra styling."),
43
+ optional: import_ds_props_helpers.PropTypes.bool.description("Adds optional extra styling."),
44
+ hideLabel: import_ds_props_helpers.PropTypes.bool.description("Hides the label.")
45
+ };
46
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { WeakValidationMap } from 'react';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n type GlobalAttributesT,\n type XstyledProps,\n} from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSFormLayoutLabelT {\n export interface RequiredProps {\n children: React.ReactNode;\n }\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n required?: boolean;\n optional?: boolean;\n hideLabel?: boolean;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export type ExampleState = '0' | '1';\n}\n\nexport const defaultProps: DSFormLayoutLabelT.DefaultProps = {};\n\nexport const DSFormLayoutLabelPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.node.isRequired.description('label string'),\n required: PropTypes.bool.description('Adds required extra styling.'),\n optional: PropTypes.bool.description('Adds optional extra styling.'),\n hideLabel: PropTypes.bool.description('Hides the label.'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAMO;AAsCA,MAAM,eAAgD,CAAC;AAEvD,MAAM,6BAA6B;AAAA,EACxC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,KAAK,WAAW,YAAY,cAAc;AAAA,EAC9D,UAAU,kCAAU,KAAK,YAAY,8BAA8B;AAAA,EACnE,UAAU,kCAAU,KAAK,YAAY,8BAA8B;AAAA,EACnE,WAAW,kCAAU,KAAK,YAAY,kBAAkB;AAC1D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,69 @@
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
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var styled_exports = {};
30
+ __export(styled_exports, {
31
+ StyledLabel: () => StyledLabel,
32
+ StyledMark: () => StyledMark
33
+ });
34
+ module.exports = __toCommonJS(styled_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_system = require("@elliemae/ds-system");
37
+ var import_constants = require("./constants/index.js");
38
+ const StyledLabel = (0, import_ds_system.styled)("label", {
39
+ name: import_constants.DSFormLayoutLabelName,
40
+ slot: import_constants.DSFormLayoutLabelSlots.LABEL
41
+ })`
42
+ display: flex;
43
+ ${({ hideLabel }) => hideLabel ? `position: absolute;
44
+ width: 1px;
45
+ height: 1px;
46
+ padding: 0;
47
+ margin: -1px;
48
+ overflow: hidden;
49
+ clip: rect(0, 0, 0, 0);
50
+ white-space: nowrap;
51
+ border: 0;
52
+ ` : void 0}
53
+ ${import_ds_system.xStyledCommonProps}
54
+ `;
55
+ const StyledMark = (0, import_ds_system.styled)("span", {
56
+ name: import_constants.DSFormLayoutLabelName,
57
+ slot: import_constants.DSFormLayoutLabelSlots.MARK
58
+ })`
59
+ width: 6px;
60
+ height: 6px;
61
+ border-radius: 50%;
62
+ margin-left: ${({ theme }) => theme.space.xxxs};
63
+ ${({ theme, required }) => required ? `
64
+ background-color: ${theme.colors.danger[900]};
65
+ ` : `
66
+ border: 1px solid ${theme.colors.brand[600]};
67
+ `}
68
+ `;
69
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSFormLayoutLabelName, DSFormLayoutLabelSlots } from './constants/index.js';\n\ninterface DSFormLayoutBlockItemStyledLabelT {\n hideLabel?: boolean;\n}\n\ninterface DSFormLayoutBlockItemStyledMarkT {\n required?: boolean;\n}\n\nexport const StyledLabel = styled('label', {\n name: DSFormLayoutLabelName,\n slot: DSFormLayoutLabelSlots.LABEL,\n})<DSFormLayoutBlockItemStyledLabelT>`\n display: flex;\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 ${xStyledCommonProps}\n`;\n\nexport const StyledMark = styled('span', {\n name: DSFormLayoutLabelName,\n slot: DSFormLayoutLabelSlots.MARK,\n})<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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA2C;AAC3C,uBAA8D;AAUvD,MAAM,kBAAc,yBAAO,SAAS;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,wCAAuB;AAC/B,CAAC;AAAA;AAAA,IAEG,CAAC,EAAE,UAAU,MACb,YACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUA;AAAA,IACJ;AAAA;AAGG,MAAM,iBAAa,yBAAO,QAAQ;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,wCAAuB;AAC/B,CAAC;AAAA;AAAA;AAAA;AAAA,iBAIgB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,IACxC,CAAC,EAAE,OAAO,SAAS,MACnB,WACI;AAAA,sBACc,MAAM,OAAO,OAAO,GAAG;AAAA,MAErC;AAAA,sBACc,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { describe } from "@elliemae/ds-props-helpers";
4
+ import { DSFormLayoutLabelPropTypes } from "./react-desc-prop-types.js";
5
+ import { useFormLayoutLabel } from "./config/useFormLayoutLabel.js";
6
+ import { DSFormLayoutLabelName } from "./constants/index.js";
7
+ import { StyledLabel, StyledMark } from "./styled.js";
8
+ const DSFormLayoutLabel = (props) => {
9
+ const { propsWithDefault, globalProps, xstyledProps } = useFormLayoutLabel(props);
10
+ const { children, required, hideLabel, optional } = propsWithDefault;
11
+ return /* @__PURE__ */ jsxs(StyledLabel, { ...globalProps, ...xstyledProps, hideLabel, children: [
12
+ children,
13
+ (required || optional) && /* @__PURE__ */ jsx(StyledMark, { required })
14
+ ] });
15
+ };
16
+ DSFormLayoutLabel.propTypes = DSFormLayoutLabelPropTypes;
17
+ DSFormLayoutLabel.displayName = DSFormLayoutLabelName;
18
+ const DSFormLayoutLabelWithSchema = describe(DSFormLayoutLabel);
19
+ DSFormLayoutLabelWithSchema.propTypes = DSFormLayoutLabelPropTypes;
20
+ export {
21
+ DSFormLayoutLabel,
22
+ DSFormLayoutLabelWithSchema
23
+ };
24
+ //# sourceMappingURL=DSFormLayoutLabel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSFormLayoutLabel.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSFormLayoutLabelT, DSFormLayoutLabelPropTypes } from './react-desc-prop-types.js';\nimport { useFormLayoutLabel } from './config/useFormLayoutLabel.js';\nimport { DSFormLayoutLabelName } from './constants/index.js';\nimport { StyledLabel, StyledMark } from './styled.js';\nconst DSFormLayoutLabel: React.ComponentType<DSFormLayoutLabelT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useFormLayoutLabel(props);\n const { children, required, hideLabel, optional } = propsWithDefault;\n return (\n <StyledLabel {...globalProps} {...xstyledProps} hideLabel={hideLabel}>\n {children}\n {(required || optional) && <StyledMark required={required} />}\n </StyledLabel>\n );\n};\n\nDSFormLayoutLabel.propTypes = DSFormLayoutLabelPropTypes;\nDSFormLayoutLabel.displayName = DSFormLayoutLabelName;\nconst DSFormLayoutLabelWithSchema = describe(DSFormLayoutLabel);\nDSFormLayoutLabelWithSchema.propTypes = DSFormLayoutLabelPropTypes;\n\nexport { DSFormLayoutLabel, DSFormLayoutLabelWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACUnB,SAE6B,KAF7B;AATJ,SAAS,gBAAgB;AACzB,SAAkC,kCAAkC;AACpE,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,aAAa,kBAAkB;AACxC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,mBAAmB,KAAK;AAChF,QAAM,EAAE,UAAU,UAAU,WAAW,SAAS,IAAI;AACpD,SACE,qBAAC,eAAa,GAAG,aAAc,GAAG,cAAc,WAC7C;AAAA;AAAA,KACC,YAAY,aAAa,oBAAC,cAAW,UAAoB;AAAA,KAC7D;AAEJ;AAEA,kBAAkB,YAAY;AAC9B,kBAAkB,cAAc;AAChC,MAAM,8BAA8B,SAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { omit } from "lodash";
4
+ import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
5
+ import { DSFormLayoutLabelPropTypes, defaultProps } from "../react-desc-prop-types.js";
6
+ import { useValidateProps } from "./useValidateProps.js";
7
+ const useFormLayoutLabel = (propsFromUser) => {
8
+ const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
9
+ useValidateProps(propsWithDefault, DSFormLayoutLabelPropTypes);
10
+ const globalProps = omit(useGetGlobalAttributes(propsWithDefault), [
11
+ "cols",
12
+ "rows",
13
+ "wrap"
14
+ ]);
15
+ const xstyledProps = useGetXstyledProps(propsWithDefault);
16
+ return React2.useMemo(
17
+ () => ({
18
+ propsWithDefault,
19
+ globalProps,
20
+ xstyledProps
21
+ }),
22
+ [propsWithDefault, globalProps, xstyledProps]
23
+ );
24
+ };
25
+ export {
26
+ useFormLayoutLabel
27
+ };
28
+ //# sourceMappingURL=useFormLayoutLabel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useFormLayoutLabel.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSFormLayoutLabelT, DSFormLayoutLabelPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface FormLayoutLabelCTX {\n propsWithDefault: DSFormLayoutLabelT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useFormLayoutLabel = (propsFromUser: DSFormLayoutLabelT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSFormLayoutLabelT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSFormLayoutLabelPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSFormLayoutLabelT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAkC,4BAA4B,oBAAoB;AAClF,SAAS,wBAAwB;AAQ1B,MAAM,qBAAqB,CAAC,kBAA4C;AAI7E,QAAM,mBAAmB,6BAA+D,eAAe,YAAY;AACnH,mBAAiB,kBAAkB,0BAA0B;AAI7D,QAAM,cAAc,KAAK,uBAAyD,gBAAgB,GAAG;AAAA,IACnG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
3
+ import { DSFormLayoutLabelName } from "../constants/index.js";
4
+ const useValidateProps = (props, propTypes) => {
5
+ useValidateTypescriptPropTypes(props, propTypes, DSFormLayoutLabelName);
6
+ };
7
+ export {
8
+ useValidateProps
9
+ };
10
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { type WeakValidationMap } from 'react';\nimport { type DSFormLayoutLabelT } from '../react-desc-prop-types.js';\nimport { DSFormLayoutLabelName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSFormLayoutLabelT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSFormLayoutLabelName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,6BAA6B;AAE/B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,qBAAqB;AACxE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { slotObjectToDataTestIds } from "@elliemae/ds-system";
3
+ const DSFormLayoutLabelName = "DSFormLayoutLabel";
4
+ const DSFormLayoutLabelSlots = {
5
+ LABEL: "label",
6
+ MARK: "mark"
7
+ };
8
+ const DSFormLayoutBlockItemDataTestId = slotObjectToDataTestIds(DSFormLayoutLabelName, DSFormLayoutLabelSlots);
9
+ export {
10
+ DSFormLayoutBlockItemDataTestId,
11
+ DSFormLayoutLabelName,
12
+ DSFormLayoutLabelSlots
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSFormLayoutLabelName = 'DSFormLayoutLabel';\n\nexport const DSFormLayoutLabelSlots = {\n LABEL: 'label',\n MARK: 'mark',\n};\n\nexport const DSFormLayoutBlockItemDataTestId = slotObjectToDataTestIds(DSFormLayoutLabelName, DSFormLayoutLabelSlots);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,wBAAwB;AAE9B,MAAM,yBAAyB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AACR;AAEO,MAAM,kCAAkC,wBAAwB,uBAAuB,sBAAsB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { DSFormLayoutLabel, DSFormLayoutLabelWithSchema } from "./DSFormLayoutLabel.js";
3
+ import {} from "./react-desc-prop-types.js";
4
+ import { DSFormLayoutBlockItemDataTestId, DSFormLayoutLabelName, DSFormLayoutLabelSlots } from "./constants/index.js";
5
+ export {
6
+ DSFormLayoutBlockItemDataTestId,
7
+ DSFormLayoutLabel,
8
+ DSFormLayoutLabelName,
9
+ DSFormLayoutLabelSlots,
10
+ DSFormLayoutLabelWithSchema
11
+ };
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSFormLayoutLabel, DSFormLayoutLabelWithSchema } from './DSFormLayoutLabel.js';\nexport { type DSFormLayoutLabelT } from './react-desc-prop-types.js';\nexport { DSFormLayoutBlockItemDataTestId, DSFormLayoutLabelName, DSFormLayoutLabelSlots } from './constants/index.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,mBAAmB,mCAAmC;AAC/D,eAAwC;AACxC,SAAS,iCAAiC,uBAAuB,8BAA8B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import {
3
+ PropTypes,
4
+ globalAttributesPropTypes,
5
+ xstyledPropTypes
6
+ } from "@elliemae/ds-props-helpers";
7
+ const defaultProps = {};
8
+ const DSFormLayoutLabelPropTypes = {
9
+ ...globalAttributesPropTypes,
10
+ ...xstyledPropTypes,
11
+ children: PropTypes.node.isRequired.description("label string"),
12
+ required: PropTypes.bool.description("Adds required extra styling."),
13
+ optional: PropTypes.bool.description("Adds optional extra styling."),
14
+ hideLabel: PropTypes.bool.description("Hides the label.")
15
+ };
16
+ export {
17
+ DSFormLayoutLabelPropTypes,
18
+ defaultProps
19
+ };
20
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { WeakValidationMap } from 'react';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n type GlobalAttributesT,\n type XstyledProps,\n} from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSFormLayoutLabelT {\n export interface RequiredProps {\n children: React.ReactNode;\n }\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n required?: boolean;\n optional?: boolean;\n hideLabel?: boolean;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export type ExampleState = '0' | '1';\n}\n\nexport const defaultProps: DSFormLayoutLabelT.DefaultProps = {};\n\nexport const DSFormLayoutLabelPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.node.isRequired.description('label string'),\n required: PropTypes.bool.description('Adds required extra styling.'),\n optional: PropTypes.bool.description('Adds optional extra styling.'),\n hideLabel: PropTypes.bool.description('Hides the label.'),\n} as WeakValidationMap<unknown>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAsCA,MAAM,eAAgD,CAAC;AAEvD,MAAM,6BAA6B;AAAA,EACxC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU,KAAK,WAAW,YAAY,cAAc;AAAA,EAC9D,UAAU,UAAU,KAAK,YAAY,8BAA8B;AAAA,EACnE,UAAU,UAAU,KAAK,YAAY,8BAA8B;AAAA,EACnE,WAAW,UAAU,KAAK,YAAY,kBAAkB;AAC1D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ import { styled, xStyledCommonProps } from "@elliemae/ds-system";
3
+ import { DSFormLayoutLabelName, DSFormLayoutLabelSlots } from "./constants/index.js";
4
+ const StyledLabel = styled("label", {
5
+ name: DSFormLayoutLabelName,
6
+ slot: DSFormLayoutLabelSlots.LABEL
7
+ })`
8
+ display: flex;
9
+ ${({ hideLabel }) => hideLabel ? `position: absolute;
10
+ width: 1px;
11
+ height: 1px;
12
+ padding: 0;
13
+ margin: -1px;
14
+ overflow: hidden;
15
+ clip: rect(0, 0, 0, 0);
16
+ white-space: nowrap;
17
+ border: 0;
18
+ ` : void 0}
19
+ ${xStyledCommonProps}
20
+ `;
21
+ const StyledMark = styled("span", {
22
+ name: DSFormLayoutLabelName,
23
+ slot: DSFormLayoutLabelSlots.MARK
24
+ })`
25
+ width: 6px;
26
+ height: 6px;
27
+ border-radius: 50%;
28
+ margin-left: ${({ theme }) => theme.space.xxxs};
29
+ ${({ theme, required }) => required ? `
30
+ background-color: ${theme.colors.danger[900]};
31
+ ` : `
32
+ border: 1px solid ${theme.colors.brand[600]};
33
+ `}
34
+ `;
35
+ export {
36
+ StyledLabel,
37
+ StyledMark
38
+ };
39
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSFormLayoutLabelName, DSFormLayoutLabelSlots } from './constants/index.js';\n\ninterface DSFormLayoutBlockItemStyledLabelT {\n hideLabel?: boolean;\n}\n\ninterface DSFormLayoutBlockItemStyledMarkT {\n required?: boolean;\n}\n\nexport const StyledLabel = styled('label', {\n name: DSFormLayoutLabelName,\n slot: DSFormLayoutLabelSlots.LABEL,\n})<DSFormLayoutBlockItemStyledLabelT>`\n display: flex;\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 ${xStyledCommonProps}\n`;\n\nexport const StyledMark = styled('span', {\n name: DSFormLayoutLabelName,\n slot: DSFormLayoutLabelSlots.MARK,\n})<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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,uBAAuB,8BAA8B;AAUvD,MAAM,cAAc,OAAO,SAAS;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,uBAAuB;AAC/B,CAAC;AAAA;AAAA,IAEG,CAAC,EAAE,UAAU,MACb,YACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUA;AAAA,IACJ;AAAA;AAGG,MAAM,aAAa,OAAO,QAAQ;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,uBAAuB;AAC/B,CAAC;AAAA;AAAA;AAAA;AAAA,iBAIgB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,IACxC,CAAC,EAAE,OAAO,SAAS,MACnB,WACI;AAAA,sBACc,MAAM,OAAO,OAAO,GAAG;AAAA,MAErC;AAAA,sBACc,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type DSFormLayoutLabelT } from './react-desc-prop-types.js';
3
+ declare const DSFormLayoutLabel: React.ComponentType<DSFormLayoutLabelT.Props>;
4
+ declare const DSFormLayoutLabelWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSFormLayoutLabelT.Props>;
5
+ export { DSFormLayoutLabel, DSFormLayoutLabelWithSchema };
@@ -0,0 +1,13 @@
1
+ /// <reference types="lodash" />
2
+ import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
3
+ import { type DSFormLayoutLabelT } from '../react-desc-prop-types.js';
4
+ export interface FormLayoutLabelCTX {
5
+ propsWithDefault: DSFormLayoutLabelT.InternalProps;
6
+ globalProps: ReturnType<typeof useGetGlobalAttributes>;
7
+ xstyledProps: ReturnType<typeof useGetXstyledProps>;
8
+ }
9
+ export declare const useFormLayoutLabel: (propsFromUser: DSFormLayoutLabelT.Props) => {
10
+ propsWithDefault: DSFormLayoutLabelT.InternalProps;
11
+ globalProps: import("lodash").Omit<import("@elliemae/ds-props-helpers").GlobalAttributesT<Element>, "cols" | "rows" | "wrap">;
12
+ xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
13
+ };
@@ -0,0 +1,3 @@
1
+ import { type WeakValidationMap } from 'react';
2
+ import { type DSFormLayoutLabelT } from '../react-desc-prop-types.js';
3
+ export declare const useValidateProps: (props: DSFormLayoutLabelT.InternalProps, propTypes: WeakValidationMap<unknown>) => void;
@@ -0,0 +1,6 @@
1
+ export declare const DSFormLayoutLabelName = "DSFormLayoutLabel";
2
+ export declare const DSFormLayoutLabelSlots: {
3
+ LABEL: string;
4
+ MARK: string;
5
+ };
6
+ export declare const DSFormLayoutBlockItemDataTestId: Record<string, string>;
@@ -0,0 +1,3 @@
1
+ export { DSFormLayoutLabel, DSFormLayoutLabelWithSchema } from './DSFormLayoutLabel.js';
2
+ export { type DSFormLayoutLabelT } from './react-desc-prop-types.js';
3
+ export { DSFormLayoutBlockItemDataTestId, DSFormLayoutLabelName, DSFormLayoutLabelSlots } from './constants/index.js';
@@ -0,0 +1,21 @@
1
+ import type React from 'react';
2
+ import { type GlobalAttributesT, type XstyledProps } from '@elliemae/ds-props-helpers';
3
+ export declare namespace DSFormLayoutLabelT {
4
+ interface RequiredProps {
5
+ children: React.ReactNode;
6
+ }
7
+ interface DefaultProps {
8
+ }
9
+ interface OptionalProps {
10
+ required?: boolean;
11
+ optional?: boolean;
12
+ hideLabel?: boolean;
13
+ }
14
+ interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
15
+ }
16
+ interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
17
+ }
18
+ type ExampleState = '0' | '1';
19
+ }
20
+ export declare const defaultProps: DSFormLayoutLabelT.DefaultProps;
21
+ export declare const DSFormLayoutLabelPropTypes: React.WeakValidationMap<unknown>;
@@ -0,0 +1,9 @@
1
+ interface DSFormLayoutBlockItemStyledLabelT {
2
+ hideLabel?: boolean;
3
+ }
4
+ interface DSFormLayoutBlockItemStyledMarkT {
5
+ required?: boolean;
6
+ }
7
+ export declare const StyledLabel: import("styled-components").StyledComponent<"label", import("@elliemae/ds-system").Theme, DSFormLayoutBlockItemStyledLabelT & import("@elliemae/ds-system").OwnerInterface, never>;
8
+ export declare const StyledMark: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, DSFormLayoutBlockItemStyledMarkT & import("@elliemae/ds-system").OwnerInterface, never>;
9
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@elliemae/ds-form-layout-label",
3
+ "version": "3.22.0-next.0",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Form Layout Label",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
16
+ }
17
+ },
18
+ "sideEffects": [
19
+ "*.css",
20
+ "*.scss"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://git.elliemae.io/platform-ui/dimsum.git"
25
+ },
26
+ "engines": {
27
+ "pnpm": ">=6",
28
+ "node": ">=16"
29
+ },
30
+ "author": "ICE MT",
31
+ "jestSonar": {
32
+ "sonar56x": true,
33
+ "reportPath": "reports",
34
+ "reportFile": "tests.xml",
35
+ "indent": 4
36
+ },
37
+ "dependencies": {
38
+ "@xstyled/system": "~3.7.3",
39
+ "@elliemae/ds-props-helpers": "3.22.0-next.0",
40
+ "@elliemae/ds-system": "3.22.0-next.0"
41
+ },
42
+ "devDependencies": {
43
+ "lodash": "^4.17.21",
44
+ "styled-components": "~5.3.9"
45
+ },
46
+ "peerDependencies": {
47
+ "@testing-library/jest-dom": "~5.16.4",
48
+ "@testing-library/react": "~12.1.3",
49
+ "@testing-library/user-event": "~13.5.0",
50
+ "lodash": "^4.17.21",
51
+ "react": "^17.0.2",
52
+ "react-dom": "^17.0.2",
53
+ "styled-components": "~5.3.9"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public",
57
+ "typeSafety": true
58
+ },
59
+ "scripts": {
60
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
61
+ "test": "node ../../scripts/testing/test.mjs",
62
+ "lint": "node ../../scripts/lint.mjs --fix",
63
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
64
+ "dts": "node ../../scripts/dts.mjs",
65
+ "dts:withdeps": "pnpm --filter {.}... dts",
66
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
67
+ "dev:build": "pnpm --filter {.}... build",
68
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
69
+ "checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
70
+ }
71
+ }