optimized-react-component-library-xyz123 0.1.17 → 0.1.19
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.
- package/dist/index.js +44 -37
- package/dist/index.mjs +42 -35
- package/package.json +14 -11
package/dist/index.js
CHANGED
|
@@ -841,26 +841,24 @@ var normalize = (str) => {
|
|
|
841
841
|
function CreateApiDataObject(data, specialMappedQuestions, translatedAnswers) {
|
|
842
842
|
return data.reduce((acc, question) => {
|
|
843
843
|
var _a;
|
|
844
|
-
let translatedAnswer = question.
|
|
845
|
-
if (question.
|
|
846
|
-
const answerNormalized = normalize(question.
|
|
847
|
-
const matchingIds = question.
|
|
848
|
-
(option) => answerNormalized.includes(normalize(option.label))
|
|
849
|
-
).map((option) => `^${option.id}^`);
|
|
844
|
+
let translatedAnswer = question.answer;
|
|
845
|
+
if (question.answer && typeof question.answer === "string" && Array.isArray(question.options) && question.mappingId && specialMappedQuestions.has(question.mappingId)) {
|
|
846
|
+
const answerNormalized = normalize(question.answer);
|
|
847
|
+
const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.label))).map((option) => `^${option.id}^`);
|
|
850
848
|
if (matchingIds.length > 0) {
|
|
851
849
|
translatedAnswer = matchingIds.join(",");
|
|
852
850
|
}
|
|
853
851
|
} else {
|
|
854
|
-
const shouldTranslate = question.
|
|
855
|
-
translatedAnswer = shouldTranslate ? shouldTranslate[question.
|
|
852
|
+
const shouldTranslate = question.mappingId ? translatedAnswers[question.mappingId] : void 0;
|
|
853
|
+
translatedAnswer = shouldTranslate ? shouldTranslate[question.answer] || question.answer : question.answer;
|
|
856
854
|
}
|
|
857
855
|
return {
|
|
858
856
|
...acc,
|
|
859
|
-
...question.
|
|
860
|
-
[question.
|
|
857
|
+
...question.mappingId && question.isDisplayed && question.answer && {
|
|
858
|
+
[question.mappingId]: translatedAnswer
|
|
861
859
|
},
|
|
862
|
-
...question.
|
|
863
|
-
files: question.
|
|
860
|
+
...question.questionType === "AddFiles" && ((_a = question.files) == null ? void 0 : _a.length) && question.files.length > 0 && {
|
|
861
|
+
files: question.files
|
|
864
862
|
}
|
|
865
863
|
};
|
|
866
864
|
}, {});
|
|
@@ -1789,34 +1787,43 @@ var Modal = ({ showModal: isOpen, activatedLanguage = "" }) => {
|
|
|
1789
1787
|
var ModalStandard_default = Modal;
|
|
1790
1788
|
|
|
1791
1789
|
// src/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.tsx
|
|
1790
|
+
var import_react5 = require("react");
|
|
1792
1791
|
var import_dompurify5 = __toESM(require("dompurify"));
|
|
1793
1792
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1794
1793
|
var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
1795
|
-
const HeadlineTag = headlineType;
|
|
1796
1794
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "pts-textHeadlineAndBody-container", children: [
|
|
1797
|
-
data.headline &&
|
|
1795
|
+
data.headline && (0, import_react5.createElement)(headlineType, {}, data.headline),
|
|
1798
1796
|
data.body && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify5.default.sanitize(data.body) } }),
|
|
1799
|
-
data.linksForMoreInfo && data.linksForMoreInfo.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1810
|
-
"path",
|
|
1797
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1798
|
+
"a",
|
|
1799
|
+
{
|
|
1800
|
+
href: link.url,
|
|
1801
|
+
target: "_blank",
|
|
1802
|
+
rel: "noopener noreferrer",
|
|
1803
|
+
"aria-label": link.ariaLabel,
|
|
1804
|
+
children: [
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1806
|
+
"svg",
|
|
1811
1807
|
{
|
|
1812
|
-
|
|
1813
|
-
|
|
1808
|
+
"aria-hidden": "true",
|
|
1809
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1810
|
+
width: "12",
|
|
1811
|
+
height: "10",
|
|
1812
|
+
viewBox: "0 0 12 10",
|
|
1813
|
+
fill: "none",
|
|
1814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1815
|
+
"path",
|
|
1816
|
+
{
|
|
1817
|
+
d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
|
|
1818
|
+
fill: "#ffffff"
|
|
1819
|
+
}
|
|
1820
|
+
)
|
|
1814
1821
|
}
|
|
1815
|
-
)
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1822
|
+
) }),
|
|
1823
|
+
link.title
|
|
1824
|
+
]
|
|
1825
|
+
}
|
|
1826
|
+
) }, `more-info-${index}`)) })
|
|
1820
1827
|
] });
|
|
1821
1828
|
};
|
|
1822
1829
|
var TextHeadlineAndBodyStandard_default = TextHeadlineAndBody;
|
|
@@ -1952,14 +1959,14 @@ var StepperButtons = ({
|
|
|
1952
1959
|
var StepperButtonsStandard_default = StepperButtons;
|
|
1953
1960
|
|
|
1954
1961
|
// src/NewTextComponentStandard/StepperStandard/StepperStandard.tsx
|
|
1955
|
-
var
|
|
1962
|
+
var import_react6 = __toESM(require("react"));
|
|
1956
1963
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1957
1964
|
var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
1958
1965
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pts-stepper-container", "aria-hidden": "true", children: arraySteps.map((step, index) => {
|
|
1959
1966
|
const isActive = step.step === activeStep;
|
|
1960
1967
|
const lastElement = arraySteps.length;
|
|
1961
1968
|
const isDone = step.step < activeStep;
|
|
1962
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react6.default.Fragment, { children: [
|
|
1963
1970
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "pts-stepper-step", children: [
|
|
1964
1971
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1965
1972
|
"div",
|
|
@@ -2050,7 +2057,7 @@ var ValidationErrorSummaryList = ({
|
|
|
2050
2057
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
2051
2058
|
|
|
2052
2059
|
// src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
|
|
2053
|
-
var
|
|
2060
|
+
var import_react7 = require("react");
|
|
2054
2061
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2055
2062
|
var CookieBanner = ({
|
|
2056
2063
|
visible = false,
|
|
@@ -2059,7 +2066,7 @@ var CookieBanner = ({
|
|
|
2059
2066
|
acceptCookies,
|
|
2060
2067
|
rejectCookies
|
|
2061
2068
|
}) => {
|
|
2062
|
-
(0,
|
|
2069
|
+
(0, import_react7.useEffect)(() => {
|
|
2063
2070
|
if (visible) {
|
|
2064
2071
|
document.body.classList.add("has-cookie-banner");
|
|
2065
2072
|
} else {
|
package/dist/index.mjs
CHANGED
|
@@ -777,26 +777,24 @@ var normalize = (str) => {
|
|
|
777
777
|
function CreateApiDataObject(data, specialMappedQuestions, translatedAnswers) {
|
|
778
778
|
return data.reduce((acc, question) => {
|
|
779
779
|
var _a;
|
|
780
|
-
let translatedAnswer = question.
|
|
781
|
-
if (question.
|
|
782
|
-
const answerNormalized = normalize(question.
|
|
783
|
-
const matchingIds = question.
|
|
784
|
-
(option) => answerNormalized.includes(normalize(option.label))
|
|
785
|
-
).map((option) => `^${option.id}^`);
|
|
780
|
+
let translatedAnswer = question.answer;
|
|
781
|
+
if (question.answer && typeof question.answer === "string" && Array.isArray(question.options) && question.mappingId && specialMappedQuestions.has(question.mappingId)) {
|
|
782
|
+
const answerNormalized = normalize(question.answer);
|
|
783
|
+
const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.label))).map((option) => `^${option.id}^`);
|
|
786
784
|
if (matchingIds.length > 0) {
|
|
787
785
|
translatedAnswer = matchingIds.join(",");
|
|
788
786
|
}
|
|
789
787
|
} else {
|
|
790
|
-
const shouldTranslate = question.
|
|
791
|
-
translatedAnswer = shouldTranslate ? shouldTranslate[question.
|
|
788
|
+
const shouldTranslate = question.mappingId ? translatedAnswers[question.mappingId] : void 0;
|
|
789
|
+
translatedAnswer = shouldTranslate ? shouldTranslate[question.answer] || question.answer : question.answer;
|
|
792
790
|
}
|
|
793
791
|
return {
|
|
794
792
|
...acc,
|
|
795
|
-
...question.
|
|
796
|
-
[question.
|
|
793
|
+
...question.mappingId && question.isDisplayed && question.answer && {
|
|
794
|
+
[question.mappingId]: translatedAnswer
|
|
797
795
|
},
|
|
798
|
-
...question.
|
|
799
|
-
files: question.
|
|
796
|
+
...question.questionType === "AddFiles" && ((_a = question.files) == null ? void 0 : _a.length) && question.files.length > 0 && {
|
|
797
|
+
files: question.files
|
|
800
798
|
}
|
|
801
799
|
};
|
|
802
800
|
}, {});
|
|
@@ -1725,34 +1723,43 @@ var Modal = ({ showModal: isOpen, activatedLanguage = "" }) => {
|
|
|
1725
1723
|
var ModalStandard_default = Modal;
|
|
1726
1724
|
|
|
1727
1725
|
// src/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.tsx
|
|
1726
|
+
import { createElement } from "react";
|
|
1728
1727
|
import DOMPurify5 from "dompurify";
|
|
1729
1728
|
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1730
1729
|
var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
1731
|
-
const HeadlineTag = headlineType;
|
|
1732
1730
|
return /* @__PURE__ */ jsxs14("section", { className: "pts-textHeadlineAndBody-container", children: [
|
|
1733
|
-
data.headline &&
|
|
1731
|
+
data.headline && createElement(headlineType, {}, data.headline),
|
|
1734
1732
|
data.body && /* @__PURE__ */ jsx14("div", { dangerouslySetInnerHTML: { __html: DOMPurify5.sanitize(data.body) } }),
|
|
1735
|
-
data.linksForMoreInfo && data.linksForMoreInfo.length > 0 && /* @__PURE__ */ jsx14("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ jsx14("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs14(
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
children: /* @__PURE__ */ jsx14(
|
|
1746
|
-
"path",
|
|
1733
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length > 0 && /* @__PURE__ */ jsx14("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ jsx14("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs14(
|
|
1734
|
+
"a",
|
|
1735
|
+
{
|
|
1736
|
+
href: link.url,
|
|
1737
|
+
target: "_blank",
|
|
1738
|
+
rel: "noopener noreferrer",
|
|
1739
|
+
"aria-label": link.ariaLabel,
|
|
1740
|
+
children: [
|
|
1741
|
+
/* @__PURE__ */ jsx14("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ jsx14(
|
|
1742
|
+
"svg",
|
|
1747
1743
|
{
|
|
1748
|
-
|
|
1749
|
-
|
|
1744
|
+
"aria-hidden": "true",
|
|
1745
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1746
|
+
width: "12",
|
|
1747
|
+
height: "10",
|
|
1748
|
+
viewBox: "0 0 12 10",
|
|
1749
|
+
fill: "none",
|
|
1750
|
+
children: /* @__PURE__ */ jsx14(
|
|
1751
|
+
"path",
|
|
1752
|
+
{
|
|
1753
|
+
d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
|
|
1754
|
+
fill: "#ffffff"
|
|
1755
|
+
}
|
|
1756
|
+
)
|
|
1750
1757
|
}
|
|
1751
|
-
)
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1758
|
+
) }),
|
|
1759
|
+
link.title
|
|
1760
|
+
]
|
|
1761
|
+
}
|
|
1762
|
+
) }, `more-info-${index}`)) })
|
|
1756
1763
|
] });
|
|
1757
1764
|
};
|
|
1758
1765
|
var TextHeadlineAndBodyStandard_default = TextHeadlineAndBody;
|
|
@@ -1888,14 +1895,14 @@ var StepperButtons = ({
|
|
|
1888
1895
|
var StepperButtonsStandard_default = StepperButtons;
|
|
1889
1896
|
|
|
1890
1897
|
// src/NewTextComponentStandard/StepperStandard/StepperStandard.tsx
|
|
1891
|
-
import
|
|
1898
|
+
import React5 from "react";
|
|
1892
1899
|
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1893
1900
|
var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
1894
1901
|
return /* @__PURE__ */ jsx19("div", { className: "pts-stepper-container", "aria-hidden": "true", children: arraySteps.map((step, index) => {
|
|
1895
1902
|
const isActive = step.step === activeStep;
|
|
1896
1903
|
const lastElement = arraySteps.length;
|
|
1897
1904
|
const isDone = step.step < activeStep;
|
|
1898
|
-
return /* @__PURE__ */ jsxs17(
|
|
1905
|
+
return /* @__PURE__ */ jsxs17(React5.Fragment, { children: [
|
|
1899
1906
|
/* @__PURE__ */ jsxs17("div", { className: "pts-stepper-step", children: [
|
|
1900
1907
|
/* @__PURE__ */ jsx19(
|
|
1901
1908
|
"div",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optimized-react-component-library-xyz123",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "A modern React component library using TypeScript.",
|
|
3
|
+
"version": "0.1.19",
|
|
4
|
+
"description": "A modern React component library using TypeScript with React 19 support.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"exports": {
|
|
@@ -30,37 +30,40 @@
|
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/YOUR_USERNAME/optimized-react-component-library-xyz123.git"
|
|
33
|
+
"url": "git+https://github.com/YOUR_USERNAME/optimized-react-component-library-xyz123-ch-react19.git"
|
|
34
34
|
},
|
|
35
35
|
"keywords": [
|
|
36
36
|
"react",
|
|
37
|
+
"react19",
|
|
37
38
|
"component-library",
|
|
38
39
|
"typescript",
|
|
39
40
|
"npm",
|
|
41
|
+
"modern-react",
|
|
40
42
|
"boilerplate"
|
|
41
43
|
],
|
|
42
44
|
"author": "YOUR NAME",
|
|
43
45
|
"license": "MIT",
|
|
44
46
|
"peerDependencies": {
|
|
45
|
-
"react": "
|
|
46
|
-
"react-dom": "
|
|
47
|
+
"react": "^19.2.0",
|
|
48
|
+
"react-dom": "^19.2.0"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
51
|
"@testing-library/jest-dom": "^6.8.0",
|
|
50
52
|
"@testing-library/react": "^16.3.0",
|
|
51
53
|
"@types/dompurify": "^3.0.5",
|
|
52
|
-
"@types/react": "^
|
|
53
|
-
"@types/react-dom": "^
|
|
54
|
-
"eslint": "^
|
|
54
|
+
"@types/react": "^19.2.2",
|
|
55
|
+
"@types/react-dom": "^19.2.1",
|
|
56
|
+
"eslint": "^9.0.0",
|
|
55
57
|
"eslint-config-prettier": "^9.0.0",
|
|
56
|
-
"eslint-plugin-react": "^7.
|
|
58
|
+
"eslint-plugin-react": "^7.35.0",
|
|
59
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
57
60
|
"husky": "^9.0.0",
|
|
58
61
|
"jsdom": "^26.1.0",
|
|
59
62
|
"prettier": "^3.0.0",
|
|
60
63
|
"standard-version": "^9.5.0",
|
|
61
64
|
"tsup": "^8.0.0",
|
|
62
|
-
"typescript": "^5.
|
|
63
|
-
"vitest": "^
|
|
65
|
+
"typescript": "^5.6.0",
|
|
66
|
+
"vitest": "^2.0.0"
|
|
64
67
|
},
|
|
65
68
|
"dependencies": {
|
|
66
69
|
"clsx": "^2.1.1",
|