@elliemae/ds-system 3.51.0-next.8 → 3.51.0-rc.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.
|
@@ -48,7 +48,17 @@ const displayNameToKebabCase = (displayName) => {
|
|
|
48
48
|
return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join("-")}`;
|
|
49
49
|
};
|
|
50
50
|
const displayNameToPropCase = (displayName) => `ds${displayName.slice(2).split("-").map(capitalize).join("")}`;
|
|
51
|
+
const isComponentNameCapitalized = (name, prefix) => {
|
|
52
|
+
const currentName = name.toLocaleLowerCase().startsWith(prefix.toLocaleLowerCase()) ? name.slice(prefix.length) : name;
|
|
53
|
+
const capitalizedName = capitalize(currentName.toLocaleLowerCase());
|
|
54
|
+
if (currentName !== capitalizedName) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
`Do not use CamelCase for component names. '${currentName}' should be renamed to '${capitalizedName}'`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
51
60
|
const slotObjectToDataTestIds = (componentName, slotObject) => {
|
|
61
|
+
isComponentNameCapitalized(componentName, "ds");
|
|
52
62
|
const obj = {};
|
|
53
63
|
Object.keys(slotObject).forEach((slotName) => {
|
|
54
64
|
const displayName = `${componentName}-${slotObject[slotName]}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/styled/helpers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n\nconst isEmpty = (string: string): boolean => string.length === 0;\n\nexport const propsToClassKey = (props: Record<string, { toString: () => string }>): string =>\n Object.keys(props)\n .sort()\n .reduce((classKey, key) => {\n if (key === 'color') {\n return classKey + (isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key])));\n }\n return `${classKey}${isEmpty(String(classKey)) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }, '');\n\nexport const displayNameToKebabCase = (displayName: string) => {\n // We also remove \"DS\" preffix\n const displayNameSplitOnUppercase = displayName.split(/(?=[A-Z])/).slice(2);\n\n return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join('-')}`;\n};\n\nexport const displayNameToPropCase = (displayName: string) =>\n `ds${displayName.slice(2).split('-').map(capitalize).join('')}`;\n\nexport const slotObjectToDataTestIds = (\n componentName: string,\n slotObject: Record<string, string>,\n): Record<string, string> => {\n const obj = {} as Record<string, string>;\n Object.keys(slotObject).forEach((slotName) => {\n const displayName = `${componentName}-${slotObject[slotName]}`;\n obj[slotName] = displayNameToKebabCase(displayName);\n });\n return obj;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;AAE9F,MAAM,UAAU,CAAC,WAA4B,OAAO,WAAW;AAExD,MAAM,kBAAkB,CAAC,UAC9B,OAAO,KAAK,KAAK,EACd,KAAK,EACL,OAAO,CAAC,UAAU,QAAQ;AACzB,MAAI,QAAQ,SAAS;AACnB,WAAO,YAAY,QAAQ,OAAO,QAAQ,CAAC,IAAI,OAAO,MAAM,GAAG,CAAC,IAAI,WAAW,OAAO,MAAM,GAAG,CAAC,CAAC;AAAA,EACnG;AACA,SAAO,GAAG,QAAQ,GAAG,QAAQ,OAAO,QAAQ,CAAC,IAAI,MAAM,WAAW,GAAG,CAAC,GAAG,WAAW,MAAM,GAAG,EAAE,SAAS,CAAC,CAAC;AAC5G,GAAG,EAAE;AAEF,MAAM,yBAAyB,CAAC,gBAAwB;AAE7D,QAAM,8BAA8B,YAAY,MAAM,WAAW,EAAE,MAAM,CAAC;AAE1E,SAAO,MAAM,4BAA4B,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG,CAAC;AACtF;AAEO,MAAM,wBAAwB,CAAC,gBACpC,KAAK,YAAY,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,EAAE,KAAK,EAAE,CAAC;
|
|
4
|
+
"sourcesContent": ["const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n\nconst isEmpty = (string: string): boolean => string.length === 0;\n\nexport const propsToClassKey = (props: Record<string, { toString: () => string }>): string =>\n Object.keys(props)\n .sort()\n .reduce((classKey, key) => {\n if (key === 'color') {\n return classKey + (isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key])));\n }\n return `${classKey}${isEmpty(String(classKey)) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }, '');\n\nexport const displayNameToKebabCase = (displayName: string) => {\n // We also remove \"DS\" preffix\n const displayNameSplitOnUppercase = displayName.split(/(?=[A-Z])/).slice(2);\n\n return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join('-')}`;\n};\n\nexport const displayNameToPropCase = (displayName: string) =>\n `ds${displayName.slice(2).split('-').map(capitalize).join('')}`;\n\nconst isComponentNameCapitalized = (name: string, prefix: string) => {\n // Remove the \"DS\" prefix if present\n const currentName = name.toLocaleLowerCase().startsWith(prefix.toLocaleLowerCase())\n ? name.slice(prefix.length)\n : name;\n const capitalizedName = capitalize(currentName.toLocaleLowerCase());\n // Check if a component name is capitalized after removing the \"DS\" prefix\n // e.g.: DSMyComponent should be named DSMycomponent (\"Mycomponent\" is capitalized)\n // otherwise an error is thrown\n if (currentName !== capitalizedName) {\n throw new Error(\n `Do not use CamelCase for component names. '${currentName}' should be renamed to '${capitalizedName}'`,\n );\n }\n};\n\nexport const slotObjectToDataTestIds = (\n componentName: string,\n slotObject: Record<string, string>,\n): Record<string, string> => {\n isComponentNameCapitalized(componentName, 'ds');\n const obj = {} as Record<string, string>;\n Object.keys(slotObject).forEach((slotName) => {\n const displayName = `${componentName}-${slotObject[slotName]}`;\n obj[slotName] = displayNameToKebabCase(displayName);\n });\n return obj;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;AAE9F,MAAM,UAAU,CAAC,WAA4B,OAAO,WAAW;AAExD,MAAM,kBAAkB,CAAC,UAC9B,OAAO,KAAK,KAAK,EACd,KAAK,EACL,OAAO,CAAC,UAAU,QAAQ;AACzB,MAAI,QAAQ,SAAS;AACnB,WAAO,YAAY,QAAQ,OAAO,QAAQ,CAAC,IAAI,OAAO,MAAM,GAAG,CAAC,IAAI,WAAW,OAAO,MAAM,GAAG,CAAC,CAAC;AAAA,EACnG;AACA,SAAO,GAAG,QAAQ,GAAG,QAAQ,OAAO,QAAQ,CAAC,IAAI,MAAM,WAAW,GAAG,CAAC,GAAG,WAAW,MAAM,GAAG,EAAE,SAAS,CAAC,CAAC;AAC5G,GAAG,EAAE;AAEF,MAAM,yBAAyB,CAAC,gBAAwB;AAE7D,QAAM,8BAA8B,YAAY,MAAM,WAAW,EAAE,MAAM,CAAC;AAE1E,SAAO,MAAM,4BAA4B,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG,CAAC;AACtF;AAEO,MAAM,wBAAwB,CAAC,gBACpC,KAAK,YAAY,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,EAAE,KAAK,EAAE,CAAC;AAE/D,MAAM,6BAA6B,CAAC,MAAc,WAAmB;AAEnE,QAAM,cAAc,KAAK,kBAAkB,EAAE,WAAW,OAAO,kBAAkB,CAAC,IAC9E,KAAK,MAAM,OAAO,MAAM,IACxB;AACJ,QAAM,kBAAkB,WAAW,YAAY,kBAAkB,CAAC;AAIlE,MAAI,gBAAgB,iBAAiB;AACnC,UAAM,IAAI;AAAA,MACR,8CAA8C,WAAW,2BAA2B,eAAe;AAAA,IACrG;AAAA,EACF;AACF;AAEO,MAAM,0BAA0B,CACrC,eACA,eAC2B;AAC3B,6BAA2B,eAAe,IAAI;AAC9C,QAAM,MAAM,CAAC;AACb,SAAO,KAAK,UAAU,EAAE,QAAQ,CAAC,aAAa;AAC5C,UAAM,cAAc,GAAG,aAAa,IAAI,WAAW,QAAQ,CAAC;AAC5D,QAAI,QAAQ,IAAI,uBAAuB,WAAW;AAAA,EACpD,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -12,7 +12,17 @@ const displayNameToKebabCase = (displayName) => {
|
|
|
12
12
|
return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join("-")}`;
|
|
13
13
|
};
|
|
14
14
|
const displayNameToPropCase = (displayName) => `ds${displayName.slice(2).split("-").map(capitalize).join("")}`;
|
|
15
|
+
const isComponentNameCapitalized = (name, prefix) => {
|
|
16
|
+
const currentName = name.toLocaleLowerCase().startsWith(prefix.toLocaleLowerCase()) ? name.slice(prefix.length) : name;
|
|
17
|
+
const capitalizedName = capitalize(currentName.toLocaleLowerCase());
|
|
18
|
+
if (currentName !== capitalizedName) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Do not use CamelCase for component names. '${currentName}' should be renamed to '${capitalizedName}'`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
15
24
|
const slotObjectToDataTestIds = (componentName, slotObject) => {
|
|
25
|
+
isComponentNameCapitalized(componentName, "ds");
|
|
16
26
|
const obj = {};
|
|
17
27
|
Object.keys(slotObject).forEach((slotName) => {
|
|
18
28
|
const displayName = `${componentName}-${slotObject[slotName]}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/helpers.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n\nconst isEmpty = (string: string): boolean => string.length === 0;\n\nexport const propsToClassKey = (props: Record<string, { toString: () => string }>): string =>\n Object.keys(props)\n .sort()\n .reduce((classKey, key) => {\n if (key === 'color') {\n return classKey + (isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key])));\n }\n return `${classKey}${isEmpty(String(classKey)) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }, '');\n\nexport const displayNameToKebabCase = (displayName: string) => {\n // We also remove \"DS\" preffix\n const displayNameSplitOnUppercase = displayName.split(/(?=[A-Z])/).slice(2);\n\n return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join('-')}`;\n};\n\nexport const displayNameToPropCase = (displayName: string) =>\n `ds${displayName.slice(2).split('-').map(capitalize).join('')}`;\n\nexport const slotObjectToDataTestIds = (\n componentName: string,\n slotObject: Record<string, string>,\n): Record<string, string> => {\n const obj = {} as Record<string, string>;\n Object.keys(slotObject).forEach((slotName) => {\n const displayName = `${componentName}-${slotObject[slotName]}`;\n obj[slotName] = displayNameToKebabCase(displayName);\n });\n return obj;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;AAE9F,MAAM,UAAU,CAAC,WAA4B,OAAO,WAAW;AAExD,MAAM,kBAAkB,CAAC,UAC9B,OAAO,KAAK,KAAK,EACd,KAAK,EACL,OAAO,CAAC,UAAU,QAAQ;AACzB,MAAI,QAAQ,SAAS;AACnB,WAAO,YAAY,QAAQ,OAAO,QAAQ,CAAC,IAAI,OAAO,MAAM,GAAG,CAAC,IAAI,WAAW,OAAO,MAAM,GAAG,CAAC,CAAC;AAAA,EACnG;AACA,SAAO,GAAG,QAAQ,GAAG,QAAQ,OAAO,QAAQ,CAAC,IAAI,MAAM,WAAW,GAAG,CAAC,GAAG,WAAW,MAAM,GAAG,EAAE,SAAS,CAAC,CAAC;AAC5G,GAAG,EAAE;AAEF,MAAM,yBAAyB,CAAC,gBAAwB;AAE7D,QAAM,8BAA8B,YAAY,MAAM,WAAW,EAAE,MAAM,CAAC;AAE1E,SAAO,MAAM,4BAA4B,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG,CAAC;AACtF;AAEO,MAAM,wBAAwB,CAAC,gBACpC,KAAK,YAAY,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,EAAE,KAAK,EAAE,CAAC;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n\nconst isEmpty = (string: string): boolean => string.length === 0;\n\nexport const propsToClassKey = (props: Record<string, { toString: () => string }>): string =>\n Object.keys(props)\n .sort()\n .reduce((classKey, key) => {\n if (key === 'color') {\n return classKey + (isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key])));\n }\n return `${classKey}${isEmpty(String(classKey)) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }, '');\n\nexport const displayNameToKebabCase = (displayName: string) => {\n // We also remove \"DS\" preffix\n const displayNameSplitOnUppercase = displayName.split(/(?=[A-Z])/).slice(2);\n\n return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join('-')}`;\n};\n\nexport const displayNameToPropCase = (displayName: string) =>\n `ds${displayName.slice(2).split('-').map(capitalize).join('')}`;\n\nconst isComponentNameCapitalized = (name: string, prefix: string) => {\n // Remove the \"DS\" prefix if present\n const currentName = name.toLocaleLowerCase().startsWith(prefix.toLocaleLowerCase())\n ? name.slice(prefix.length)\n : name;\n const capitalizedName = capitalize(currentName.toLocaleLowerCase());\n // Check if a component name is capitalized after removing the \"DS\" prefix\n // e.g.: DSMyComponent should be named DSMycomponent (\"Mycomponent\" is capitalized)\n // otherwise an error is thrown\n if (currentName !== capitalizedName) {\n throw new Error(\n `Do not use CamelCase for component names. '${currentName}' should be renamed to '${capitalizedName}'`,\n );\n }\n};\n\nexport const slotObjectToDataTestIds = (\n componentName: string,\n slotObject: Record<string, string>,\n): Record<string, string> => {\n isComponentNameCapitalized(componentName, 'ds');\n const obj = {} as Record<string, string>;\n Object.keys(slotObject).forEach((slotName) => {\n const displayName = `${componentName}-${slotObject[slotName]}`;\n obj[slotName] = displayNameToKebabCase(displayName);\n });\n return obj;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;AAE9F,MAAM,UAAU,CAAC,WAA4B,OAAO,WAAW;AAExD,MAAM,kBAAkB,CAAC,UAC9B,OAAO,KAAK,KAAK,EACd,KAAK,EACL,OAAO,CAAC,UAAU,QAAQ;AACzB,MAAI,QAAQ,SAAS;AACnB,WAAO,YAAY,QAAQ,OAAO,QAAQ,CAAC,IAAI,OAAO,MAAM,GAAG,CAAC,IAAI,WAAW,OAAO,MAAM,GAAG,CAAC,CAAC;AAAA,EACnG;AACA,SAAO,GAAG,QAAQ,GAAG,QAAQ,OAAO,QAAQ,CAAC,IAAI,MAAM,WAAW,GAAG,CAAC,GAAG,WAAW,MAAM,GAAG,EAAE,SAAS,CAAC,CAAC;AAC5G,GAAG,EAAE;AAEF,MAAM,yBAAyB,CAAC,gBAAwB;AAE7D,QAAM,8BAA8B,YAAY,MAAM,WAAW,EAAE,MAAM,CAAC;AAE1E,SAAO,MAAM,4BAA4B,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG,CAAC;AACtF;AAEO,MAAM,wBAAwB,CAAC,gBACpC,KAAK,YAAY,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,EAAE,KAAK,EAAE,CAAC;AAE/D,MAAM,6BAA6B,CAAC,MAAc,WAAmB;AAEnE,QAAM,cAAc,KAAK,kBAAkB,EAAE,WAAW,OAAO,kBAAkB,CAAC,IAC9E,KAAK,MAAM,OAAO,MAAM,IACxB;AACJ,QAAM,kBAAkB,WAAW,YAAY,kBAAkB,CAAC;AAIlE,MAAI,gBAAgB,iBAAiB;AACnC,UAAM,IAAI;AAAA,MACR,8CAA8C,WAAW,2BAA2B,eAAe;AAAA,IACrG;AAAA,EACF;AACF;AAEO,MAAM,0BAA0B,CACrC,eACA,eAC2B;AAC3B,6BAA2B,eAAe,IAAI;AAC9C,QAAM,MAAM,CAAC;AACb,SAAO,KAAK,UAAU,EAAE,QAAQ,CAAC,aAAa;AAC5C,UAAM,cAAc,GAAG,aAAa,IAAI,WAAW,QAAQ,CAAC;AAC5D,QAAI,QAAQ,IAAI,uBAAuB,WAAW;AAAA,EACpD,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-system",
|
|
3
|
-
"version": "3.51.0-
|
|
3
|
+
"version": "3.51.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - System",
|
|
6
6
|
"files": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"pnpm": ">=
|
|
29
|
-
"node": ">=
|
|
28
|
+
"pnpm": ">=9",
|
|
29
|
+
"node": ">=22"
|
|
30
30
|
},
|
|
31
31
|
"author": "ICE MT",
|
|
32
32
|
"jestSonar": {
|
|
@@ -49,8 +49,9 @@
|
|
|
49
49
|
"@elliemae/pui-cli": "9.0.0-next.55",
|
|
50
50
|
"@elliemae/pui-theme": "~2.10.0",
|
|
51
51
|
"jest": "~29.7.0",
|
|
52
|
+
"jest-cli": "~29.7.0",
|
|
52
53
|
"styled-components": "~5.3.9",
|
|
53
|
-
"@elliemae/ds-monorepo-devops": "3.51.0-
|
|
54
|
+
"@elliemae/ds-monorepo-devops": "3.51.0-rc.0"
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
56
57
|
"@elliemae/pui-theme": "~2.10.0",
|