optimized-react-component-library-xyz123 0.1.20 → 0.1.22
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 +52 -48
- package/dist/index.mjs +52 -48
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1778,11 +1778,14 @@ var CONTENT = {
|
|
|
1778
1778
|
var Modal = ({ showModal: isOpen, activatedLanguage = "" }) => {
|
|
1779
1779
|
const currentContent = activatedLanguage === "en" ? CONTENT.en : CONTENT.sv;
|
|
1780
1780
|
if (!isOpen) return null;
|
|
1781
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.
|
|
1782
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "pts-modal-overlay", children: [
|
|
1782
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { "aria-hidden": true, className: "pts-modal-content", children: [
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h1", { children: currentContent.heading }),
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: currentContent.message }),
|
|
1785
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "pts-spinner-border" })
|
|
1786
|
+
] }),
|
|
1787
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-live": "assertive", className: "visually-hidden", children: "Skickar in... V\xE4nligen v\xE4nta." })
|
|
1788
|
+
] });
|
|
1786
1789
|
};
|
|
1787
1790
|
var ModalStandard_default = Modal;
|
|
1788
1791
|
|
|
@@ -2057,7 +2060,6 @@ var ValidationErrorSummaryList = ({
|
|
|
2057
2060
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
2058
2061
|
|
|
2059
2062
|
// src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
|
|
2060
|
-
var import_react7 = require("react");
|
|
2061
2063
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2062
2064
|
var CookieBanner = ({
|
|
2063
2065
|
visible = false,
|
|
@@ -2066,16 +2068,6 @@ var CookieBanner = ({
|
|
|
2066
2068
|
acceptCookies,
|
|
2067
2069
|
rejectCookies
|
|
2068
2070
|
}) => {
|
|
2069
|
-
(0, import_react7.useEffect)(() => {
|
|
2070
|
-
if (visible) {
|
|
2071
|
-
document.body.classList.add("has-cookie-banner");
|
|
2072
|
-
} else {
|
|
2073
|
-
document.body.classList.remove("has-cookie-banner");
|
|
2074
|
-
}
|
|
2075
|
-
return () => {
|
|
2076
|
-
document.body.classList.remove("has-cookie-banner");
|
|
2077
|
-
};
|
|
2078
|
-
}, [visible]);
|
|
2079
2071
|
if (!visible) return null;
|
|
2080
2072
|
const handleCookieChoice = (accepted) => {
|
|
2081
2073
|
if (accepted) {
|
|
@@ -2090,38 +2082,50 @@ var CookieBanner = ({
|
|
|
2090
2082
|
onClose();
|
|
2091
2083
|
}
|
|
2092
2084
|
};
|
|
2093
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2086
|
+
"div",
|
|
2087
|
+
{
|
|
2088
|
+
className: "pts-cookieBanner",
|
|
2089
|
+
role: "dialog",
|
|
2090
|
+
"aria-labelledby": "cookie-banner-title",
|
|
2091
|
+
"aria-describedby": "cookie-banner-description",
|
|
2092
|
+
"aria-modal": "true",
|
|
2093
|
+
id: "cookie-banner",
|
|
2094
|
+
tabIndex: -1,
|
|
2095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "content", children: [
|
|
2096
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { id: "cookie-banner-description", children: "PTS skulle vilja anv\xE4nda en statistikkaka i syfte att l\xF6pande f\xF6rb\xE4ttra webbplatsen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 \u201DKakor\u201D i avsnittet l\xE4ngst ned p\xE5 webbplatsen." }),
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { id: "cookie-banner-description", className: "pts-cookieBanner-Links", children: [
|
|
2099
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2100
|
+
"svg",
|
|
2101
|
+
{
|
|
2102
|
+
width: "27",
|
|
2103
|
+
height: "27",
|
|
2104
|
+
viewBox: "0 0 27 27",
|
|
2105
|
+
fill: "none",
|
|
2106
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2107
|
+
"aria-hidden": "true",
|
|
2108
|
+
children: [
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { width: "27", height: "27", rx: "13.5", fill: "#6E3282" }),
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2111
|
+
"path",
|
|
2112
|
+
{
|
|
2113
|
+
d: "M13.5 18.7116L12.4911 17.7995L16.4559 14.1514H7.83594V12.8485H16.4559L12.4911 9.20036L13.5 8.28833L19.164 13.4999L13.5 18.7116Z",
|
|
2114
|
+
fill: "white"
|
|
2115
|
+
}
|
|
2116
|
+
)
|
|
2117
|
+
]
|
|
2118
|
+
}
|
|
2119
|
+
),
|
|
2120
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("a", { href: "www.pts.se", target: "_blank", rel: "noopener noreferrer", children: "Kakor (cookies) p\xE5 pts.se (\xD6ppnas i nytt f\xF6nster)" })
|
|
2121
|
+
] }),
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "pts-cookieBanner-Buttons", children: [
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { onClick: () => handleCookieChoice(false), children: "Nej, jag samtycker inte" })
|
|
2125
|
+
] })
|
|
2126
|
+
] })
|
|
2127
|
+
}
|
|
2128
|
+
);
|
|
2125
2129
|
};
|
|
2126
2130
|
var CookieBanner_default = CookieBanner;
|
|
2127
2131
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -1714,11 +1714,14 @@ var CONTENT = {
|
|
|
1714
1714
|
var Modal = ({ showModal: isOpen, activatedLanguage = "" }) => {
|
|
1715
1715
|
const currentContent = activatedLanguage === "en" ? CONTENT.en : CONTENT.sv;
|
|
1716
1716
|
if (!isOpen) return null;
|
|
1717
|
-
return /* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1717
|
+
return /* @__PURE__ */ jsxs13("div", { className: "pts-modal-overlay", children: [
|
|
1718
|
+
/* @__PURE__ */ jsxs13("div", { "aria-hidden": true, className: "pts-modal-content", children: [
|
|
1719
|
+
/* @__PURE__ */ jsx13("h1", { children: currentContent.heading }),
|
|
1720
|
+
/* @__PURE__ */ jsx13("p", { children: currentContent.message }),
|
|
1721
|
+
/* @__PURE__ */ jsx13("div", { className: "pts-spinner-border" })
|
|
1722
|
+
] }),
|
|
1723
|
+
/* @__PURE__ */ jsx13("span", { "aria-live": "assertive", className: "visually-hidden", children: "Skickar in... V\xE4nligen v\xE4nta." })
|
|
1724
|
+
] });
|
|
1722
1725
|
};
|
|
1723
1726
|
var ModalStandard_default = Modal;
|
|
1724
1727
|
|
|
@@ -1993,7 +1996,6 @@ var ValidationErrorSummaryList = ({
|
|
|
1993
1996
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
1994
1997
|
|
|
1995
1998
|
// src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
|
|
1996
|
-
import { useEffect as useEffect4 } from "react";
|
|
1997
1999
|
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1998
2000
|
var CookieBanner = ({
|
|
1999
2001
|
visible = false,
|
|
@@ -2002,16 +2004,6 @@ var CookieBanner = ({
|
|
|
2002
2004
|
acceptCookies,
|
|
2003
2005
|
rejectCookies
|
|
2004
2006
|
}) => {
|
|
2005
|
-
useEffect4(() => {
|
|
2006
|
-
if (visible) {
|
|
2007
|
-
document.body.classList.add("has-cookie-banner");
|
|
2008
|
-
} else {
|
|
2009
|
-
document.body.classList.remove("has-cookie-banner");
|
|
2010
|
-
}
|
|
2011
|
-
return () => {
|
|
2012
|
-
document.body.classList.remove("has-cookie-banner");
|
|
2013
|
-
};
|
|
2014
|
-
}, [visible]);
|
|
2015
2007
|
if (!visible) return null;
|
|
2016
2008
|
const handleCookieChoice = (accepted) => {
|
|
2017
2009
|
if (accepted) {
|
|
@@ -2026,38 +2018,50 @@ var CookieBanner = ({
|
|
|
2026
2018
|
onClose();
|
|
2027
2019
|
}
|
|
2028
2020
|
};
|
|
2029
|
-
return /* @__PURE__ */ jsx21(
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2021
|
+
return /* @__PURE__ */ jsx21(
|
|
2022
|
+
"div",
|
|
2023
|
+
{
|
|
2024
|
+
className: "pts-cookieBanner",
|
|
2025
|
+
role: "dialog",
|
|
2026
|
+
"aria-labelledby": "cookie-banner-title",
|
|
2027
|
+
"aria-describedby": "cookie-banner-description",
|
|
2028
|
+
"aria-modal": "true",
|
|
2029
|
+
id: "cookie-banner",
|
|
2030
|
+
tabIndex: -1,
|
|
2031
|
+
children: /* @__PURE__ */ jsxs19("div", { className: "content", children: [
|
|
2032
|
+
/* @__PURE__ */ jsx21("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
|
|
2033
|
+
/* @__PURE__ */ jsx21("p", { id: "cookie-banner-description", children: "PTS skulle vilja anv\xE4nda en statistikkaka i syfte att l\xF6pande f\xF6rb\xE4ttra webbplatsen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 \u201DKakor\u201D i avsnittet l\xE4ngst ned p\xE5 webbplatsen." }),
|
|
2034
|
+
/* @__PURE__ */ jsxs19("div", { id: "cookie-banner-description", className: "pts-cookieBanner-Links", children: [
|
|
2035
|
+
/* @__PURE__ */ jsxs19(
|
|
2036
|
+
"svg",
|
|
2037
|
+
{
|
|
2038
|
+
width: "27",
|
|
2039
|
+
height: "27",
|
|
2040
|
+
viewBox: "0 0 27 27",
|
|
2041
|
+
fill: "none",
|
|
2042
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2043
|
+
"aria-hidden": "true",
|
|
2044
|
+
children: [
|
|
2045
|
+
/* @__PURE__ */ jsx21("rect", { width: "27", height: "27", rx: "13.5", fill: "#6E3282" }),
|
|
2046
|
+
/* @__PURE__ */ jsx21(
|
|
2047
|
+
"path",
|
|
2048
|
+
{
|
|
2049
|
+
d: "M13.5 18.7116L12.4911 17.7995L16.4559 14.1514H7.83594V12.8485H16.4559L12.4911 9.20036L13.5 8.28833L19.164 13.4999L13.5 18.7116Z",
|
|
2050
|
+
fill: "white"
|
|
2051
|
+
}
|
|
2052
|
+
)
|
|
2053
|
+
]
|
|
2054
|
+
}
|
|
2055
|
+
),
|
|
2056
|
+
/* @__PURE__ */ jsx21("a", { href: "www.pts.se", target: "_blank", rel: "noopener noreferrer", children: "Kakor (cookies) p\xE5 pts.se (\xD6ppnas i nytt f\xF6nster)" })
|
|
2057
|
+
] }),
|
|
2058
|
+
/* @__PURE__ */ jsxs19("div", { className: "pts-cookieBanner-Buttons", children: [
|
|
2059
|
+
/* @__PURE__ */ jsx21("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),
|
|
2060
|
+
/* @__PURE__ */ jsx21("button", { onClick: () => handleCookieChoice(false), children: "Nej, jag samtycker inte" })
|
|
2061
|
+
] })
|
|
2062
|
+
] })
|
|
2063
|
+
}
|
|
2064
|
+
);
|
|
2061
2065
|
};
|
|
2062
2066
|
var CookieBanner_default = CookieBanner;
|
|
2063
2067
|
export {
|
package/package.json
CHANGED