@elliemae/ds-legacy-props-helpers 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/cjs/defaultProps/index.js +36 -0
  2. package/dist/cjs/defaultProps/index.js.map +7 -0
  3. package/dist/cjs/defaultProps/useMemoMergePropsWithDefault.js +49 -0
  4. package/dist/cjs/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
  5. package/dist/cjs/getProps/index.js +42 -0
  6. package/dist/cjs/getProps/index.js.map +7 -0
  7. package/dist/cjs/globalProps/constants.js +401 -0
  8. package/dist/cjs/globalProps/constants.js.map +7 -0
  9. package/dist/cjs/globalProps/getGlobalAttributes.js +53 -0
  10. package/dist/cjs/globalProps/getGlobalAttributes.js.map +7 -0
  11. package/dist/cjs/globalProps/globalAttributesPropTypes.js +408 -0
  12. package/dist/cjs/globalProps/globalAttributesPropTypes.js.map +7 -0
  13. package/dist/cjs/globalProps/index.js +40 -0
  14. package/dist/cjs/globalProps/index.js.map +7 -0
  15. package/dist/cjs/globalProps/useGetGlobalAttributes.js +44 -0
  16. package/dist/cjs/globalProps/useGetGlobalAttributes.js.map +7 -0
  17. package/dist/cjs/index.js +59 -0
  18. package/dist/cjs/index.js.map +7 -0
  19. package/dist/cjs/package.json +4 -0
  20. package/dist/cjs/propTypes/PropTypes.js +142 -0
  21. package/dist/cjs/propTypes/PropTypes.js.map +7 -0
  22. package/dist/cjs/propTypes/customPropTypes.js +39 -0
  23. package/dist/cjs/propTypes/customPropTypes.js.map +7 -0
  24. package/dist/cjs/propTypes/describe.js +79 -0
  25. package/dist/cjs/propTypes/describe.js.map +7 -0
  26. package/dist/cjs/propTypes/describeConversions.js +107 -0
  27. package/dist/cjs/propTypes/describeConversions.js.map +7 -0
  28. package/dist/cjs/propTypes/describeGuards.js +50 -0
  29. package/dist/cjs/propTypes/describeGuards.js.map +7 -0
  30. package/dist/cjs/propTypes/index.js +38 -0
  31. package/dist/cjs/propTypes/index.js.map +7 -0
  32. package/dist/cjs/propTypes/toTypescript.js +151 -0
  33. package/dist/cjs/propTypes/toTypescript.js.map +7 -0
  34. package/dist/cjs/propTypes/types.js +28 -0
  35. package/dist/cjs/propTypes/types.js.map +7 -0
  36. package/dist/cjs/propsPerDataTestId/getPropsPerDatatestIdPropTypes.js +66 -0
  37. package/dist/cjs/propsPerDataTestId/getPropsPerDatatestIdPropTypes.js.map +7 -0
  38. package/dist/cjs/propsPerDataTestId/getPropsPerDatatestid.js +45 -0
  39. package/dist/cjs/propsPerDataTestId/getPropsPerDatatestid.js.map +7 -0
  40. package/dist/cjs/propsPerDataTestId/index.js +38 -0
  41. package/dist/cjs/propsPerDataTestId/index.js.map +7 -0
  42. package/dist/cjs/tests/globalProps/TestComponent.js +42 -0
  43. package/dist/cjs/tests/globalProps/TestComponent.js.map +7 -0
  44. package/dist/cjs/tests/validation/test.schema.js +72 -0
  45. package/dist/cjs/tests/validation/test.schema.js.map +7 -0
  46. package/dist/cjs/tests/xstyledProps/TestComponent.js +43 -0
  47. package/dist/cjs/tests/xstyledProps/TestComponent.js.map +7 -0
  48. package/dist/cjs/useDeprecateComponent/index.js +42 -0
  49. package/dist/cjs/useDeprecateComponent/index.js.map +7 -0
  50. package/dist/cjs/validation/errorTemplates.js +53 -0
  51. package/dist/cjs/validation/errorTemplates.js.map +7 -0
  52. package/dist/cjs/validation/index.js +40 -0
  53. package/dist/cjs/validation/index.js.map +7 -0
  54. package/dist/cjs/validation/typescriptGuards.js +86 -0
  55. package/dist/cjs/validation/typescriptGuards.js.map +7 -0
  56. package/dist/cjs/validation/typescriptParsers.js +77 -0
  57. package/dist/cjs/validation/typescriptParsers.js.map +7 -0
  58. package/dist/cjs/validation/typescriptValidator.js +220 -0
  59. package/dist/cjs/validation/typescriptValidator.js.map +7 -0
  60. package/dist/cjs/xstyledProps/constants.js +132 -0
  61. package/dist/cjs/xstyledProps/constants.js.map +7 -0
  62. package/dist/cjs/xstyledProps/index.js +38 -0
  63. package/dist/cjs/xstyledProps/index.js.map +7 -0
  64. package/dist/cjs/xstyledProps/useGetXstyledProps.js +49 -0
  65. package/dist/cjs/xstyledProps/useGetXstyledProps.js.map +7 -0
  66. package/dist/cjs/xstyledProps/xstyledPropTypes.js +127 -0
  67. package/dist/cjs/xstyledProps/xstyledPropTypes.js.map +7 -0
  68. package/dist/esm/defaultProps/index.js +6 -0
  69. package/dist/esm/defaultProps/index.js.map +7 -0
  70. package/dist/esm/defaultProps/useMemoMergePropsWithDefault.js +19 -0
  71. package/dist/esm/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
  72. package/dist/esm/getProps/index.js +12 -0
  73. package/dist/esm/getProps/index.js.map +7 -0
  74. package/dist/esm/globalProps/constants.js +371 -0
  75. package/dist/esm/globalProps/constants.js.map +7 -0
  76. package/dist/esm/globalProps/getGlobalAttributes.js +23 -0
  77. package/dist/esm/globalProps/getGlobalAttributes.js.map +7 -0
  78. package/dist/esm/globalProps/globalAttributesPropTypes.js +378 -0
  79. package/dist/esm/globalProps/globalAttributesPropTypes.js.map +7 -0
  80. package/dist/esm/globalProps/index.js +10 -0
  81. package/dist/esm/globalProps/index.js.map +7 -0
  82. package/dist/esm/globalProps/useGetGlobalAttributes.js +14 -0
  83. package/dist/esm/globalProps/useGetGlobalAttributes.js.map +7 -0
  84. package/dist/esm/index.js +38 -0
  85. package/dist/esm/index.js.map +7 -0
  86. package/dist/esm/package.json +4 -0
  87. package/dist/esm/propTypes/PropTypes.js +112 -0
  88. package/dist/esm/propTypes/PropTypes.js.map +7 -0
  89. package/dist/esm/propTypes/customPropTypes.js +9 -0
  90. package/dist/esm/propTypes/customPropTypes.js.map +7 -0
  91. package/dist/esm/propTypes/describe.js +49 -0
  92. package/dist/esm/propTypes/describe.js.map +7 -0
  93. package/dist/esm/propTypes/describeConversions.js +86 -0
  94. package/dist/esm/propTypes/describeConversions.js.map +7 -0
  95. package/dist/esm/propTypes/describeGuards.js +20 -0
  96. package/dist/esm/propTypes/describeGuards.js.map +7 -0
  97. package/dist/esm/propTypes/index.js +8 -0
  98. package/dist/esm/propTypes/index.js.map +7 -0
  99. package/dist/esm/propTypes/toTypescript.js +121 -0
  100. package/dist/esm/propTypes/toTypescript.js.map +7 -0
  101. package/dist/esm/propTypes/types.js +2 -0
  102. package/dist/esm/propTypes/types.js.map +7 -0
  103. package/dist/esm/propsPerDataTestId/getPropsPerDatatestIdPropTypes.js +36 -0
  104. package/dist/esm/propsPerDataTestId/getPropsPerDatatestIdPropTypes.js.map +7 -0
  105. package/dist/esm/propsPerDataTestId/getPropsPerDatatestid.js +15 -0
  106. package/dist/esm/propsPerDataTestId/getPropsPerDatatestid.js.map +7 -0
  107. package/dist/esm/propsPerDataTestId/index.js +8 -0
  108. package/dist/esm/propsPerDataTestId/index.js.map +7 -0
  109. package/dist/esm/tests/globalProps/TestComponent.js +12 -0
  110. package/dist/esm/tests/globalProps/TestComponent.js.map +7 -0
  111. package/dist/esm/tests/validation/test.schema.js +42 -0
  112. package/dist/esm/tests/validation/test.schema.js.map +7 -0
  113. package/dist/esm/tests/xstyledProps/TestComponent.js +13 -0
  114. package/dist/esm/tests/xstyledProps/TestComponent.js.map +7 -0
  115. package/dist/esm/useDeprecateComponent/index.js +12 -0
  116. package/dist/esm/useDeprecateComponent/index.js.map +7 -0
  117. package/dist/esm/validation/errorTemplates.js +23 -0
  118. package/dist/esm/validation/errorTemplates.js.map +7 -0
  119. package/dist/esm/validation/index.js +10 -0
  120. package/dist/esm/validation/index.js.map +7 -0
  121. package/dist/esm/validation/typescriptGuards.js +56 -0
  122. package/dist/esm/validation/typescriptGuards.js.map +7 -0
  123. package/dist/esm/validation/typescriptParsers.js +47 -0
  124. package/dist/esm/validation/typescriptParsers.js.map +7 -0
  125. package/dist/esm/validation/typescriptValidator.js +202 -0
  126. package/dist/esm/validation/typescriptValidator.js.map +7 -0
  127. package/dist/esm/xstyledProps/constants.js +102 -0
  128. package/dist/esm/xstyledProps/constants.js.map +7 -0
  129. package/dist/esm/xstyledProps/index.js +8 -0
  130. package/dist/esm/xstyledProps/index.js.map +7 -0
  131. package/dist/esm/xstyledProps/useGetXstyledProps.js +19 -0
  132. package/dist/esm/xstyledProps/useGetXstyledProps.js.map +7 -0
  133. package/dist/esm/xstyledProps/xstyledPropTypes.js +97 -0
  134. package/dist/esm/xstyledProps/xstyledPropTypes.js.map +7 -0
  135. package/dist/types/defaultProps/index.d.ts +1 -0
  136. package/dist/types/defaultProps/useMemoMergePropsWithDefault.d.ts +1 -0
  137. package/dist/types/getProps/index.d.ts +3 -0
  138. package/dist/types/globalProps/constants.d.ts +3 -0
  139. package/dist/types/globalProps/getGlobalAttributes.d.ts +6 -0
  140. package/dist/types/globalProps/globalAttributesPropTypes.d.ts +372 -0
  141. package/dist/types/globalProps/index.d.ts +3 -0
  142. package/dist/types/globalProps/useGetGlobalAttributes.d.ts +3 -0
  143. package/dist/types/index.d.ts +8 -0
  144. package/dist/types/propTypes/PropTypes.d.ts +3 -0
  145. package/dist/types/propTypes/customPropTypes.d.ts +2 -0
  146. package/dist/types/propTypes/describe.d.ts +3 -0
  147. package/dist/types/propTypes/describeConversions.d.ts +3 -0
  148. package/dist/types/propTypes/describeGuards.d.ts +9 -0
  149. package/dist/types/propTypes/index.d.ts +4 -0
  150. package/dist/types/propTypes/toTypescript.d.ts +3 -0
  151. package/dist/types/propTypes/types.d.ts +118 -0
  152. package/dist/types/propsPerDataTestId/getPropsPerDatatestIdPropTypes.d.ts +39 -0
  153. package/dist/types/propsPerDataTestId/getPropsPerDatatestid.d.ts +43 -0
  154. package/dist/types/propsPerDataTestId/index.d.ts +2 -0
  155. package/dist/types/tests/globalProps/TestComponent.d.ts +1 -0
  156. package/dist/types/tests/globalProps/globalAttributes.test.d.ts +1 -0
  157. package/dist/types/tests/propsPerDataTestId/getPropsPerDatatestIdPropTypes.test.d.ts +1 -0
  158. package/dist/types/tests/propsPerDataTestId/getPropsPerDatatestid.test.d.ts +1 -0
  159. package/dist/types/tests/validation/any.validation.test.d.ts +1 -0
  160. package/dist/types/tests/validation/array.validation.test.d.ts +1 -0
  161. package/dist/types/tests/validation/boolean.validation.test.d.ts +1 -0
  162. package/dist/types/tests/validation/function.validation.test.d.ts +1 -0
  163. package/dist/types/tests/validation/isRequiredIf.validation.test.d.ts +1 -0
  164. package/dist/types/tests/validation/number.validation.test.d.ts +1 -0
  165. package/dist/types/tests/validation/object.validation.test.d.ts +1 -0
  166. package/dist/types/tests/validation/objectOf.validation.test.d.ts +1 -0
  167. package/dist/types/tests/validation/schema.validation.test.d.ts +1 -0
  168. package/dist/types/tests/validation/string.validation.test.d.ts +1 -0
  169. package/dist/types/tests/validation/test.schema.d.ts +1 -0
  170. package/dist/types/tests/validation/union.validation.test.d.ts +1 -0
  171. package/dist/types/tests/xstyledProps/TestComponent.d.ts +1 -0
  172. package/dist/types/tests/xstyledProps/xstyledProps.test.d.ts +1 -0
  173. package/dist/types/useDeprecateComponent/index.d.ts +6 -0
  174. package/dist/types/validation/errorTemplates.d.ts +2 -0
  175. package/dist/types/validation/index.d.ts +2 -0
  176. package/dist/types/validation/typescriptGuards.d.ts +13 -0
  177. package/dist/types/validation/typescriptParsers.d.ts +1 -0
  178. package/dist/types/validation/typescriptValidator.d.ts +4 -0
  179. package/dist/types/xstyledProps/constants.d.ts +7 -0
  180. package/dist/types/xstyledProps/index.d.ts +2 -0
  181. package/dist/types/xstyledProps/useGetXstyledProps.d.ts +6 -0
  182. package/dist/types/xstyledProps/xstyledPropTypes.d.ts +84 -0
  183. package/package.json +64 -0
@@ -0,0 +1,118 @@
1
+ import type { any, array, bool, func, number, object, string, node, element, symbol, elementType, instanceOf, oneOf, oneOfType, arrayOf, objectOf, shape, exact, ValidationMap } from 'prop-types';
2
+ import type React from 'react';
3
+ export interface ReactDescObjT {
4
+ [key: string]: unknown;
5
+ required?: boolean;
6
+ deprecated?: Record<string, string>;
7
+ description?: string;
8
+ defaultValue?: unknown;
9
+ format?: string;
10
+ signature?: string;
11
+ warned?: boolean;
12
+ isRequiredIf?: (props: any) => boolean;
13
+ group?: Record<string, unknown>;
14
+ }
15
+ export type InstanceOfT = typeof instanceOf;
16
+ export type OneOfT = typeof oneOf;
17
+ export type ObjectOfT = typeof objectOf;
18
+ export type ExactT = typeof exact;
19
+ export type OneOfTypeT = typeof oneOfType;
20
+ export type ArrayOfT = typeof arrayOf;
21
+ export type ShapeT = typeof shape;
22
+ export type AnyT = typeof any;
23
+ export type ArrayT = typeof array;
24
+ export type BoolT = typeof bool;
25
+ export type FuncT = typeof func;
26
+ export type NumberT = typeof number;
27
+ export type ObjectT = typeof object;
28
+ export type StringT = typeof string;
29
+ export type NodeT = typeof node;
30
+ export type ElementT = typeof element;
31
+ export type SymbolT = typeof symbol;
32
+ export type ElementTypeT = typeof elementType;
33
+ export type ParametizedPropTypes = InstanceOfT | OneOfT | ObjectOfT | ExactT | OneOfTypeT | ArrayOfT | ShapeT;
34
+ export type AllPropTypes = AnyT | ArrayT | BoolT | FuncT | NumberT | ObjectT | StringT | NodeT | ElementT | SymbolT | ElementTypeT | ParametizedPropTypes;
35
+ export type PropTypesTypes = 'any' | 'array' | 'bool' | 'func' | 'number' | 'object' | 'string' | 'node' | 'element' | 'symbol' | 'elementType' | 'instanceOf' | 'oneOf' | 'oneOfType' | 'arrayOf' | 'objectOf' | 'shape' | 'exact' | 'tuple';
36
+ export interface ReactDescT {
37
+ [key: string]: unknown;
38
+ type: PropTypesTypes;
39
+ defaultValue: (this: ReactDescT, dfault: unknown) => ReactDescT;
40
+ deprecated: (this: ReactDescT, info: Record<string, string>) => ReactDescT;
41
+ description: (this: ReactDescT, descr: string) => ReactDescT;
42
+ format: (this: ReactDescT, format: string) => ReactDescT;
43
+ signature: (this: ReactDescT, format: string) => ReactDescT;
44
+ hidden: (this: ReactDescT) => ReactDescT;
45
+ dataTestId: (this: ReactDescT) => ReactDescT;
46
+ global: (this: ReactDescT) => ReactDescT;
47
+ xstyled: (this: ReactDescT) => ReactDescT;
48
+ omitValidation: (this: ReactDescT) => ReactDescT;
49
+ isRequired: ReactDescT;
50
+ isRequiredIf: (this: ReactDescT, isRequiredIf: (props: any) => boolean) => ReactDescT;
51
+ reactDesc: ReactDescObjT;
52
+ args?: ReactDescT | ReactDescT[] | Record<string, ReactDescT> | unknown[] | Parameters<InstanceOfT>[0] | Parameters<OneOfT>[0] | Parameters<ObjectOfT>[0] | Parameters<ExactT>[0];
53
+ }
54
+ export interface ComponentDocumentation {
55
+ propTypes: Record<string, ReactDescT>;
56
+ availableAt?: unknown;
57
+ description?: string;
58
+ details?: unknown;
59
+ deprecated?: unknown;
60
+ usage?: unknown;
61
+ intrinsicElement?: unknown;
62
+ toTypescript?: unknown;
63
+ }
64
+ export interface TypescriptDocumentation extends Partial<ComponentDocumentation> {
65
+ name: string;
66
+ description: string;
67
+ properties: {
68
+ name: string;
69
+ required?: boolean | undefined;
70
+ deprecated?: Record<string, string> | undefined;
71
+ description?: string;
72
+ format?: string;
73
+ signature?: string;
74
+ warned?: boolean;
75
+ defaultValue?: unknown;
76
+ isRequiredIf?: (props: any) => boolean;
77
+ omitValidation?: boolean;
78
+ }[];
79
+ }
80
+ export type DocumentedReactComponent<T> = React.ComponentType<T> & {
81
+ availableAt: unknown;
82
+ description: (descr: string) => DocumentedReactComponent<T>;
83
+ details: unknown;
84
+ deprecated: unknown;
85
+ usage: unknown;
86
+ intrinsicElement: unknown;
87
+ toTypescript: () => TypescriptDocumentation;
88
+ propTypesValue: ValidationMap<Record<string, unknown>>;
89
+ };
90
+ export type Hook<T = unknown, S = unknown> = ((props: T) => S) & {
91
+ displayName?: string;
92
+ name?: string;
93
+ };
94
+ export type DocumentedPropType = ReactDescT;
95
+ export type PropTypesObj = {
96
+ any: DocumentedPropType;
97
+ array: DocumentedPropType;
98
+ bool: DocumentedPropType;
99
+ func: DocumentedPropType;
100
+ number: DocumentedPropType;
101
+ object: DocumentedPropType;
102
+ string: DocumentedPropType;
103
+ node: DocumentedPropType;
104
+ element: DocumentedPropType;
105
+ symbol: DocumentedPropType;
106
+ elementType: DocumentedPropType;
107
+ instanceOf: (cls: unknown) => DocumentedPropType;
108
+ oneOf: (arr: unknown[]) => DocumentedPropType;
109
+ oneOfType: (arr: DocumentedPropType[]) => DocumentedPropType;
110
+ arrayOf: (smth: DocumentedPropType) => DocumentedPropType;
111
+ objectOf: (smth: DocumentedPropType) => DocumentedPropType;
112
+ shape: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;
113
+ exact: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;
114
+ tuple: (arr: DocumentedPropType[]) => DocumentedPropType;
115
+ };
116
+ export type DSPropTypesSchema<T> = Required<{
117
+ [key in keyof T]: ReactDescT;
118
+ }>;
@@ -0,0 +1,39 @@
1
+ import type { ReactDescT } from '../propTypes/types.js';
2
+ type DataTestId = {
3
+ [key: string]: string | DataTestId;
4
+ };
5
+ type PropsPerDataTestIdPropTypes = {
6
+ [key: string]: ReactDescT['shape'];
7
+ };
8
+ /**
9
+ * @param {object} dataTestIdObj - object in which the values rapresent the keys of the output object
10
+ * @returns {object} output - an object in which for each leaf value of the input object there is a key with aria-* and data-* props.shape definition
11
+ * @example
12
+ * const dataTestIdObj = {
13
+ * WHATEVER: 'data-testid',
14
+ * NESTED:{
15
+ * WHATEVER2: 'data-testid-2',
16
+ * WHATEVER3: 'data-testid-3',
17
+ * }
18
+ * }
19
+ *
20
+ * const propsPerDataTestIdPropTypes = getPropsPerDatatestIdPropTypes(dataTestIdObj);
21
+ * // propsPerDataTestIdPropTypes will be
22
+ * {
23
+ * 'data-testid': PropTypes.shape({
24
+ * 'aria-*': PropTypes.string,
25
+ * 'data-*': PropTypes.string,
26
+ * }),
27
+ * 'data-testid-2': PropTypes.shape({
28
+ * 'aria-*': PropTypes.string,
29
+ * 'data-*': PropTypes.string,
30
+ * })
31
+ * 'data-testid-3': PropTypes.shape({
32
+ * 'aria-*': PropTypes.string,
33
+ * 'data-*': PropTypes.string,
34
+ * })
35
+ * }
36
+ * @fires getLeafValues
37
+ */
38
+ export declare const getPropsPerDatatestIdPropTypes: (dataTestIdObj: DataTestId) => PropsPerDataTestIdPropTypes;
39
+ export {};
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Returns the props for a given dataTestId.
3
+ * props are going to be filtered so only aria related and data-* props are going to be returned.
4
+ * @param {Record<string, string> | (() => Record<string, string>)} userProps - The props passed by the user.
5
+ * @returns The props for the given dataTestId.
6
+ * @example
7
+ * const userProps = {
8
+ * 'ds-controlled-date-time-picker-month-input': {
9
+ * 'aria-label': 'month-input-aria-label',
10
+ * 'data-test': 'month-input-data-test',
11
+ * somethingElse: 'this will not be returned',
12
+ * },
13
+ * 'ds-controlled-date-time-picker-day-input': {
14
+ * 'aria-label': 'day-aria-label',
15
+ * 'data-test': 'day-data-test',
16
+ * },
17
+ * };
18
+ * const dataTestIdProps = getDataTestIdProps(userProps['ds-controlled-date-time-picker-day-input']);
19
+ * // dataTestIdProps = {
20
+ * // 'aria-label': 'day-aria-label',
21
+ * // 'data-test': 'day-data-test',
22
+ * // }
23
+ * @example
24
+ * const userProps = {
25
+ * 'ds-controlled-date-time-picker-month-input': {
26
+ * 'aria-label': 'month-input-aria-label',
27
+ * 'data-test': 'month-input-data-test',
28
+ * },
29
+ * 'ds-controlled-date-time-picker-day-input': (props) => ({ // notice that this is a function that returns an object
30
+ * 'aria-label': 'day-aria-label',
31
+ * 'data-test': 'day-data-test',
32
+ * somethingElse: 'this will not be returned',
33
+ * }),
34
+ * };
35
+ * const dataTestIdProps = getDataTestIdProps(userProps['ds-controlled-date-time-picker-day-input']);
36
+ * // dataTestIdProps = {
37
+ * // 'aria-label': 'day-aria-label',
38
+ * // 'data-test': 'day-data-test',
39
+ * // }
40
+ * @fires getAriaOrDataProps
41
+ */
42
+ declare const getPropsPerDatatestid: (userProps: AriaAndDataPropsOrPropsGetter | undefined) => AriaAndDataProps;
43
+ export { getPropsPerDatatestid };
@@ -0,0 +1,2 @@
1
+ export { getPropsPerDatatestid } from './getPropsPerDatatestid.js';
2
+ export { getPropsPerDatatestIdPropTypes } from './getPropsPerDatatestIdPropTypes.js';
@@ -0,0 +1 @@
1
+ export function TestComponent(props: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export const TypescriptSchema: import("../../propTypes/types.js").TypescriptDocumentation;
@@ -0,0 +1 @@
1
+ export function TestComponent(props: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ componentName: string;
3
+ version: string;
4
+ }
5
+ export declare const useDeprecateComponent: ({ componentName, version }: Props) => void;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const throwTypeError: (componentName: string, validPropKey: string, invalidProp: unknown, validFormat: string) => void;
2
+ export declare const throwRequiredError: (componentName: string, validPropKey: string) => void;
@@ -0,0 +1,2 @@
1
+ export { throwTypeError, throwRequiredError } from './errorTemplates.js';
2
+ export { validateTypescriptPropTypesImplementation, useValidateTypescriptPropTypes } from './typescriptValidator.js';
@@ -0,0 +1,13 @@
1
+ type GuardFn = (format: string) => boolean;
2
+ export declare const isPrimitiveType: GuardFn;
3
+ export declare const isUndefined: GuardFn;
4
+ export declare const isNull: GuardFn;
5
+ export declare const isUnion: GuardFn;
6
+ export declare const isString: GuardFn;
7
+ export declare const isArray: GuardFn;
8
+ export declare const isObjectOf: GuardFn;
9
+ export declare const isObject: GuardFn;
10
+ export declare const isFunction: GuardFn;
11
+ export declare const isJSXorNode: GuardFn;
12
+ export declare const isSomethingWithParenthesis: GuardFn;
13
+ export {};
@@ -0,0 +1 @@
1
+ export declare const typescriptObjectParser: (format: string) => [string, string][];
@@ -0,0 +1,4 @@
1
+ import type { PropsWithChildren, WeakValidationMap } from 'react';
2
+ import type { TypescriptDocumentation } from '../propTypes/types.js';
3
+ export declare const validateTypescriptPropTypesImplementation: (props: PropsWithChildren<Record<string, unknown>>, schema: TypescriptDocumentation, validationsMemo?: Record<string, string>, nextValidationsMemo?: Record<string, string>) => void;
4
+ export declare const useValidateTypescriptPropTypes: <T = Record<string, any>>(props: PropsWithChildren<T>, propTypes: WeakValidationMap<unknown>, componentDisplayName: string) => void;
@@ -0,0 +1,7 @@
1
+ export declare const layoutKeys: string[];
2
+ export declare const borderKeys: string[];
3
+ export declare const backgroundKeys: string[];
4
+ export declare const colorKeys: string[];
5
+ export declare const boxShadowKeys: string[];
6
+ export declare const typographyKeys: string[];
7
+ export declare const xstyledKeys: Record<string, true>;
@@ -0,0 +1,2 @@
1
+ export { type XstyledProps, useGetXstyledProps } from './useGetXstyledProps.js';
2
+ export { xstyledPropTypes } from './xstyledPropTypes.js';
@@ -0,0 +1,6 @@
1
+ import type { SizingProps, SpaceProps, LayoutProps, BoxShadowProps, BorderProps, BackgroundProps } from '@elliemae/ds-legacy-system';
2
+ export interface XstyledProps extends SpaceProps, SizingProps, LayoutProps, BoxShadowProps, BorderProps, BackgroundProps {
3
+ }
4
+ type PropsWithXstyled<T> = T & XstyledProps;
5
+ export declare const useGetXstyledProps: <T>(props: PropsWithXstyled<T>) => XstyledProps;
6
+ export {};
@@ -0,0 +1,84 @@
1
+ export declare const xstyledPropTypes: {
2
+ margin: import("../propTypes/types.js").ReactDescT;
3
+ m: import("../propTypes/types.js").ReactDescT;
4
+ marginTop: import("../propTypes/types.js").ReactDescT;
5
+ mt: import("../propTypes/types.js").ReactDescT;
6
+ marginRight: import("../propTypes/types.js").ReactDescT;
7
+ mr: import("../propTypes/types.js").ReactDescT;
8
+ marginBottom: import("../propTypes/types.js").ReactDescT;
9
+ mb: import("../propTypes/types.js").ReactDescT;
10
+ marginLeft: import("../propTypes/types.js").ReactDescT;
11
+ ml: import("../propTypes/types.js").ReactDescT;
12
+ mx: import("../propTypes/types.js").ReactDescT;
13
+ my: import("../propTypes/types.js").ReactDescT;
14
+ padding: import("../propTypes/types.js").ReactDescT;
15
+ p: import("../propTypes/types.js").ReactDescT;
16
+ paddingTop: import("../propTypes/types.js").ReactDescT;
17
+ pt: import("../propTypes/types.js").ReactDescT;
18
+ paddingRight: import("../propTypes/types.js").ReactDescT;
19
+ pr: import("../propTypes/types.js").ReactDescT;
20
+ paddingBottom: import("../propTypes/types.js").ReactDescT;
21
+ pb: import("../propTypes/types.js").ReactDescT;
22
+ paddingLeft: import("../propTypes/types.js").ReactDescT;
23
+ pl: import("../propTypes/types.js").ReactDescT;
24
+ px: import("../propTypes/types.js").ReactDescT;
25
+ py: import("../propTypes/types.js").ReactDescT;
26
+ spaceY: import("../propTypes/types.js").ReactDescT;
27
+ spaceX: import("../propTypes/types.js").ReactDescT;
28
+ spaceXReverse: import("../propTypes/types.js").ReactDescT;
29
+ spaceYReverse: import("../propTypes/types.js").ReactDescT;
30
+ w: import("../propTypes/types.js").ReactDescT;
31
+ width: import("../propTypes/types.js").ReactDescT;
32
+ maxWidth: import("../propTypes/types.js").ReactDescT;
33
+ maxW: import("../propTypes/types.js").ReactDescT;
34
+ minWidth: import("../propTypes/types.js").ReactDescT;
35
+ minW: import("../propTypes/types.js").ReactDescT;
36
+ h: import("../propTypes/types.js").ReactDescT;
37
+ height: import("../propTypes/types.js").ReactDescT;
38
+ maxHeight: import("../propTypes/types.js").ReactDescT;
39
+ maxH: import("../propTypes/types.js").ReactDescT;
40
+ minHeight: import("../propTypes/types.js").ReactDescT;
41
+ minH: import("../propTypes/types.js").ReactDescT;
42
+ maskSize: import("../propTypes/types.js").ReactDescT;
43
+ display: import("../propTypes/types.js").ReactDescT;
44
+ float: import("../propTypes/types.js").ReactDescT;
45
+ boxSizing: import("../propTypes/types.js").ReactDescT;
46
+ container: import("../propTypes/types.js").ReactDescT;
47
+ overflow: import("../propTypes/types.js").ReactDescT;
48
+ overflowX: import("../propTypes/types.js").ReactDescT;
49
+ overflowY: import("../propTypes/types.js").ReactDescT;
50
+ zIndex: import("../propTypes/types.js").ReactDescT;
51
+ position: import("../propTypes/types.js").ReactDescT;
52
+ top: import("../propTypes/types.js").ReactDescT;
53
+ right: import("../propTypes/types.js").ReactDescT;
54
+ bottom: import("../propTypes/types.js").ReactDescT;
55
+ left: import("../propTypes/types.js").ReactDescT;
56
+ visibility: import("../propTypes/types.js").ReactDescT;
57
+ overscrollBehavior: import("../propTypes/types.js").ReactDescT;
58
+ objectFit: import("../propTypes/types.js").ReactDescT;
59
+ color: import("../propTypes/types.js").ReactDescT;
60
+ bg: import("../propTypes/types.js").ReactDescT;
61
+ backgroundColor: import("../propTypes/types.js").ReactDescT;
62
+ border: import("../propTypes/types.js").ReactDescT;
63
+ borderTop: import("../propTypes/types.js").ReactDescT;
64
+ borderBottom: import("../propTypes/types.js").ReactDescT;
65
+ borderRight: import("../propTypes/types.js").ReactDescT;
66
+ borderLeft: import("../propTypes/types.js").ReactDescT;
67
+ borderColor: import("../propTypes/types.js").ReactDescT;
68
+ borderTopColor: import("../propTypes/types.js").ReactDescT;
69
+ borderBottomColor: import("../propTypes/types.js").ReactDescT;
70
+ borderRightColor: import("../propTypes/types.js").ReactDescT;
71
+ borderLeftColor: import("../propTypes/types.js").ReactDescT;
72
+ borderStyle: import("../propTypes/types.js").ReactDescT;
73
+ borderTopStyle: import("../propTypes/types.js").ReactDescT;
74
+ borderBottomStyle: import("../propTypes/types.js").ReactDescT;
75
+ borderRightStyle: import("../propTypes/types.js").ReactDescT;
76
+ borderLeftStyle: import("../propTypes/types.js").ReactDescT;
77
+ borderWidth: import("../propTypes/types.js").ReactDescT;
78
+ borderTopWidth: import("../propTypes/types.js").ReactDescT;
79
+ borderBottomWidth: import("../propTypes/types.js").ReactDescT;
80
+ borderRightWidth: import("../propTypes/types.js").ReactDescT;
81
+ borderLeftWidth: import("../propTypes/types.js").ReactDescT;
82
+ borderRadius: import("../propTypes/types.js").ReactDescT;
83
+ boxShadow: import("../propTypes/types.js").ReactDescT;
84
+ };
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@elliemae/ds-legacy-props-helpers",
3
+ "version": "1.0.0-rc.1",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Props Helpers",
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
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://git.elliemae.io/platform-ui/dimsum-legacy.git"
22
+ },
23
+ "engines": {
24
+ "pnpm": ">=6",
25
+ "node": ">=16"
26
+ },
27
+ "author": "ICE MT",
28
+ "jestSonar": {
29
+ "sonar56x": true,
30
+ "reportPath": "reports",
31
+ "reportFile": "tests.xml",
32
+ "indent": 4
33
+ },
34
+ "dependencies": {
35
+ "fast-deep-equal": "~3.1.3",
36
+ "prop-types": "~15.8.1",
37
+ "@elliemae/ds-legacy-system": "1.0.0-rc.1"
38
+ },
39
+ "devDependencies": {
40
+ "@elliemae/pui-cli": "~9.0.0-next.31",
41
+ "@elliemae/ds-legacy-monorepo-devops": "1.0.0-rc.1"
42
+ },
43
+ "peerDependencies": {
44
+ "lodash": "^4.17.21",
45
+ "react": "~17.0.2",
46
+ "react-dom": "^17.0.2"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public",
50
+ "typeSafety": true
51
+ },
52
+ "scripts": {
53
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
54
+ "test": "pui-cli test --passWithNoTests",
55
+ "lint": "node ../../../scripts/lint.mjs --fix",
56
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
57
+ "dts": "node ../../../scripts/dts.mjs",
58
+ "dts:withdeps": "pnpm --filter {.}... dts",
59
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
60
+ "dev:build": "pnpm --filter {.}... build",
61
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
62
+ "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
63
+ }
64
+ }