@elliemae/ds-legacy-props-helpers 1.0.36 → 1.1.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 (120) hide show
  1. package/dist/cjs/contractProps/getContractProps.js +50 -0
  2. package/dist/cjs/contractProps/getContractProps.js.map +7 -0
  3. package/dist/cjs/contractProps/index.js +36 -0
  4. package/dist/cjs/contractProps/index.js.map +7 -0
  5. package/dist/cjs/defaultProps/useMemoMergePropsWithDefault.js +6 -1
  6. package/dist/cjs/defaultProps/useMemoMergePropsWithDefault.js.map +2 -2
  7. package/dist/cjs/getProps/index.js.map +2 -2
  8. package/dist/cjs/globalProps/constants.js +4 -0
  9. package/dist/cjs/globalProps/constants.js.map +2 -2
  10. package/dist/cjs/globalProps/getGlobalAttributes.js.map +2 -2
  11. package/dist/cjs/globalProps/globalAttributesPropTypes.js +6 -1
  12. package/dist/cjs/globalProps/globalAttributesPropTypes.js.map +2 -2
  13. package/dist/cjs/globalProps/useGetGlobalAttributes.js.map +2 -2
  14. package/dist/cjs/index.js +7 -0
  15. package/dist/cjs/index.js.map +2 -2
  16. package/dist/cjs/propTypes/PropTypes.js +1 -0
  17. package/dist/cjs/propTypes/PropTypes.js.map +2 -2
  18. package/dist/cjs/propTypes/describe.js +22 -2
  19. package/dist/cjs/propTypes/describe.js.map +2 -2
  20. package/dist/cjs/propTypes/describeGuards.js +2 -0
  21. package/dist/cjs/propTypes/describeGuards.js.map +2 -2
  22. package/dist/cjs/propTypes/toTypescript.js +15 -1
  23. package/dist/cjs/propTypes/toTypescript.js.map +2 -2
  24. package/dist/cjs/propTypes/types.js.map +1 -1
  25. package/dist/cjs/propsPerDataTestId/getPropsPerDatatestid.js.map +2 -2
  26. package/dist/cjs/propsPerSlot/getPropsPerSlotPropTypes.js +68 -0
  27. package/dist/cjs/propsPerSlot/getPropsPerSlotPropTypes.js.map +7 -0
  28. package/dist/cjs/propsPerSlot/index.js +36 -0
  29. package/dist/cjs/propsPerSlot/index.js.map +7 -0
  30. package/dist/cjs/tests/validation/test.schema.js +9 -1
  31. package/dist/cjs/tests/validation/test.schema.js.map +2 -2
  32. package/dist/cjs/useDeprecateComponent/index.js.map +2 -2
  33. package/dist/cjs/useOwnerProps/index.js +41 -0
  34. package/dist/cjs/useOwnerProps/index.js.map +7 -0
  35. package/dist/cjs/validation/errorTemplates.js +1 -1
  36. package/dist/cjs/validation/errorTemplates.js.map +2 -2
  37. package/dist/cjs/validation/typescriptGuards.js +2 -0
  38. package/dist/cjs/validation/typescriptGuards.js.map +2 -2
  39. package/dist/cjs/validation/typescriptParsers.js +9 -1
  40. package/dist/cjs/validation/typescriptParsers.js.map +2 -2
  41. package/dist/cjs/validation/typescriptValidator.js +4 -2
  42. package/dist/cjs/validation/typescriptValidator.js.map +2 -2
  43. package/dist/cjs/xstyledProps/index.js +1 -0
  44. package/dist/cjs/xstyledProps/index.js.map +2 -2
  45. package/dist/cjs/xstyledProps/useGetXstyledProps.js +10 -11
  46. package/dist/cjs/xstyledProps/useGetXstyledProps.js.map +2 -2
  47. package/dist/cjs/xstyledProps/xstyledPropTypes.js +3 -1
  48. package/dist/cjs/xstyledProps/xstyledPropTypes.js.map +2 -2
  49. package/dist/esm/contractProps/getContractProps.js +20 -0
  50. package/dist/esm/contractProps/getContractProps.js.map +7 -0
  51. package/dist/esm/contractProps/index.js +6 -0
  52. package/dist/esm/contractProps/index.js.map +7 -0
  53. package/dist/esm/defaultProps/useMemoMergePropsWithDefault.js +7 -2
  54. package/dist/esm/defaultProps/useMemoMergePropsWithDefault.js.map +2 -2
  55. package/dist/esm/getProps/index.js.map +2 -2
  56. package/dist/esm/globalProps/constants.js +4 -0
  57. package/dist/esm/globalProps/constants.js.map +2 -2
  58. package/dist/esm/globalProps/getGlobalAttributes.js.map +2 -2
  59. package/dist/esm/globalProps/globalAttributesPropTypes.js +6 -1
  60. package/dist/esm/globalProps/globalAttributesPropTypes.js.map +2 -2
  61. package/dist/esm/globalProps/useGetGlobalAttributes.js.map +2 -2
  62. package/dist/esm/index.js +8 -1
  63. package/dist/esm/index.js.map +2 -2
  64. package/dist/esm/propTypes/PropTypes.js +1 -0
  65. package/dist/esm/propTypes/PropTypes.js.map +2 -2
  66. package/dist/esm/propTypes/describe.js +22 -2
  67. package/dist/esm/propTypes/describe.js.map +2 -2
  68. package/dist/esm/propTypes/describeGuards.js +2 -0
  69. package/dist/esm/propTypes/describeGuards.js.map +2 -2
  70. package/dist/esm/propTypes/toTypescript.js +15 -1
  71. package/dist/esm/propTypes/toTypescript.js.map +2 -2
  72. package/dist/esm/propsPerDataTestId/getPropsPerDatatestid.js.map +2 -2
  73. package/dist/esm/propsPerSlot/getPropsPerSlotPropTypes.js +38 -0
  74. package/dist/esm/propsPerSlot/getPropsPerSlotPropTypes.js.map +7 -0
  75. package/dist/esm/propsPerSlot/index.js +6 -0
  76. package/dist/esm/propsPerSlot/index.js.map +7 -0
  77. package/dist/esm/tests/validation/test.schema.js +9 -1
  78. package/dist/esm/tests/validation/test.schema.js.map +2 -2
  79. package/dist/esm/useDeprecateComponent/index.js.map +2 -2
  80. package/dist/esm/useOwnerProps/index.js +11 -0
  81. package/dist/esm/useOwnerProps/index.js.map +7 -0
  82. package/dist/esm/validation/errorTemplates.js +1 -1
  83. package/dist/esm/validation/errorTemplates.js.map +2 -2
  84. package/dist/esm/validation/typescriptGuards.js +2 -0
  85. package/dist/esm/validation/typescriptGuards.js.map +2 -2
  86. package/dist/esm/validation/typescriptParsers.js +9 -1
  87. package/dist/esm/validation/typescriptParsers.js.map +2 -2
  88. package/dist/esm/validation/typescriptValidator.js +5 -2
  89. package/dist/esm/validation/typescriptValidator.js.map +2 -2
  90. package/dist/esm/xstyledProps/index.js +2 -1
  91. package/dist/esm/xstyledProps/index.js.map +2 -2
  92. package/dist/esm/xstyledProps/useGetXstyledProps.js +10 -11
  93. package/dist/esm/xstyledProps/useGetXstyledProps.js.map +2 -2
  94. package/dist/esm/xstyledProps/xstyledPropTypes.js +3 -1
  95. package/dist/esm/xstyledProps/xstyledPropTypes.js.map +2 -2
  96. package/dist/types/contractProps/getContractProps.d.ts +52 -0
  97. package/dist/types/contractProps/index.d.ts +1 -0
  98. package/dist/types/defaultProps/useMemoMergePropsWithDefault.d.ts +1 -1
  99. package/dist/types/getProps/index.d.ts +4 -3
  100. package/dist/types/globalProps/getGlobalAttributes.d.ts +7 -4
  101. package/dist/types/globalProps/globalAttributesPropTypes.d.ts +4 -0
  102. package/dist/types/globalProps/useGetGlobalAttributes.d.ts +387 -1
  103. package/dist/types/index.d.ts +5 -1
  104. package/dist/types/propTypes/describe.d.ts +1 -1
  105. package/dist/types/propTypes/describeGuards.d.ts +1 -0
  106. package/dist/types/propTypes/types.d.ts +28 -2
  107. package/dist/types/propsPerDataTestId/getPropsPerDatatestid.d.ts +2 -1
  108. package/dist/types/propsPerSlot/getPropsPerSlotPropTypes.d.ts +7 -0
  109. package/dist/types/propsPerSlot/index.d.ts +1 -0
  110. package/dist/types/tests/contractProps/getContractProps.test.d.ts +1 -0
  111. package/dist/types/tests/validation/elementType.validation.test.d.ts +1 -0
  112. package/dist/types/tests/validation/shapeWithObjectOf.validation.test.d.ts +1 -0
  113. package/dist/types/tests/validation/shapeWithObjectOfAndSignature.validation.test.d.ts +1 -0
  114. package/dist/types/tests/validation/shapeWithSignature.validation.test.d.ts +1 -0
  115. package/dist/types/useOwnerProps/index.d.ts +4 -0
  116. package/dist/types/validation/typescriptGuards.d.ts +1 -0
  117. package/dist/types/xstyledProps/index.d.ts +1 -1
  118. package/dist/types/xstyledProps/useGetXstyledProps.d.ts +3 -2
  119. package/dist/types/xstyledProps/xstyledPropTypes.d.ts +2 -0
  120. package/package.json +4 -3
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(describe_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_describeConversions = require("./describeConversions.js");
36
36
  var import_toTypescript = __toESM(require("./toTypescript.js"));
37
+ var import_describeGuards = require("./describeGuards.js");
37
38
  function describe(ComponentInstance) {
38
39
  if (!ComponentInstance) {
39
40
  throw new Error("react-desc: component is required");
@@ -64,9 +65,8 @@ function describe(ComponentInstance) {
64
65
  }
65
66
  Object.keys(value).forEach((name) => {
66
67
  const propType = value[name];
67
- let realPropType;
68
68
  documentation.propTypes[name] = propType;
69
- realPropType = (0, import_describeConversions.convertPropType)(propType);
69
+ const realPropType = (0, import_describeConversions.convertPropType)(propType);
70
70
  DocumentedComponent.propTypesValue[name] = realPropType;
71
71
  return propType;
72
72
  });
@@ -74,6 +74,26 @@ function describe(ComponentInstance) {
74
74
  enumerable: true,
75
75
  configurable: true
76
76
  });
77
+ Object.defineProperty(DocumentedComponent, "returnType", {
78
+ get: () => DocumentedComponent.returnTypeValue,
79
+ set: (value) => {
80
+ if ((0, import_describeGuards.isReactDesc)(value)) {
81
+ DocumentedComponent.returnTypeValue = (0, import_describeConversions.convertPropType)(value);
82
+ documentation.returnType = value;
83
+ } else {
84
+ DocumentedComponent.returnTypeValue = {};
85
+ Object.keys(value).forEach((name) => {
86
+ const propType = value[name];
87
+ documentation.returnType = { ...documentation.returnType ?? {}, [name]: propType };
88
+ const realPropType = (0, import_describeConversions.convertPropType)(propType);
89
+ DocumentedComponent.returnTypeValue = { ...DocumentedComponent.returnTypeValue, [name]: realPropType };
90
+ return propType;
91
+ });
92
+ }
93
+ },
94
+ enumerable: true,
95
+ configurable: true
96
+ });
77
97
  return DocumentedComponent;
78
98
  }
79
99
  //# sourceMappingURL=describe.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/propTypes/describe.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable react/forbid-foreign-prop-types */\nimport type { Requireable, Validator } from 'prop-types';\nimport type React from 'react';\nimport { convertPropType } from './describeConversions.js';\nimport descToTypescript from './toTypescript.js';\nimport type { ReactDescT, Hook, ComponentDocumentation, DocumentedReactComponent } from './types.js';\n\nexport default function describe<C, R>(ComponentInstance: React.ComponentType<C> | Hook<C, R>) {\n if (!ComponentInstance) {\n throw new Error('react-desc: component is required');\n }\n\n const documentation: ComponentDocumentation = {\n propTypes: {},\n };\n\n const DocumentedComponent = ComponentInstance as DocumentedReactComponent<C>;\n\n const addDocumentationProp = <T extends keyof ComponentDocumentation>(propName: T) => {\n const func = (value: ComponentDocumentation[T]): DocumentedReactComponent<C> => {\n documentation[propName] = value;\n return DocumentedComponent;\n };\n return func;\n };\n\n DocumentedComponent.availableAt = addDocumentationProp('availableAt');\n DocumentedComponent.description = addDocumentationProp('description');\n DocumentedComponent.details = addDocumentationProp('details');\n DocumentedComponent.deprecated = addDocumentationProp('deprecated');\n DocumentedComponent.usage = addDocumentationProp('usage');\n DocumentedComponent.intrinsicElement = addDocumentationProp('intrinsicElement');\n\n DocumentedComponent.toTypescript = () => descToTypescript(ComponentInstance, documentation);\n\n Object.defineProperty(DocumentedComponent, 'propTypes', {\n get: () => DocumentedComponent.propTypesValue,\n set: (value: Record<string, ReactDescT>) => {\n if (!DocumentedComponent.propTypesValue) {\n DocumentedComponent.propTypesValue = {};\n }\n\n Object.keys(value).forEach((name) => {\n const propType: ReactDescT = value[name];\n let realPropType: Requireable<unknown> | Validator<unknown>;\n documentation.propTypes[name] = propType;\n realPropType = convertPropType(propType);\n // We don't need to rely on the isRequired from prop-types package\n // So no need to invoke (realPropType).isRequired if our own proptype is required\n // Validation will handle that case for us\n DocumentedComponent.propTypesValue[name] = realPropType as Validator<unknown>;\n return propType;\n });\n },\n enumerable: true,\n configurable: true,\n });\n\n return DocumentedComponent;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,iCAAgC;AAChC,0BAA6B;AAGd,SAAR,SAAgC,mBAAwD;AAC7F,MAAI,CAAC,mBAAmB;AACtB,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAEA,QAAM,gBAAwC;AAAA,IAC5C,WAAW,CAAC;AAAA,EACd;AAEA,QAAM,sBAAsB;AAE5B,QAAM,uBAAuB,CAAyC,aAAgB;AACpF,UAAM,OAAO,CAAC,UAAkE;AAC9E,oBAAc,QAAQ,IAAI;AAC1B,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAEA,sBAAoB,cAAc,qBAAqB,aAAa;AACpE,sBAAoB,cAAc,qBAAqB,aAAa;AACpE,sBAAoB,UAAU,qBAAqB,SAAS;AAC5D,sBAAoB,aAAa,qBAAqB,YAAY;AAClE,sBAAoB,QAAQ,qBAAqB,OAAO;AACxD,sBAAoB,mBAAmB,qBAAqB,kBAAkB;AAE9E,sBAAoB,eAAe,UAAM,oBAAAA,SAAiB,mBAAmB,aAAa;AAE1F,SAAO,eAAe,qBAAqB,aAAa;AAAA,IACtD,KAAK,MAAM,oBAAoB;AAAA,IAC/B,KAAK,CAAC,UAAsC;AAC1C,UAAI,CAAC,oBAAoB,gBAAgB;AACvC,4BAAoB,iBAAiB,CAAC;AAAA,MACxC;AAEA,aAAO,KAAK,KAAK,EAAE,QAAQ,CAAC,SAAS;AACnC,cAAM,WAAuB,MAAM,IAAI;AACvC,YAAI;AACJ,sBAAc,UAAU,IAAI,IAAI;AAChC,2BAAe,4CAAgB,QAAQ;AAIvC,4BAAoB,eAAe,IAAI,IAAI;AAC3C,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,IACA,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB,CAAC;AAED,SAAO;AACT;",
4
+ "sourcesContent": ["/* eslint-disable react/forbid-foreign-prop-types */\nimport type { Requireable, Validator } from 'prop-types';\nimport type React from 'react';\nimport { convertPropType } from './describeConversions.js';\nimport descToTypescript from './toTypescript.js';\nimport type { ReactDescT, Hook, ComponentDocumentation, DocumentedReactComponent } from './types.js';\nimport { isReactDesc } from './describeGuards.js';\n\nexport default function describe<C, D, R>(ComponentInstance: React.ComponentType<C> | Hook<C, D, R>) {\n if (!ComponentInstance) {\n throw new Error('react-desc: component is required');\n }\n\n const documentation: ComponentDocumentation = {\n propTypes: {},\n };\n\n const DocumentedComponent = ComponentInstance as DocumentedReactComponent<C>;\n\n const addDocumentationProp = <T extends keyof ComponentDocumentation>(propName: T) => {\n const func = (value: ComponentDocumentation[T]): DocumentedReactComponent<C> => {\n documentation[propName] = value;\n return DocumentedComponent;\n };\n return func;\n };\n\n DocumentedComponent.availableAt = addDocumentationProp('availableAt');\n DocumentedComponent.description = addDocumentationProp('description');\n DocumentedComponent.details = addDocumentationProp('details');\n DocumentedComponent.deprecated = addDocumentationProp('deprecated');\n DocumentedComponent.usage = addDocumentationProp('usage');\n DocumentedComponent.intrinsicElement = addDocumentationProp('intrinsicElement');\n\n DocumentedComponent.toTypescript = () => descToTypescript(ComponentInstance, documentation);\n\n Object.defineProperty(DocumentedComponent, 'propTypes', {\n get: () => DocumentedComponent.propTypesValue,\n set: (value: Record<string, ReactDescT>) => {\n if (!DocumentedComponent.propTypesValue) {\n DocumentedComponent.propTypesValue = {};\n }\n\n Object.keys(value).forEach((name) => {\n const propType: ReactDescT = value[name];\n documentation.propTypes[name] = propType;\n const realPropType: Requireable<unknown> | Validator<unknown> = convertPropType(propType);\n // We don't need to rely on the isRequired from prop-types package\n // So no need to invoke (realPropType).isRequired if our own proptype is required\n // Validation will handle that case for us\n DocumentedComponent.propTypesValue[name] = realPropType as Validator<unknown>;\n return propType;\n });\n },\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(DocumentedComponent, 'returnType', {\n get: () => DocumentedComponent.returnTypeValue,\n set: (value: ReactDescT | Record<string, ReactDescT>) => {\n if (isReactDesc(value)) {\n DocumentedComponent.returnTypeValue = convertPropType(value);\n documentation.returnType = value;\n } else {\n DocumentedComponent.returnTypeValue = {};\n Object.keys(value).forEach((name) => {\n const propType: ReactDescT = value[name];\n documentation.returnType = { ...(documentation.returnType ?? {}), [name]: propType };\n const realPropType: Requireable<unknown> | Validator<unknown> = convertPropType(propType);\n DocumentedComponent.returnTypeValue = { ...DocumentedComponent.returnTypeValue, [name]: realPropType };\n return propType;\n });\n }\n },\n enumerable: true,\n configurable: true,\n });\n\n return DocumentedComponent;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,iCAAgC;AAChC,0BAA6B;AAE7B,4BAA4B;AAEb,SAAR,SAAmC,mBAA2D;AACnG,MAAI,CAAC,mBAAmB;AACtB,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAEA,QAAM,gBAAwC;AAAA,IAC5C,WAAW,CAAC;AAAA,EACd;AAEA,QAAM,sBAAsB;AAE5B,QAAM,uBAAuB,CAAyC,aAAgB;AACpF,UAAM,OAAO,CAAC,UAAkE;AAC9E,oBAAc,QAAQ,IAAI;AAC1B,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAEA,sBAAoB,cAAc,qBAAqB,aAAa;AACpE,sBAAoB,cAAc,qBAAqB,aAAa;AACpE,sBAAoB,UAAU,qBAAqB,SAAS;AAC5D,sBAAoB,aAAa,qBAAqB,YAAY;AAClE,sBAAoB,QAAQ,qBAAqB,OAAO;AACxD,sBAAoB,mBAAmB,qBAAqB,kBAAkB;AAE9E,sBAAoB,eAAe,UAAM,oBAAAA,SAAiB,mBAAmB,aAAa;AAE1F,SAAO,eAAe,qBAAqB,aAAa;AAAA,IACtD,KAAK,MAAM,oBAAoB;AAAA,IAC/B,KAAK,CAAC,UAAsC;AAC1C,UAAI,CAAC,oBAAoB,gBAAgB;AACvC,4BAAoB,iBAAiB,CAAC;AAAA,MACxC;AAEA,aAAO,KAAK,KAAK,EAAE,QAAQ,CAAC,SAAS;AACnC,cAAM,WAAuB,MAAM,IAAI;AACvC,sBAAc,UAAU,IAAI,IAAI;AAChC,cAAM,mBAA0D,4CAAgB,QAAQ;AAIxF,4BAAoB,eAAe,IAAI,IAAI;AAC3C,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,IACA,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB,CAAC;AAED,SAAO,eAAe,qBAAqB,cAAc;AAAA,IACvD,KAAK,MAAM,oBAAoB;AAAA,IAC/B,KAAK,CAAC,UAAmD;AACvD,cAAI,mCAAY,KAAK,GAAG;AACtB,4BAAoB,sBAAkB,4CAAgB,KAAK;AAC3D,sBAAc,aAAa;AAAA,MAC7B,OAAO;AACL,4BAAoB,kBAAkB,CAAC;AACvC,eAAO,KAAK,KAAK,EAAE,QAAQ,CAAC,SAAS;AACnC,gBAAM,WAAuB,MAAM,IAAI;AACvC,wBAAc,aAAa,EAAE,GAAI,cAAc,cAAc,CAAC,GAAI,CAAC,IAAI,GAAG,SAAS;AACnF,gBAAM,mBAA0D,4CAAgB,QAAQ;AACxF,8BAAoB,kBAAkB,EAAE,GAAG,oBAAoB,iBAAiB,CAAC,IAAI,GAAG,aAAa;AACrG,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB,CAAC;AAED,SAAO;AACT;",
6
6
  "names": ["descToTypescript"]
7
7
  }
@@ -35,6 +35,7 @@ __export(describeGuards_exports, {
35
35
  isObjectOf: () => isObjectOf,
36
36
  isOneOf: () => isOneOf,
37
37
  isOneOfType: () => isOneOfType,
38
+ isReactDesc: () => isReactDesc,
38
39
  isShape: () => isShape
39
40
  });
40
41
  module.exports = __toCommonJS(describeGuards_exports);
@@ -47,4 +48,5 @@ const isInstanceOf = (propType, realPropType) => propType.type === "instanceOf";
47
48
  const isOneOf = (propType, realPropType) => propType.type === "oneOf";
48
49
  const isObjectOf = (propType, realPropType) => propType.type === "objectOf";
49
50
  const isExact = (propType, realPropType) => propType.type === "exact";
51
+ const isReactDesc = (reactDesc) => reactDesc && typeof reactDesc === "object" && "reactDesc" in reactDesc;
50
52
  //# sourceMappingURL=describeGuards.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/propTypes/describeGuards.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type {\n AllPropTypes,\n ArrayOfT,\n ExactT,\n InstanceOfT,\n ObjectOfT,\n OneOfT,\n OneOfTypeT,\n ParametizedPropTypes,\n ReactDescT,\n ShapeT,\n} from './types.js';\n\nexport const hasArguments = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ParametizedPropTypes =>\n !!propType.args;\n\nexport const isOneOfType = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfTypeT =>\n propType.type === 'oneOfType';\n\nexport const isArrayOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ArrayOfT =>\n propType.type === 'arrayOf';\n\nexport const isShape = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ShapeT =>\n propType.type === 'shape';\n\nexport const isInstanceOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is InstanceOfT =>\n propType.type === 'instanceOf';\n\nexport const isOneOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfT =>\n propType.type === 'oneOf';\n\nexport const isObjectOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ObjectOfT =>\n propType.type === 'objectOf';\n\nexport const isExact = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ExactT =>\n propType.type === 'exact';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADahB,MAAM,eAAe,CAAC,UAAsB,iBACjD,CAAC,CAAC,SAAS;AAEN,MAAM,cAAc,CAAC,UAAsB,iBAChD,SAAS,SAAS;AAEb,MAAM,YAAY,CAAC,UAAsB,iBAC9C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,eAAe,CAAC,UAAsB,iBACjD,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,aAAa,CAAC,UAAsB,iBAC/C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;",
4
+ "sourcesContent": ["import type {\n AllPropTypes,\n ArrayOfT,\n ExactT,\n InstanceOfT,\n ObjectOfT,\n OneOfT,\n OneOfTypeT,\n ParametizedPropTypes,\n ReactDescT,\n ShapeT,\n} from './types.js';\n\nexport const hasArguments = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ParametizedPropTypes =>\n !!propType.args;\n\nexport const isOneOfType = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfTypeT =>\n propType.type === 'oneOfType';\n\nexport const isArrayOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ArrayOfT =>\n propType.type === 'arrayOf';\n\nexport const isShape = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ShapeT =>\n propType.type === 'shape';\n\nexport const isInstanceOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is InstanceOfT =>\n propType.type === 'instanceOf';\n\nexport const isOneOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfT =>\n propType.type === 'oneOf';\n\nexport const isObjectOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ObjectOfT =>\n propType.type === 'objectOf';\n\nexport const isExact = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ExactT =>\n propType.type === 'exact';\n\nexport const isReactDesc = (reactDesc: object): reactDesc is ReactDescT =>\n reactDesc && typeof reactDesc === 'object' && 'reactDesc' in reactDesc;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADahB,MAAM,eAAe,CAAC,UAAsB,iBACjD,CAAC,CAAC,SAAS;AAEN,MAAM,cAAc,CAAC,UAAsB,iBAChD,SAAS,SAAS;AAEb,MAAM,YAAY,CAAC,UAAsB,iBAC9C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,eAAe,CAAC,UAAsB,iBACjD,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,aAAa,CAAC,UAAsB,iBAC/C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,cAAc,CAAC,cAC1B,aAAa,OAAO,cAAc,YAAY,eAAe;",
6
6
  "names": []
7
7
  }
@@ -32,6 +32,7 @@ __export(toTypescript_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(toTypescript_exports);
34
34
  var React = __toESM(require("react"));
35
+ var import_describeGuards = require("./describeGuards.js");
35
36
  const arrayFormat = (array) => array.map((propType) => propTypeFormat(propType));
36
37
  const shapeFormat = (shape) => {
37
38
  const props = Object.keys(shape).map((key) => {
@@ -44,7 +45,8 @@ const shapeFormat = (shape) => {
44
45
  } else {
45
46
  valueFormat = propTypeFormat(value);
46
47
  }
47
- return `${key}${value.reactDesc && value.reactDesc.required ? "" : "?"}: ${valueFormat}`;
48
+ const deprecatedMarker = value.reactDesc?.deprecated ? `/** @deprecated v${value.reactDesc.deprecated.version} */ ` : "";
49
+ return `${deprecatedMarker}${key}${value.reactDesc && value.reactDesc.required ? "" : "?"}: ${valueFormat}`;
48
50
  });
49
51
  return `{${props.join(",")}}`;
50
52
  };
@@ -79,6 +81,9 @@ const propTypeFormat = (propType, joinWith = "") => {
79
81
  case "element":
80
82
  result = "JSX.Element";
81
83
  break;
84
+ case "elementType":
85
+ result = "React.ComponentType<Record<string,unknown>>";
86
+ break;
82
87
  case "instanceOf":
83
88
  result = "any";
84
89
  break;
@@ -145,6 +150,15 @@ function descToTypescript(component, reactDesc) {
145
150
  documentation.properties = propTypes;
146
151
  }
147
152
  }
153
+ if (reactDesc.returnType) {
154
+ if ((0, import_describeGuards.isReactDesc)(reactDesc.returnType)) {
155
+ documentation.returns = propTypeAsTypescript(reactDesc.returnType, "returns");
156
+ } else {
157
+ documentation.returns = Object.entries(reactDesc.returnType).map(
158
+ ([propName, propType]) => propTypeAsTypescript(propType, propName)
159
+ );
160
+ }
161
+ }
148
162
  }
149
163
  return documentation;
150
164
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/propTypes/toTypescript.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/restrict-template-expressions */\n/* eslint-disable @typescript-eslint/no-use-before-define */\n/* eslint-disable complexity */\n/* eslint-disable react/forbid-foreign-prop-types */\nimport type React from 'react';\nimport type { ComponentDocumentation, Hook, ReactDescT, TypescriptDocumentation } from './types.js';\n\nconst arrayFormat = (array: ReactDescT[]) => array.map((propType) => propTypeFormat(propType));\n\nconst shapeFormat = (shape: Record<string, ReactDescT>) => {\n const props = Object.keys(shape).map((key) => {\n const value = shape[key];\n let valueFormat;\n if (\n value.type &&\n (value.type === 'arrayOf' || value.type === 'oneOfType' || value.type === 'oneOf') &&\n Array.isArray(value.args)\n ) {\n valueFormat = `${propTypeFormat(value)}`;\n } else if (value.type === 'shape') {\n valueFormat = `${propTypeFormat(value)}`;\n } else {\n valueFormat = propTypeFormat(value);\n }\n return `${key}${value.reactDesc && value.reactDesc.required ? '' : '?'}: ${valueFormat}`;\n });\n return `{${props.join(',')}}`;\n};\n\nconst propTypeFormat = (propType: ReactDescT | ReactDescT[], joinWith = ''): string => {\n let result;\n if (Array.isArray(propType)) {\n result = arrayFormat(propType).join(joinWith);\n } else if (typeof propType !== 'function' && propType.type) {\n switch (propType.type) {\n case 'array':\n result = 'any[]';\n break;\n case 'arrayOf':\n if ((propType.args as ReactDescT).type === 'oneOfType') {\n result = `(${propTypeFormat(propType.args as ReactDescT, ' | ')})[]`;\n } else {\n result = `${propTypeFormat(propType.args as ReactDescT, '\\n')}[]`;\n }\n break;\n case 'tuple':\n result = `[${propTypeFormat(propType.args as ReactDescT, ', ')}]`;\n break;\n case 'bool':\n result = 'boolean';\n break;\n case 'func':\n result = propType?.reactDesc?.signature ?? '((...args: any[]) => any)';\n break;\n case 'node':\n result = 'React.ReactNode';\n break;\n case 'element':\n result = 'JSX.Element';\n break;\n case 'instanceOf':\n result = 'any';\n break;\n case 'symbol':\n result = 'any';\n break;\n case 'objectOf':\n result = `{ [key: string]: ${propTypeFormat(propType.args as ReactDescT)} }`;\n break;\n case 'oneOf':\n result = (propType.args as unknown[]).map((a) => `\"${a}\"`).join(' | ');\n break;\n case 'oneOfType':\n result = `${propTypeFormat(propType.args as ReactDescT[], ' | ')}`;\n break;\n case 'shape':\n result = `${shapeFormat(propType.args as Record<string, ReactDescT>)}`;\n break;\n default:\n result = `${propType.type}`;\n break;\n }\n } else {\n result = 'any';\n }\n return result;\n};\n\nconst propTypeAsTypescript = (propType: ReactDescT, propName: string) => {\n const documentation = {\n ...propType.reactDesc,\n name: propName,\n };\n\n documentation.format = propTypeFormat(propType);\n\n return documentation;\n};\n\nexport default function descToTypescript<C, R>(\n component: React.ComponentType<C> | Hook<C, R>,\n reactDesc: ComponentDocumentation,\n) {\n if (!component) {\n throw new Error('react-desc: component is required');\n }\n\n const documentation: Partial<TypescriptDocumentation> = {\n name: component.displayName || component.name,\n ...reactDesc,\n };\n if (reactDesc) {\n delete documentation.propTypes;\n\n if (reactDesc.propTypes) {\n const propTypes: TypescriptDocumentation['properties'] = [];\n Object.keys(reactDesc.propTypes).forEach((propName) => {\n const propType = reactDesc.propTypes[propName];\n if (propType.type === 'shape') {\n propType.reactDesc.group = {};\n\n Object.keys(propType.args as Record<string, ReactDescT>).forEach((prop) => {\n if (!propType.reactDesc.group) return;\n propType.reactDesc.group[prop] = propTypeAsTypescript(\n (propType.args as Record<string, ReactDescT>)[prop],\n prop,\n );\n });\n }\n propTypes.push(propTypeAsTypescript(propType, propName));\n });\n if (propTypes.length > 0) {\n documentation.properties = propTypes;\n }\n }\n }\n return documentation as TypescriptDocumentation;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/restrict-template-expressions */\n/* eslint-disable @typescript-eslint/no-use-before-define */\n/* eslint-disable complexity */\n/* eslint-disable react/forbid-foreign-prop-types */\nimport type React from 'react';\nimport type { ComponentDocumentation, Hook, ReactDescT, TypescriptDocumentation } from './types.js';\nimport { isReactDesc } from './describeGuards.js';\n\nconst arrayFormat = (array: ReactDescT[]) => array.map((propType) => propTypeFormat(propType));\n\nconst shapeFormat = (shape: Record<string, ReactDescT>) => {\n const props = Object.keys(shape).map((key) => {\n const value = shape[key];\n let valueFormat;\n if (\n value.type &&\n (value.type === 'arrayOf' || value.type === 'oneOfType' || value.type === 'oneOf') &&\n Array.isArray(value.args)\n ) {\n valueFormat = `${propTypeFormat(value)}`;\n } else if (value.type === 'shape') {\n valueFormat = `${propTypeFormat(value)}`;\n } else {\n valueFormat = propTypeFormat(value);\n }\n const deprecatedMarker = value.reactDesc?.deprecated\n ? `/** @deprecated v${value.reactDesc.deprecated.version} */ `\n : '';\n return `${deprecatedMarker}${key}${value.reactDesc && value.reactDesc.required ? '' : '?'}: ${valueFormat}`;\n });\n return `{${props.join(',')}}`;\n};\n\nconst propTypeFormat = (propType: ReactDescT | ReactDescT[], joinWith = ''): string => {\n let result;\n if (Array.isArray(propType)) {\n result = arrayFormat(propType).join(joinWith);\n } else if (typeof propType !== 'function' && propType.type) {\n switch (propType.type) {\n case 'array':\n result = 'any[]';\n break;\n case 'arrayOf':\n if ((propType.args as ReactDescT).type === 'oneOfType') {\n result = `(${propTypeFormat(propType.args as ReactDescT, ' | ')})[]`;\n } else {\n result = `${propTypeFormat(propType.args as ReactDescT, '\\n')}[]`;\n }\n break;\n case 'tuple':\n result = `[${propTypeFormat(propType.args as ReactDescT, ', ')}]`;\n break;\n case 'bool':\n result = 'boolean';\n break;\n case 'func':\n result = propType?.reactDesc?.signature ?? '((...args: any[]) => any)';\n break;\n case 'node':\n result = 'React.ReactNode';\n break;\n case 'element':\n result = 'JSX.Element';\n break;\n case 'elementType':\n result = 'React.ComponentType<Record<string,unknown>>';\n break;\n case 'instanceOf':\n result = 'any';\n break;\n case 'symbol':\n result = 'any';\n break;\n case 'objectOf':\n result = `{ [key: string]: ${propTypeFormat(propType.args as ReactDescT)} }`;\n break;\n case 'oneOf':\n result = (propType.args as unknown[]).map((a) => `\"${a}\"`).join(' | ');\n break;\n case 'oneOfType':\n result = `${propTypeFormat(propType.args as ReactDescT[], ' | ')}`;\n break;\n case 'shape':\n result = `${shapeFormat(propType.args as Record<string, ReactDescT>)}`;\n break;\n default:\n result = `${propType.type}`;\n break;\n }\n } else {\n result = 'any';\n }\n return result;\n};\n\nconst propTypeAsTypescript = (propType: ReactDescT, propName: string) => {\n const documentation = {\n ...propType.reactDesc,\n name: propName,\n };\n\n documentation.format = propTypeFormat(propType);\n\n return documentation;\n};\n\nexport default function descToTypescript<C, R>(\n component: React.ComponentType<C> | Hook<C, R>,\n reactDesc: ComponentDocumentation,\n) {\n if (!component) {\n throw new Error('react-desc: component is required');\n }\n\n const documentation: Partial<TypescriptDocumentation> = {\n name: component.displayName || component.name,\n ...reactDesc,\n };\n if (reactDesc) {\n delete documentation.propTypes;\n\n if (reactDesc.propTypes) {\n const propTypes: TypescriptDocumentation['properties'] = [];\n Object.keys(reactDesc.propTypes).forEach((propName) => {\n const propType = reactDesc.propTypes[propName];\n if (propType.type === 'shape') {\n propType.reactDesc.group = {};\n\n Object.keys(propType.args as Record<string, ReactDescT>).forEach((prop) => {\n if (!propType.reactDesc.group) return;\n propType.reactDesc.group[prop] = propTypeAsTypescript(\n (propType.args as Record<string, ReactDescT>)[prop],\n prop,\n );\n });\n }\n propTypes.push(propTypeAsTypescript(propType, propName));\n });\n if (propTypes.length > 0) {\n documentation.properties = propTypes;\n }\n }\n if (reactDesc.returnType) {\n if (isReactDesc(reactDesc.returnType)) {\n documentation.returns = propTypeAsTypescript(reactDesc.returnType, 'returns');\n } else {\n documentation.returns = Object.entries(reactDesc.returnType).map(([propName, propType]) =>\n propTypeAsTypescript(propType, propName),\n );\n }\n }\n }\n return documentation as TypescriptDocumentation;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "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",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/propTypes/types.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type {\n any,\n array,\n bool,\n func,\n number,\n object,\n string,\n node,\n element,\n symbol,\n elementType,\n instanceOf,\n oneOf,\n oneOfType,\n arrayOf,\n objectOf,\n shape,\n exact,\n ValidationMap,\n} from 'prop-types';\nimport type React from 'react';\n\nexport interface ReactDescObjT {\n [key: string]: unknown;\n required?: boolean;\n deprecated?: Record<string, string>;\n description?: string;\n defaultValue?: unknown;\n format?: string;\n signature?: string;\n warned?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf?: (props: any) => boolean;\n group?: Record<string, unknown>;\n}\n\nexport type InstanceOfT = typeof instanceOf;\nexport type OneOfT = typeof oneOf;\nexport type ObjectOfT = typeof objectOf;\nexport type ExactT = typeof exact;\nexport type OneOfTypeT = typeof oneOfType;\nexport type ArrayOfT = typeof arrayOf;\nexport type ShapeT = typeof shape;\nexport type AnyT = typeof any;\nexport type ArrayT = typeof array;\nexport type BoolT = typeof bool;\nexport type FuncT = typeof func;\nexport type NumberT = typeof number;\nexport type ObjectT = typeof object;\nexport type StringT = typeof string;\nexport type NodeT = typeof node;\nexport type ElementT = typeof element;\nexport type SymbolT = typeof symbol;\nexport type ElementTypeT = typeof elementType;\n\nexport type ParametizedPropTypes = InstanceOfT | OneOfT | ObjectOfT | ExactT | OneOfTypeT | ArrayOfT | ShapeT;\n\nexport type AllPropTypes =\n | AnyT\n | ArrayT\n | BoolT\n | FuncT\n | NumberT\n | ObjectT\n | StringT\n | NodeT\n | ElementT\n | SymbolT\n | ElementTypeT\n | ParametizedPropTypes;\n\nexport type PropTypesTypes =\n | 'any'\n | 'array'\n | 'bool'\n | 'func'\n | 'number'\n | 'object'\n | 'string'\n | 'node'\n | 'element'\n | 'symbol'\n | 'elementType'\n | 'instanceOf'\n | 'oneOf'\n | 'oneOfType'\n | 'arrayOf'\n | 'objectOf'\n | 'shape'\n | 'exact'\n | 'tuple';\n\nexport interface ReactDescT {\n [key: string]: unknown;\n type: PropTypesTypes;\n defaultValue: (this: ReactDescT, dfault: unknown) => ReactDescT;\n deprecated: (this: ReactDescT, info: Record<string, string>) => ReactDescT;\n description: (this: ReactDescT, descr: string) => ReactDescT;\n format: (this: ReactDescT, format: string) => ReactDescT;\n signature: (this: ReactDescT, format: string) => ReactDescT;\n hidden: (this: ReactDescT) => ReactDescT;\n dataTestId: (this: ReactDescT) => ReactDescT;\n global: (this: ReactDescT) => ReactDescT;\n xstyled: (this: ReactDescT) => ReactDescT;\n omitValidation: (this: ReactDescT) => ReactDescT;\n isRequired: ReactDescT;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf: (this: ReactDescT, isRequiredIf: (props: any) => boolean) => ReactDescT;\n reactDesc: ReactDescObjT;\n args?:\n | ReactDescT\n | ReactDescT[]\n | Record<string, ReactDescT>\n | unknown[]\n | Parameters<InstanceOfT>[0]\n | Parameters<OneOfT>[0]\n | Parameters<ObjectOfT>[0]\n | Parameters<ExactT>[0];\n}\n\nexport interface ComponentDocumentation {\n propTypes: Record<string, ReactDescT>;\n availableAt?: unknown;\n description?: string;\n details?: unknown;\n deprecated?: unknown;\n usage?: unknown;\n intrinsicElement?: unknown;\n toTypescript?: unknown;\n}\n\nexport interface TypescriptDocumentation extends Partial<ComponentDocumentation> {\n name: string;\n description: string;\n properties: {\n name: string;\n required?: boolean | undefined;\n deprecated?: Record<string, string> | undefined;\n description?: string;\n format?: string;\n signature?: string;\n warned?: boolean;\n defaultValue?: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf?: (props: any) => boolean;\n omitValidation?: boolean;\n }[];\n}\n\nexport type DocumentedReactComponent<T> = React.ComponentType<T> & {\n availableAt: unknown;\n description: (descr: string) => DocumentedReactComponent<T>;\n details: unknown;\n deprecated: unknown;\n usage: unknown;\n intrinsicElement: unknown;\n toTypescript: () => TypescriptDocumentation;\n propTypesValue: ValidationMap<Record<string, unknown>>;\n};\n\nexport type Hook<T = unknown, S = unknown> = ((props: T) => S) & { displayName?: string; name?: string };\n\nexport type DocumentedPropType = ReactDescT;\n\nexport type PropTypesObj = {\n any: DocumentedPropType;\n array: DocumentedPropType;\n bool: DocumentedPropType;\n func: DocumentedPropType;\n number: DocumentedPropType;\n object: DocumentedPropType;\n string: DocumentedPropType;\n node: DocumentedPropType;\n element: DocumentedPropType;\n symbol: DocumentedPropType;\n elementType: DocumentedPropType;\n instanceOf: (cls: unknown) => DocumentedPropType;\n oneOf: (arr: unknown[]) => DocumentedPropType;\n oneOfType: (arr: DocumentedPropType[]) => DocumentedPropType;\n arrayOf: (smth: DocumentedPropType) => DocumentedPropType;\n objectOf: (smth: DocumentedPropType) => DocumentedPropType;\n shape: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;\n exact: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;\n tuple: (arr: DocumentedPropType[]) => DocumentedPropType;\n};\n\nexport type DSPropTypesSchema<T> = Required<{ [key in keyof T]: ReactDescT }>;\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport type {\n any,\n array,\n bool,\n func,\n number,\n object,\n string,\n node,\n element,\n symbol,\n elementType,\n instanceOf,\n oneOf,\n oneOfType,\n arrayOf,\n objectOf,\n shape,\n exact,\n Validator,\n ValidationMap,\n} from 'prop-types';\nimport type React from 'react';\n\nexport interface ReactDescObjT {\n [key: string]: unknown;\n required?: boolean;\n deprecated?: Record<string, string>;\n description?: string;\n defaultValue?: unknown;\n format?: string;\n signature?: string;\n warned?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf?: (props: any) => boolean;\n group?: Record<string, unknown>;\n}\n\nexport type InstanceOfT = typeof instanceOf;\nexport type OneOfT = typeof oneOf;\nexport type ObjectOfT = typeof objectOf;\nexport type ExactT = typeof exact;\nexport type OneOfTypeT = typeof oneOfType;\nexport type ArrayOfT = typeof arrayOf;\nexport type ShapeT = typeof shape;\nexport type AnyT = typeof any;\nexport type ArrayT = typeof array;\nexport type BoolT = typeof bool;\nexport type FuncT = typeof func;\nexport type NumberT = typeof number;\nexport type ObjectT = typeof object;\nexport type StringT = typeof string;\nexport type NodeT = typeof node;\nexport type ElementT = typeof element;\nexport type SymbolT = typeof symbol;\nexport type ElementTypeT = typeof elementType;\n\nexport type ParametizedPropTypes = InstanceOfT | OneOfT | ObjectOfT | ExactT | OneOfTypeT | ArrayOfT | ShapeT;\n\nexport type AllPropTypes =\n | AnyT\n | ArrayT\n | BoolT\n | FuncT\n | NumberT\n | ObjectT\n | StringT\n | NodeT\n | ElementT\n | SymbolT\n | ElementTypeT\n | ParametizedPropTypes;\n\nexport type PropTypesTypes =\n | 'any'\n | 'array'\n | 'bool'\n | 'func'\n | 'number'\n | 'object'\n | 'string'\n | 'node'\n | 'element'\n | 'symbol'\n | 'elementType'\n | 'instanceOf'\n | 'oneOf'\n | 'oneOfType'\n | 'arrayOf'\n | 'objectOf'\n | 'shape'\n | 'exact'\n | 'tuple';\n\nexport interface ReactDescT {\n [key: string]: unknown;\n type: PropTypesTypes;\n defaultValue: (this: ReactDescT, dfault: unknown) => ReactDescT;\n deprecated: (this: ReactDescT, info: Record<string, string>) => ReactDescT;\n description: (this: ReactDescT, descr: string) => ReactDescT;\n format: (this: ReactDescT, format: string) => ReactDescT;\n signature: (this: ReactDescT, format: string) => ReactDescT;\n hidden: (this: ReactDescT) => ReactDescT;\n dataTestId: (this: ReactDescT) => ReactDescT;\n global: (this: ReactDescT) => ReactDescT;\n xstyled: (this: ReactDescT) => ReactDescT;\n omitValidation: (this: ReactDescT) => ReactDescT;\n isRequired: ReactDescT;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf: (this: ReactDescT, isRequiredIf: (props: any) => boolean) => ReactDescT;\n reactDesc: ReactDescObjT;\n args?:\n | ReactDescT\n | ReactDescT[]\n | Record<string, ReactDescT>\n | unknown[]\n | Parameters<InstanceOfT>[0]\n | Parameters<OneOfT>[0]\n | Parameters<ObjectOfT>[0]\n | Parameters<ExactT>[0];\n}\n\nexport interface ComponentDocumentation {\n propTypes: Record<string, ReactDescT>;\n returnType?: ReactDescT | Record<string, ReactDescT>;\n availableAt?: unknown;\n description?: string;\n details?: unknown;\n deprecated?: unknown;\n usage?: unknown;\n intrinsicElement?: unknown;\n toTypescript?: unknown;\n}\n\nexport interface TypescriptDocumentation extends Partial<ComponentDocumentation> {\n name: string;\n description: string;\n properties: {\n name: string;\n required?: boolean | undefined;\n deprecated?: Record<string, string> | undefined;\n description?: string;\n format?: string;\n signature?: string;\n warned?: boolean;\n defaultValue?: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf?: (props: any) => boolean;\n omitValidation?: boolean;\n }[];\n returns?:\n | {\n name: string;\n required?: boolean | undefined;\n deprecated?: Record<string, string> | undefined;\n description?: string;\n format?: string;\n signature?: string;\n warned?: boolean;\n defaultValue?: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf?: (props: any) => boolean;\n omitValidation?: boolean;\n }\n | {\n name: string;\n required?: boolean | undefined;\n deprecated?: Record<string, string> | undefined;\n description?: string;\n format?: string;\n signature?: string;\n warned?: boolean;\n defaultValue?: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf?: (props: any) => boolean;\n omitValidation?: boolean;\n }[];\n}\n\nexport type DocumentedReactComponent<T> = React.ComponentType<T> & {\n availableAt: unknown;\n description: (descr: string) => DocumentedReactComponent<T>;\n details: unknown;\n deprecated: unknown;\n usage: unknown;\n intrinsicElement: unknown;\n toTypescript: () => TypescriptDocumentation;\n propTypesValue: ValidationMap<Record<string, unknown>>;\n returnType: ReactDescT | Record<string, ReactDescT>;\n returnTypeValue: Validator<unknown> | ValidationMap<Record<string, unknown>>;\n};\n\n// Added the possibility to accept a custom hook with two parameters to\n// handle the specific cases of useDSTree and useArraishAsDSTree (PUI-12468)\nexport type Hook<T = unknown, V = unknown, S = unknown> = (((props: T) => S) | ((param1: T, param2: V) => S)) & {\n displayName?: string;\n name?: string;\n};\n\nexport type DocumentedPropType = ReactDescT;\n\nexport type PropTypesObj = {\n any: DocumentedPropType;\n array: DocumentedPropType;\n bool: DocumentedPropType;\n func: DocumentedPropType;\n number: DocumentedPropType;\n object: DocumentedPropType;\n string: DocumentedPropType;\n node: DocumentedPropType;\n element: DocumentedPropType;\n symbol: DocumentedPropType;\n elementType: DocumentedPropType;\n instanceOf: (cls: unknown) => DocumentedPropType;\n oneOf: (arr: unknown[]) => DocumentedPropType;\n oneOfType: (arr: DocumentedPropType[]) => DocumentedPropType;\n arrayOf: (smth: DocumentedPropType) => DocumentedPropType;\n objectOf: (smth: DocumentedPropType) => DocumentedPropType;\n shape: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;\n exact: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;\n tuple: (arr: DocumentedPropType[]) => DocumentedPropType;\n};\n\nexport type DSPropTypesSchema<T> = Required<{ [key in keyof T]: ReactDescT }>;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/propsPerDataTestId/getPropsPerDatatestid.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable indent */\n/* eslint-disable complexity */\nimport { getAriaOrDataProps } from '../getProps/index.js';\n\n/**\n * Returns the props for a given dataTestId.\n * props are going to be filtered so only aria related and data-* props are going to be returned.\n * @param {Record<string, string> | (() => Record<string, string>)} userProps - The props passed by the user.\n * @returns The props for the given dataTestId.\n * @example\n * const userProps = {\n * 'ds-controlled-date-time-picker-month-input': {\n * 'aria-label': 'month-input-aria-label',\n * 'data-test': 'month-input-data-test',\n * somethingElse: 'this will not be returned',\n * },\n * 'ds-controlled-date-time-picker-day-input': {\n * 'aria-label': 'day-aria-label',\n * 'data-test': 'day-data-test',\n * },\n * };\n * const dataTestIdProps = getDataTestIdProps(userProps['ds-controlled-date-time-picker-day-input']);\n * // dataTestIdProps = {\n * // 'aria-label': 'day-aria-label',\n * // 'data-test': 'day-data-test',\n * // }\n * @example\n * const userProps = {\n * 'ds-controlled-date-time-picker-month-input': {\n * 'aria-label': 'month-input-aria-label',\n * 'data-test': 'month-input-data-test',\n * },\n * 'ds-controlled-date-time-picker-day-input': (props) => ({ // notice that this is a function that returns an object\n * 'aria-label': 'day-aria-label',\n * 'data-test': 'day-data-test',\n * somethingElse: 'this will not be returned',\n * }),\n * };\n * const dataTestIdProps = getDataTestIdProps(userProps['ds-controlled-date-time-picker-day-input']);\n * // dataTestIdProps = {\n * // 'aria-label': 'day-aria-label',\n * // 'data-test': 'day-data-test',\n * // }\n * @fires getAriaOrDataProps\n */\nconst getPropsPerDatatestid = (userProps: AriaAndDataPropsOrPropsGetter | undefined) => {\n if (\n userProps === undefined ||\n userProps === null ||\n (typeof userProps !== 'object' && typeof userProps !== 'function')\n )\n return {};\n\n if (typeof userProps === 'function') {\n const values = getAriaOrDataProps(userProps());\n return values;\n }\n return getAriaOrDataProps(userProps);\n};\n\nexport { getPropsPerDatatestid };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,sBAAmC;AA2CnC,MAAM,wBAAwB,CAAC,cAAyD;AACtF,MACE,cAAc,UACd,cAAc,QACb,OAAO,cAAc,YAAY,OAAO,cAAc;AAEvD,WAAO,CAAC;AAEV,MAAI,OAAO,cAAc,YAAY;AACnC,UAAM,aAAS,oCAAmB,UAAU,CAAC;AAC7C,WAAO;AAAA,EACT;AACA,aAAO,oCAAmB,SAAS;AACrC;",
4
+ "sourcesContent": ["/* eslint-disable indent */\n/* eslint-disable complexity */\nimport { type TypescriptHelpersT } from '@elliemae/ds-legacy-typescript-helpers';\nimport { getAriaOrDataProps } from '../getProps/index.js';\n\n/**\n * Returns the props for a given dataTestId.\n * props are going to be filtered so only aria related and data-* props are going to be returned.\n * @param {Record<string, string> | (() => Record<string, string>)} userProps - The props passed by the user.\n * @returns The props for the given dataTestId.\n * @example\n * const userProps = {\n * 'ds-controlled-date-time-picker-month-input': {\n * 'aria-label': 'month-input-aria-label',\n * 'data-test': 'month-input-data-test',\n * somethingElse: 'this will not be returned',\n * },\n * 'ds-controlled-date-time-picker-day-input': {\n * 'aria-label': 'day-aria-label',\n * 'data-test': 'day-data-test',\n * },\n * };\n * const dataTestIdProps = getDataTestIdProps(userProps['ds-controlled-date-time-picker-day-input']);\n * // dataTestIdProps = {\n * // 'aria-label': 'day-aria-label',\n * // 'data-test': 'day-data-test',\n * // }\n * @example\n * const userProps = {\n * 'ds-controlled-date-time-picker-month-input': {\n * 'aria-label': 'month-input-aria-label',\n * 'data-test': 'month-input-data-test',\n * },\n * 'ds-controlled-date-time-picker-day-input': (props) => ({ // notice that this is a function that returns an object\n * 'aria-label': 'day-aria-label',\n * 'data-test': 'day-data-test',\n * somethingElse: 'this will not be returned',\n * }),\n * };\n * const dataTestIdProps = getDataTestIdProps(userProps['ds-controlled-date-time-picker-day-input']);\n * // dataTestIdProps = {\n * // 'aria-label': 'day-aria-label',\n * // 'data-test': 'day-data-test',\n * // }\n * @fires getAriaOrDataProps\n */\nconst getPropsPerDatatestid = (userProps: TypescriptHelpersT.AriaAndDataPropsOrPropsGetter | undefined) => {\n if (\n userProps === undefined ||\n userProps === null ||\n (typeof userProps !== 'object' && typeof userProps !== 'function')\n )\n return {};\n\n if (typeof userProps === 'function') {\n const values = getAriaOrDataProps(userProps());\n return values;\n }\n return getAriaOrDataProps(userProps);\n};\n\nexport { getPropsPerDatatestid };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,sBAAmC;AA2CnC,MAAM,wBAAwB,CAAC,cAA4E;AACzG,MACE,cAAc,UACd,cAAc,QACb,OAAO,cAAc,YAAY,OAAO,cAAc;AAEvD,WAAO,CAAC;AAEV,MAAI,OAAO,cAAc,YAAY;AACnC,UAAM,aAAS,oCAAmB,UAAU,CAAC;AAC7C,WAAO;AAAA,EACT;AACA,aAAO,oCAAmB,SAAS;AACrC;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,68 @@
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 getPropsPerSlotPropTypes_exports = {};
30
+ __export(getPropsPerSlotPropTypes_exports, {
31
+ getPropsPerSlotPropTypes: () => getPropsPerSlotPropTypes
32
+ });
33
+ module.exports = __toCommonJS(getPropsPerSlotPropTypes_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_propTypes = require("../propTypes/index.js");
36
+ const getLeafValues = (name, slots) => {
37
+ const keys = Object.keys(slots);
38
+ const leafValues = keys.reduce(
39
+ (acc, key) => {
40
+ const value = slots[key];
41
+ acc.push(
42
+ `ds${name.slice(2)}${value.split("-").map((word) => word[0].toUpperCase() + word.slice(1)).join("")}`
43
+ );
44
+ return acc;
45
+ },
46
+ []
47
+ );
48
+ return leafValues;
49
+ };
50
+ const getPropsPerSlotPropTypes = (name, slots) => {
51
+ const leafValues = getLeafValues(name, slots);
52
+ const propsPerSlotPropTypes = {};
53
+ leafValues.forEach((leafValue) => {
54
+ propsPerSlotPropTypes[leafValue] = import_propTypes.PropTypes.oneOfType([
55
+ import_propTypes.PropTypes.func,
56
+ import_propTypes.PropTypes.shape({
57
+ "aria-*": import_propTypes.PropTypes.string.description("Aria related properties"),
58
+ "data-*": import_propTypes.PropTypes.string.description("Any data property to attach to the root container"),
59
+ "on-*": import_propTypes.PropTypes.func.description("Any supported React event"),
60
+ "all HTML attributes": import_propTypes.PropTypes.any.description(
61
+ "HTML attributes such as id, className, autoComplete, href and so on"
62
+ )
63
+ })
64
+ ]).description(`An object or function containing the definitions for ${leafValue} aria and data props.`).dataTestId();
65
+ });
66
+ return propsPerSlotPropTypes;
67
+ };
68
+ //# sourceMappingURL=getPropsPerSlotPropTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/propsPerSlot/getPropsPerSlotPropTypes.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable indent */\nimport { type TypescriptHelpersT } from '@elliemae/ds-legacy-typescript-helpers';\nimport { PropTypes } from '../propTypes/index.js';\nimport type { ReactDescT } from '../propTypes/types.js';\n\ntype PropsPerSlotPropTypes<Name extends string, Slots extends Record<string, string>> = {\n [key in keyof Required<TypescriptHelpersT.PropsForGlobalOnSlots<Name, Slots>>]: ReactDescT;\n};\n\nconst getLeafValues = <Name extends string, Slots extends Record<string, string>>(name: Name, slots: Slots) => {\n const keys = Object.keys(slots);\n const leafValues = keys.reduce(\n (acc, key) => {\n const value = slots[key];\n acc.push(\n `ds${name.slice(2)}${value\n .split('-')\n .map((word) => word[0].toUpperCase() + word.slice(1))\n .join('')}` as keyof PropsPerSlotPropTypes<Name, Slots>,\n );\n return acc;\n },\n [] as (string & keyof PropsPerSlotPropTypes<Name, Slots>)[],\n );\n return leafValues;\n};\n\nexport const getPropsPerSlotPropTypes = <Name extends string, Slots extends Record<string, string>>(\n name: Name,\n slots: Slots,\n): PropsPerSlotPropTypes<Name, Slots> => {\n const leafValues = getLeafValues(name, slots);\n const propsPerSlotPropTypes = {} as PropsPerSlotPropTypes<Name, Slots>;\n leafValues.forEach((leafValue) => {\n propsPerSlotPropTypes[leafValue] = PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n 'aria-*': PropTypes.string.description('Aria related properties'),\n 'data-*': PropTypes.string.description('Any data property to attach to the root container'),\n 'on-*': PropTypes.func.description('Any supported React event'),\n 'all HTML attributes': PropTypes.any.description(\n 'HTML attributes such as id, className, autoComplete, href and so on',\n ),\n }),\n ])\n .description(`An object or function containing the definitions for ${leafValue} aria and data props.`)\n .dataTestId();\n });\n return propsPerSlotPropTypes;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,uBAA0B;AAO1B,MAAM,gBAAgB,CAA4D,MAAY,UAAiB;AAC7G,QAAM,OAAO,OAAO,KAAK,KAAK;AAC9B,QAAM,aAAa,KAAK;AAAA,IACtB,CAAC,KAAK,QAAQ;AACZ,YAAM,QAAQ,MAAM,GAAG;AACvB,UAAI;AAAA,QACF,KAAK,KAAK,MAAM,CAAC,IAAI,MAClB,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,EACnD,KAAK,EAAE;AAAA,MACZ;AACA,aAAO;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEO,MAAM,2BAA2B,CACtC,MACA,UACuC;AACvC,QAAM,aAAa,cAAc,MAAM,KAAK;AAC5C,QAAM,wBAAwB,CAAC;AAC/B,aAAW,QAAQ,CAAC,cAAc;AAChC,0BAAsB,SAAS,IAAI,2BAAU,UAAU;AAAA,MACrD,2BAAU;AAAA,MACV,2BAAU,MAAM;AAAA,QACd,UAAU,2BAAU,OAAO,YAAY,yBAAyB;AAAA,QAChE,UAAU,2BAAU,OAAO,YAAY,mDAAmD;AAAA,QAC1F,QAAQ,2BAAU,KAAK,YAAY,2BAA2B;AAAA,QAC9D,uBAAuB,2BAAU,IAAI;AAAA,UACnC;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,CAAC,EACE,YAAY,wDAAwD,gCAAgC,EACpG,WAAW;AAAA,EAChB,CAAC;AACD,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,36 @@
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 propsPerSlot_exports = {};
30
+ __export(propsPerSlot_exports, {
31
+ getPropsPerSlotPropTypes: () => import_getPropsPerSlotPropTypes.getPropsPerSlotPropTypes
32
+ });
33
+ module.exports = __toCommonJS(propsPerSlot_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_getPropsPerSlotPropTypes = require("./getPropsPerSlotPropTypes.js");
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/propsPerSlot/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export { getPropsPerSlotPropTypes } from './getPropsPerSlotPropTypes.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sCAAyC;",
6
+ "names": []
7
+ }
@@ -58,12 +58,20 @@ const TestSchema = {
58
58
  }).description("Another shape")
59
59
  }).description("Shape"),
60
60
  function: import_propTypes.PropTypes.func.description("Function"),
61
+ elementType: import_propTypes.PropTypes.elementType.description("ElementType"),
61
62
  jsx: import_propTypes.PropTypes.element.description("JSX"),
62
63
  node: import_propTypes.PropTypes.node.description("Node"),
63
64
  something: import_propTypes.PropTypes.oneOf(["thing", "object"]).description("something"),
64
65
  isRequiredIf: import_propTypes.PropTypes.string.description("isRequiredIf").isRequiredIf((props) => props.something === "thing"),
65
66
  objectOf: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.string).description("Object of"),
66
- objectOfArray: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.arrayOf(import_propTypes.PropTypes.string)).description("Object of array")
67
+ objectOfArray: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.arrayOf(import_propTypes.PropTypes.string)).description("Object of array"),
68
+ shapeWithObjectOf: import_propTypes.PropTypes.shape({
69
+ objectOf: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.string).description("Object of")
70
+ }).description("Shape with object of"),
71
+ shapeWithObjectOfAndSignature: import_propTypes.PropTypes.shape({
72
+ signature: import_propTypes.PropTypes.func.signature("((a: string, b: number, c: Record<string, number>) => void)").description("Signature"),
73
+ objectOf: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.string).description("Object of")
74
+ }).description("Shape with object of and signature")
67
75
  };
68
76
  const TestComponent = () => null;
69
77
  const TestComponentWithSchema = (0, import_propTypes.describe)(TestComponent).description("Test Component");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/tests/validation/test.schema.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { PropTypes, describe } from '../../propTypes/index.ts';\n\nconst TestSchema = {\n string: PropTypes.string.description('String'),\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n any: PropTypes.any.description('Any'),\n union: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Union'),\n union2: PropTypes.oneOf(['A', 'B']).description('Union 2'),\n union3: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.shape({ string: PropTypes.string }),\n ]).description('Union 3'),\n array: PropTypes.arrayOf(PropTypes.string).description('Array'),\n object: PropTypes.object.description('Object'),\n shape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n anotherShape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n }).description('Another shape'),\n }).description('Shape'),\n function: PropTypes.func.description('Function'),\n jsx: PropTypes.element.description('JSX'),\n node: PropTypes.node.description('Node'),\n something: PropTypes.oneOf(['thing', 'object']).description('something'),\n isRequiredIf: PropTypes.string.description('isRequiredIf').isRequiredIf((props) => props.something === 'thing'),\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n objectOfArray: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).description('Object of array'),\n};\n\nconst TestComponent = () => null;\n\nconst TestComponentWithSchema = describe(TestComponent).description('Test Component');\n\nTestComponentWithSchema.propTypes = TestSchema;\n\nexport const TypescriptSchema = TestComponentWithSchema.toTypescript();\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoC;AAEpC,MAAM,aAAa;AAAA,EACjB,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,EAC7C,KAAK,2BAAU,IAAI,YAAY,KAAK;AAAA,EACpC,OAAO,2BAAU,UAAU,CAAC,2BAAU,QAAQ,2BAAU,MAAM,CAAC,EAAE,YAAY,OAAO;AAAA,EACpF,QAAQ,2BAAU,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,YAAY,SAAS;AAAA,EACzD,QAAQ,2BAAU,UAAU;AAAA,IAC1B,2BAAU;AAAA,IACV,2BAAU,QAAQ,2BAAU,MAAM;AAAA,IAClC,2BAAU,MAAM,EAAE,QAAQ,2BAAU,OAAO,CAAC;AAAA,EAC9C,CAAC,EAAE,YAAY,SAAS;AAAA,EACxB,OAAO,2BAAU,QAAQ,2BAAU,MAAM,EAAE,YAAY,OAAO;AAAA,EAC9D,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,OAAO,2BAAU,MAAM;AAAA,IACrB,QAAQ,2BAAU,OAAO,YAAY,QAAQ,EAAE;AAAA,IAC/C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,IAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,IAC7C,cAAc,2BAAU,MAAM;AAAA,MAC5B,QAAQ,2BAAU,OAAO,YAAY,QAAQ,EAAE;AAAA,MAC/C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,MAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,IAC/C,CAAC,EAAE,YAAY,eAAe;AAAA,EAChC,CAAC,EAAE,YAAY,OAAO;AAAA,EACtB,UAAU,2BAAU,KAAK,YAAY,UAAU;AAAA,EAC/C,KAAK,2BAAU,QAAQ,YAAY,KAAK;AAAA,EACxC,MAAM,2BAAU,KAAK,YAAY,MAAM;AAAA,EACvC,WAAW,2BAAU,MAAM,CAAC,SAAS,QAAQ,CAAC,EAAE,YAAY,WAAW;AAAA,EACvE,cAAc,2BAAU,OAAO,YAAY,cAAc,EAAE,aAAa,CAAC,UAAU,MAAM,cAAc,OAAO;AAAA,EAC9G,UAAU,2BAAU,SAAS,2BAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACtE,eAAe,2BAAU,SAAS,2BAAU,QAAQ,2BAAU,MAAM,CAAC,EAAE,YAAY,iBAAiB;AACtG;AAEA,MAAM,gBAAgB,MAAM;AAE5B,MAAM,8BAA0B,2BAAS,aAAa,EAAE,YAAY,gBAAgB;AAEpF,wBAAwB,YAAY;AAE7B,MAAM,mBAAmB,wBAAwB,aAAa;",
4
+ "sourcesContent": ["import { PropTypes, describe } from '../../propTypes/index.ts';\n\nconst TestSchema = {\n string: PropTypes.string.description('String'),\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n any: PropTypes.any.description('Any'),\n union: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Union'),\n union2: PropTypes.oneOf(['A', 'B']).description('Union 2'),\n union3: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.shape({ string: PropTypes.string }),\n ]).description('Union 3'),\n array: PropTypes.arrayOf(PropTypes.string).description('Array'),\n object: PropTypes.object.description('Object'),\n shape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n anotherShape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n }).description('Another shape'),\n }).description('Shape'),\n function: PropTypes.func.description('Function'),\n elementType: PropTypes.elementType.description('ElementType'),\n jsx: PropTypes.element.description('JSX'),\n node: PropTypes.node.description('Node'),\n something: PropTypes.oneOf(['thing', 'object']).description('something'),\n isRequiredIf: PropTypes.string.description('isRequiredIf').isRequiredIf((props) => props.something === 'thing'),\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n objectOfArray: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).description('Object of array'),\n shapeWithObjectOf: PropTypes.shape({\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n }).description('Shape with object of'),\n shapeWithObjectOfAndSignature: PropTypes.shape({\n signature: PropTypes.func\n .signature('((a: string, b: number, c: Record<string, number>) => void)')\n .description('Signature'),\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n }).description('Shape with object of and signature'),\n};\n\nconst TestComponent = () => null;\n\nconst TestComponentWithSchema = describe(TestComponent).description('Test Component');\n\nTestComponentWithSchema.propTypes = TestSchema;\n\nexport const TypescriptSchema = TestComponentWithSchema.toTypescript();\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoC;AAEpC,MAAM,aAAa;AAAA,EACjB,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,EAC7C,KAAK,2BAAU,IAAI,YAAY,KAAK;AAAA,EACpC,OAAO,2BAAU,UAAU,CAAC,2BAAU,QAAQ,2BAAU,MAAM,CAAC,EAAE,YAAY,OAAO;AAAA,EACpF,QAAQ,2BAAU,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,YAAY,SAAS;AAAA,EACzD,QAAQ,2BAAU,UAAU;AAAA,IAC1B,2BAAU;AAAA,IACV,2BAAU,QAAQ,2BAAU,MAAM;AAAA,IAClC,2BAAU,MAAM,EAAE,QAAQ,2BAAU,OAAO,CAAC;AAAA,EAC9C,CAAC,EAAE,YAAY,SAAS;AAAA,EACxB,OAAO,2BAAU,QAAQ,2BAAU,MAAM,EAAE,YAAY,OAAO;AAAA,EAC9D,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,OAAO,2BAAU,MAAM;AAAA,IACrB,QAAQ,2BAAU,OAAO,YAAY,QAAQ,EAAE;AAAA,IAC/C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,IAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,IAC7C,cAAc,2BAAU,MAAM;AAAA,MAC5B,QAAQ,2BAAU,OAAO,YAAY,QAAQ,EAAE;AAAA,MAC/C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,MAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,IAC/C,CAAC,EAAE,YAAY,eAAe;AAAA,EAChC,CAAC,EAAE,YAAY,OAAO;AAAA,EACtB,UAAU,2BAAU,KAAK,YAAY,UAAU;AAAA,EAC/C,aAAa,2BAAU,YAAY,YAAY,aAAa;AAAA,EAC5D,KAAK,2BAAU,QAAQ,YAAY,KAAK;AAAA,EACxC,MAAM,2BAAU,KAAK,YAAY,MAAM;AAAA,EACvC,WAAW,2BAAU,MAAM,CAAC,SAAS,QAAQ,CAAC,EAAE,YAAY,WAAW;AAAA,EACvE,cAAc,2BAAU,OAAO,YAAY,cAAc,EAAE,aAAa,CAAC,UAAU,MAAM,cAAc,OAAO;AAAA,EAC9G,UAAU,2BAAU,SAAS,2BAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACtE,eAAe,2BAAU,SAAS,2BAAU,QAAQ,2BAAU,MAAM,CAAC,EAAE,YAAY,iBAAiB;AAAA,EACpG,mBAAmB,2BAAU,MAAM;AAAA,IACjC,UAAU,2BAAU,SAAS,2BAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACxE,CAAC,EAAE,YAAY,sBAAsB;AAAA,EACrC,+BAA+B,2BAAU,MAAM;AAAA,IAC7C,WAAW,2BAAU,KAClB,UAAU,6DAA6D,EACvE,YAAY,WAAW;AAAA,IAC1B,UAAU,2BAAU,SAAS,2BAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACxE,CAAC,EAAE,YAAY,oCAAoC;AACrD;AAEA,MAAM,gBAAgB,MAAM;AAE5B,MAAM,8BAA0B,2BAAS,aAAa,EAAE,YAAY,gBAAgB;AAEpF,wBAAwB,YAAY;AAE7B,MAAM,mBAAmB,wBAAwB,aAAa;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/useDeprecateComponent/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable no-console */\nimport { useEffect } from 'react';\n\ninterface Props {\n componentName: string;\n version: string;\n}\n\nexport const useDeprecateComponent = ({ componentName, version }: Props) => {\n useEffect(() => {\n if (process.env.NODE_ENV !== 'production')\n console.warn(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);\n }, [componentName, version]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA0B;AAOnB,MAAM,wBAAwB,CAAC,EAAE,eAAe,QAAQ,MAAa;AAC1E,8BAAU,MAAM;AACd,QAAI;AACF,cAAQ,KAAK,YAAY,iEAAiE,UAAU;AAAA,EACxG,GAAG,CAAC,eAAe,OAAO,CAAC;AAC7B;",
4
+ "sourcesContent": ["/* eslint-disable no-console */\nimport { useEffect } from 'react';\n\ninterface Props {\n componentName: string;\n version: string;\n}\n\nexport const useDeprecateComponent = ({ componentName, version }: Props) => {\n useEffect(() => {\n /*\n https://esbuild.github.io/api/#platform\n When using the build API, all process.env.NODE_ENV expressions are automatically defined to \"production\" if all minification options are enabled and \"development\" otherwise.\n This only happens if process, process.env, and process.env.NODE_ENV are not already defined.\n This substitution is necessary to avoid React-based code crashing instantly (since process is a node API, not a web API).\n */\n if (process.env.NODE_ENV !== 'production')\n console.warn(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);\n }, [componentName, version]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA0B;AAOnB,MAAM,wBAAwB,CAAC,EAAE,eAAe,QAAQ,MAAa;AAC1E,8BAAU,MAAM;AAOd,QAAI;AACF,cAAQ,KAAK,YAAY,iEAAiE,UAAU;AAAA,EACxG,GAAG,CAAC,eAAe,OAAO,CAAC;AAC7B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,41 @@
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 useOwnerProps_exports = {};
30
+ __export(useOwnerProps_exports, {
31
+ useOwnerProps: () => useOwnerProps
32
+ });
33
+ module.exports = __toCommonJS(useOwnerProps_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = require("react");
36
+ const useOwnerProps = (props, args) => {
37
+ const getOwnerProps = (0, import_react.useCallback)(() => props, [props]);
38
+ const getOwnerPropsArguments = (0, import_react.useCallback)(() => args ?? {}, [args]);
39
+ return (0, import_react.useMemo)(() => ({ getOwnerProps, getOwnerPropsArguments }), [getOwnerProps, getOwnerPropsArguments]);
40
+ };
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/useOwnerProps/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useCallback, useMemo } from 'react';\n\nexport const useOwnerProps = <P, A extends object = Record<string, never>>(props: P, args?: A) => {\n const getOwnerProps = useCallback(() => props, [props]);\n const getOwnerPropsArguments = useCallback(() => args ?? {}, [args]);\n return useMemo(() => ({ getOwnerProps, getOwnerPropsArguments }), [getOwnerProps, getOwnerPropsArguments]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAqC;AAE9B,MAAM,gBAAgB,CAA8C,OAAU,SAAa;AAChG,QAAM,oBAAgB,0BAAY,MAAM,OAAO,CAAC,KAAK,CAAC;AACtD,QAAM,6BAAyB,0BAAY,MAAM,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;AACnE,aAAO,sBAAQ,OAAO,EAAE,eAAe,uBAAuB,IAAI,CAAC,eAAe,sBAAsB,CAAC;AAC3G;",
6
+ "names": []
7
+ }
@@ -38,7 +38,7 @@ const throwTypeError = (componentName, validPropKey, invalidProp, validFormat) =
38
38
  `${componentName}:: You are trying to pass a not valid "${validPropKey}" property,
39
39
  please provide a valid type.
40
40
 
41
- Received: ${invalidProp} (${typeof invalidProp})
41
+ Received: "${String(invalidProp)}" (${typeof invalidProp})
42
42
  Expected: (${validFormat.replace("\n", " or ")})
43
43
  `
44
44
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validation/errorTemplates.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-params */\nexport const throwTypeError = (\n componentName: string,\n validPropKey: string,\n invalidProp: unknown,\n validFormat: string,\n): void => {\n throw new Error(\n `${componentName}:: You are trying to pass a not valid \"${validPropKey}\" property, \n please provide a valid type.\n\n Received: ${invalidProp} (${typeof invalidProp})\n Expected: (${validFormat.replace('\\n', ' or ')})\n `,\n );\n};\n\nexport const throwRequiredError = (componentName: string, validPropKey: string): void => {\n throw new Error(\n `${componentName}:: Please provide a/an \"${validPropKey}\" property to use this component. \n This property is required.\n `,\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADChB,MAAM,iBAAiB,CAC5B,eACA,cACA,aACA,gBACS;AACT,QAAM,IAAI;AAAA,IACR,GAAG,uDAAuD;AAAA;AAAA;AAAA,cAGhD,gBAAgB,OAAO;AAAA,eACtB,YAAY,QAAQ,MAAM,MAAM;AAAA;AAAA,EAE7C;AACF;AAEO,MAAM,qBAAqB,CAAC,eAAuB,iBAA+B;AACvF,QAAM,IAAI;AAAA,IACR,GAAG,wCAAwC;AAAA;AAAA;AAAA,EAG7C;AACF;",
4
+ "sourcesContent": ["/* eslint-disable max-params */\nexport const throwTypeError = (\n componentName: string,\n validPropKey: string,\n invalidProp: unknown,\n validFormat: string,\n): void => {\n throw new Error(\n `${componentName}:: You are trying to pass a not valid \"${validPropKey}\" property, \n please provide a valid type.\n\n Received: \"${String(invalidProp)}\" (${typeof invalidProp})\n Expected: (${validFormat.replace('\\n', ' or ')})\n `,\n );\n};\n\nexport const throwRequiredError = (componentName: string, validPropKey: string): void => {\n throw new Error(\n `${componentName}:: Please provide a/an \"${validPropKey}\" property to use this component. \n This property is required.\n `,\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADChB,MAAM,iBAAiB,CAC5B,eACA,cACA,aACA,gBACS;AACT,QAAM,IAAI;AAAA,IACR,GAAG,uDAAuD;AAAA;AAAA;AAAA,eAG/C,OAAO,WAAW,OAAO,OAAO;AAAA,eAChC,YAAY,QAAQ,MAAM,MAAM;AAAA;AAAA,EAE7C;AACF;AAEO,MAAM,qBAAqB,CAAC,eAAuB,iBAA+B;AACvF,QAAM,IAAI;AAAA,IACR,GAAG,wCAAwC;AAAA;AAAA;AAAA,EAG7C;AACF;",
6
6
  "names": []
7
7
  }
@@ -35,6 +35,7 @@ __export(typescriptGuards_exports, {
35
35
  isObject: () => isObject,
36
36
  isObjectOf: () => isObjectOf,
37
37
  isPrimitiveType: () => isPrimitiveType,
38
+ isReactComponentType: () => isReactComponentType,
38
39
  isSomethingWithParenthesis: () => isSomethingWithParenthesis,
39
40
  isString: () => isString,
40
41
  isUndefined: () => isUndefined,
@@ -82,5 +83,6 @@ const isFunction = (format) => {
82
83
  return arrowOccursAtDepth1;
83
84
  };
84
85
  const isJSXorNode = (format) => !isUnion(format) && ["React.ReactNode", "JSX.Element"].includes(format);
86
+ const isReactComponentType = (format) => !isUnion(format) && format === "React.ComponentType<Record<string,unknown>>";
85
87
  const isSomethingWithParenthesis = (format) => !isUnion(format) && format[0] === "(" && format.slice(-1) === ")";
86
88
  //# sourceMappingURL=typescriptGuards.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validation/typescriptGuards.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["type GuardFn = (format: string) => boolean;\n\nexport const isPrimitiveType: GuardFn = (format) => ['string', 'number', 'boolean'].includes(format);\nexport const isUndefined: GuardFn = (format) => format === '\"undefined\"';\nexport const isNull: GuardFn = (format) => format === '\"null\"';\nexport const isUnion: GuardFn = (format) => {\n let depth = 0;\n let satisfies = false;\n format.split('').forEach((char) => {\n if (['{', '('].includes(char)) depth += 1;\n else if (['}', ')'].includes(char)) depth -= 1;\n else if (char === '|' && depth === 0) satisfies = true;\n });\n return satisfies;\n};\n\nexport const isString: GuardFn = (format) => !isUnion(format) && format[0] === '\"' && format.slice(-1) === '\"';\n\nexport const isArray: GuardFn = (format) => !isUnion(format) && format.slice(-2) === '[]';\n\nexport const isObjectOf: GuardFn = (format) =>\n format !== 'object' && !isUnion(format) && format.startsWith('{ [key: string]: ');\n\nexport const isObject: GuardFn = (format) =>\n format === 'object' || (!isUnion(format) && format[0] === '{' && format.slice(-1) === '}');\n\nexport const isFunction: GuardFn = (format) => {\n // It's isn't an union\n if (isUnion(format)) return false;\n // Has to start with (( and end with )\n if (!format.startsWith('((') && format.slice(-1) !== ')') return false;\n\n // The arrow MUST occur at depth 1 (when couting parenthesis)\n // Otherwise the only possibility is that we have \"something with parenthesis\" (look down below)\n let depth = 0;\n let arrowOccursAtDepth1 = false;\n for (let i = 0; i < format.length; i += 1) {\n const char = format[i];\n if (['{', '('].includes(char)) depth += 1;\n else if (['}', ')'].includes(char)) depth -= 1;\n else if (i < format.length - 1 && format.slice(i, i + 2) === '=>') {\n arrowOccursAtDepth1 = arrowOccursAtDepth1 || depth === 1;\n }\n }\n return arrowOccursAtDepth1;\n};\n\nexport const isJSXorNode: GuardFn = (format) => !isUnion(format) && ['React.ReactNode', 'JSX.Element'].includes(format);\n\nexport const isSomethingWithParenthesis: GuardFn = (format) =>\n !isUnion(format) && format[0] === '(' && format.slice(-1) === ')';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,kBAA2B,CAAC,WAAW,CAAC,UAAU,UAAU,SAAS,EAAE,SAAS,MAAM;AAC5F,MAAM,cAAuB,CAAC,WAAW,WAAW;AACpD,MAAM,SAAkB,CAAC,WAAW,WAAW;AAC/C,MAAM,UAAmB,CAAC,WAAW;AAC1C,MAAI,QAAQ;AACZ,MAAI,YAAY;AAChB,SAAO,MAAM,EAAE,EAAE,QAAQ,CAAC,SAAS;AACjC,QAAI,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aAC/B,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aACpC,SAAS,OAAO,UAAU;AAAG,kBAAY;AAAA,EACpD,CAAC;AACD,SAAO;AACT;AAEO,MAAM,WAAoB,CAAC,WAAW,CAAC,QAAQ,MAAM,KAAK,OAAO,CAAC,MAAM,OAAO,OAAO,MAAM,EAAE,MAAM;AAEpG,MAAM,UAAmB,CAAC,WAAW,CAAC,QAAQ,MAAM,KAAK,OAAO,MAAM,EAAE,MAAM;AAE9E,MAAM,aAAsB,CAAC,WAClC,WAAW,YAAY,CAAC,QAAQ,MAAM,KAAK,OAAO,WAAW,mBAAmB;AAE3E,MAAM,WAAoB,CAAC,WAChC,WAAW,YAAa,CAAC,QAAQ,MAAM,KAAK,OAAO,CAAC,MAAM,OAAO,OAAO,MAAM,EAAE,MAAM;AAEjF,MAAM,aAAsB,CAAC,WAAW;AAE7C,MAAI,QAAQ,MAAM;AAAG,WAAO;AAE5B,MAAI,CAAC,OAAO,WAAW,IAAI,KAAK,OAAO,MAAM,EAAE,MAAM;AAAK,WAAO;AAIjE,MAAI,QAAQ;AACZ,MAAI,sBAAsB;AAC1B,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK,GAAG;AACzC,UAAM,OAAO,OAAO,CAAC;AACrB,QAAI,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aAC/B,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aACpC,IAAI,OAAO,SAAS,KAAK,OAAO,MAAM,GAAG,IAAI,CAAC,MAAM,MAAM;AACjE,4BAAsB,uBAAuB,UAAU;AAAA,IACzD;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,cAAuB,CAAC,WAAW,CAAC,QAAQ,MAAM,KAAK,CAAC,mBAAmB,aAAa,EAAE,SAAS,MAAM;AAE/G,MAAM,6BAAsC,CAAC,WAClD,CAAC,QAAQ,MAAM,KAAK,OAAO,CAAC,MAAM,OAAO,OAAO,MAAM,EAAE,MAAM;",
4
+ "sourcesContent": ["type GuardFn = (format: string) => boolean;\n\nexport const isPrimitiveType: GuardFn = (format) => ['string', 'number', 'boolean'].includes(format);\nexport const isUndefined: GuardFn = (format) => format === '\"undefined\"';\nexport const isNull: GuardFn = (format) => format === '\"null\"';\nexport const isUnion: GuardFn = (format) => {\n let depth = 0;\n let satisfies = false;\n format.split('').forEach((char) => {\n if (['{', '('].includes(char)) depth += 1;\n else if (['}', ')'].includes(char)) depth -= 1;\n else if (char === '|' && depth === 0) satisfies = true;\n });\n return satisfies;\n};\n\nexport const isString: GuardFn = (format) => !isUnion(format) && format[0] === '\"' && format.slice(-1) === '\"';\n\nexport const isArray: GuardFn = (format) => !isUnion(format) && format.slice(-2) === '[]';\n\nexport const isObjectOf: GuardFn = (format) =>\n format !== 'object' && !isUnion(format) && format.startsWith('{ [key: string]: ');\n\nexport const isObject: GuardFn = (format) =>\n format === 'object' || (!isUnion(format) && format[0] === '{' && format.slice(-1) === '}');\n\nexport const isFunction: GuardFn = (format) => {\n // It's isn't an union\n if (isUnion(format)) return false;\n // Has to start with (( and end with )\n if (!format.startsWith('((') && format.slice(-1) !== ')') return false;\n\n // The arrow MUST occur at depth 1 (when couting parenthesis)\n // Otherwise the only possibility is that we have \"something with parenthesis\" (look down below)\n let depth = 0;\n let arrowOccursAtDepth1 = false;\n for (let i = 0; i < format.length; i += 1) {\n const char = format[i];\n if (['{', '('].includes(char)) depth += 1;\n else if (['}', ')'].includes(char)) depth -= 1;\n else if (i < format.length - 1 && format.slice(i, i + 2) === '=>') {\n arrowOccursAtDepth1 = arrowOccursAtDepth1 || depth === 1;\n }\n }\n return arrowOccursAtDepth1;\n};\n\nexport const isJSXorNode: GuardFn = (format) => !isUnion(format) && ['React.ReactNode', 'JSX.Element'].includes(format);\n\nexport const isReactComponentType: GuardFn = (format) =>\n !isUnion(format) && format === 'React.ComponentType<Record<string,unknown>>';\n\nexport const isSomethingWithParenthesis: GuardFn = (format) =>\n !isUnion(format) && format[0] === '(' && format.slice(-1) === ')';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,kBAA2B,CAAC,WAAW,CAAC,UAAU,UAAU,SAAS,EAAE,SAAS,MAAM;AAC5F,MAAM,cAAuB,CAAC,WAAW,WAAW;AACpD,MAAM,SAAkB,CAAC,WAAW,WAAW;AAC/C,MAAM,UAAmB,CAAC,WAAW;AAC1C,MAAI,QAAQ;AACZ,MAAI,YAAY;AAChB,SAAO,MAAM,EAAE,EAAE,QAAQ,CAAC,SAAS;AACjC,QAAI,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aAC/B,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aACpC,SAAS,OAAO,UAAU;AAAG,kBAAY;AAAA,EACpD,CAAC;AACD,SAAO;AACT;AAEO,MAAM,WAAoB,CAAC,WAAW,CAAC,QAAQ,MAAM,KAAK,OAAO,CAAC,MAAM,OAAO,OAAO,MAAM,EAAE,MAAM;AAEpG,MAAM,UAAmB,CAAC,WAAW,CAAC,QAAQ,MAAM,KAAK,OAAO,MAAM,EAAE,MAAM;AAE9E,MAAM,aAAsB,CAAC,WAClC,WAAW,YAAY,CAAC,QAAQ,MAAM,KAAK,OAAO,WAAW,mBAAmB;AAE3E,MAAM,WAAoB,CAAC,WAChC,WAAW,YAAa,CAAC,QAAQ,MAAM,KAAK,OAAO,CAAC,MAAM,OAAO,OAAO,MAAM,EAAE,MAAM;AAEjF,MAAM,aAAsB,CAAC,WAAW;AAE7C,MAAI,QAAQ,MAAM;AAAG,WAAO;AAE5B,MAAI,CAAC,OAAO,WAAW,IAAI,KAAK,OAAO,MAAM,EAAE,MAAM;AAAK,WAAO;AAIjE,MAAI,QAAQ;AACZ,MAAI,sBAAsB;AAC1B,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK,GAAG;AACzC,UAAM,OAAO,OAAO,CAAC;AACrB,QAAI,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aAC/B,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aACpC,IAAI,OAAO,SAAS,KAAK,OAAO,MAAM,GAAG,IAAI,CAAC,MAAM,MAAM;AACjE,4BAAsB,uBAAuB,UAAU;AAAA,IACzD;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,cAAuB,CAAC,WAAW,CAAC,QAAQ,MAAM,KAAK,CAAC,mBAAmB,aAAa,EAAE,SAAS,MAAM;AAE/G,MAAM,uBAAgC,CAAC,WAC5C,CAAC,QAAQ,MAAM,KAAK,WAAW;AAE1B,MAAM,6BAAsC,CAAC,WAClD,CAAC,QAAQ,MAAM,KAAK,OAAO,CAAC,MAAM,OAAO,OAAO,MAAM,EAAE,MAAM;",
6
6
  "names": []
7
7
  }
@@ -39,7 +39,7 @@ const typescriptObjectParser = (format) => {
39
39
  let shouldAppendToKey = true;
40
40
  const pushPair = () => {
41
41
  if (lastKey)
42
- keyValuePairs.push([lastKey, lastValue]);
42
+ keyValuePairs.push([lastKey, lastValue.slice(1)]);
43
43
  lastKey = "";
44
44
  lastValue = "";
45
45
  shouldAppendToKey = true;
@@ -66,6 +66,14 @@ const typescriptObjectParser = (format) => {
66
66
  else
67
67
  lastValue += char;
68
68
  } else if (char === " ") {
69
+ if (!shouldAppendToKey)
70
+ lastValue += char;
71
+ } else if (char === "(") {
72
+ depth += 1;
73
+ lastValue += char;
74
+ } else if (char === ")") {
75
+ depth -= 1;
76
+ lastValue += char;
69
77
  } else if (shouldAppendToKey)
70
78
  lastKey += char;
71
79
  else