optimized-react-component-library-xyz123 0.1.15 → 0.1.17
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.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +71 -0
- package/dist/index.mjs +70 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -298,4 +298,15 @@ interface ValidationErrorSummaryListProps {
|
|
|
298
298
|
|
|
299
299
|
declare const ValidationErrorSummaryList: React.FC<ValidationErrorSummaryListProps>;
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
interface CookieBannerProps {
|
|
302
|
+
isTouched?: any;
|
|
303
|
+
onCookieStateChange?: () => void;
|
|
304
|
+
visible?: boolean;
|
|
305
|
+
onClose?: () => void;
|
|
306
|
+
acceptCookies: () => void;
|
|
307
|
+
rejectCookies: () => void;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
311
|
+
|
|
312
|
+
export { CookieBanner, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList };
|
package/dist/index.d.ts
CHANGED
|
@@ -298,4 +298,15 @@ interface ValidationErrorSummaryListProps {
|
|
|
298
298
|
|
|
299
299
|
declare const ValidationErrorSummaryList: React.FC<ValidationErrorSummaryListProps>;
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
interface CookieBannerProps {
|
|
302
|
+
isTouched?: any;
|
|
303
|
+
onCookieStateChange?: () => void;
|
|
304
|
+
visible?: boolean;
|
|
305
|
+
onClose?: () => void;
|
|
306
|
+
acceptCookies: () => void;
|
|
307
|
+
rejectCookies: () => void;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
311
|
+
|
|
312
|
+
export { CookieBanner, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList };
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.tsx
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
CookieBanner: () => CookieBanner_default,
|
|
33
34
|
CreateApiDataObject: () => CreateApiDataObject_default,
|
|
34
35
|
DoCategoriesAndQuestionsVisible: () => DoCategoriesAndQuestionsVisible_default,
|
|
35
36
|
EditPreviewLinkStandard: () => EditPreviewLinkStandard_default,
|
|
@@ -2047,8 +2048,78 @@ var ValidationErrorSummaryList = ({
|
|
|
2047
2048
|
);
|
|
2048
2049
|
};
|
|
2049
2050
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
2051
|
+
|
|
2052
|
+
// src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
|
|
2053
|
+
var import_react6 = require("react");
|
|
2054
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2055
|
+
var CookieBanner = ({
|
|
2056
|
+
visible = false,
|
|
2057
|
+
onCookieStateChange,
|
|
2058
|
+
onClose,
|
|
2059
|
+
acceptCookies,
|
|
2060
|
+
rejectCookies
|
|
2061
|
+
}) => {
|
|
2062
|
+
(0, import_react6.useEffect)(() => {
|
|
2063
|
+
if (visible) {
|
|
2064
|
+
document.body.classList.add("has-cookie-banner");
|
|
2065
|
+
} else {
|
|
2066
|
+
document.body.classList.remove("has-cookie-banner");
|
|
2067
|
+
}
|
|
2068
|
+
return () => {
|
|
2069
|
+
document.body.classList.remove("has-cookie-banner");
|
|
2070
|
+
};
|
|
2071
|
+
}, [visible]);
|
|
2072
|
+
if (!visible) return null;
|
|
2073
|
+
const handleCookieChoice = (accepted) => {
|
|
2074
|
+
if (accepted) {
|
|
2075
|
+
acceptCookies();
|
|
2076
|
+
} else {
|
|
2077
|
+
rejectCookies();
|
|
2078
|
+
}
|
|
2079
|
+
if (onCookieStateChange) {
|
|
2080
|
+
onCookieStateChange();
|
|
2081
|
+
}
|
|
2082
|
+
if (onClose) {
|
|
2083
|
+
onClose();
|
|
2084
|
+
}
|
|
2085
|
+
};
|
|
2086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "pts-cookieBanner", role: "dialog", "aria-labelledby": "cookie-banner-title", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "content", children: [
|
|
2087
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { children: "Kakor (cookies)" }),
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: 'PTS skulle vilja anv\xE4nda en statistikkaka i syfte att rapportera anv\xE4ndarstatistik till Europeiska kommissionen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 "Kakor" l\xE4ngst ned till v\xE4nster p\xE5 webbplatsen.' }),
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "pts-cookieBanner-Links", children: [
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2091
|
+
"svg",
|
|
2092
|
+
{
|
|
2093
|
+
width: "27",
|
|
2094
|
+
height: "27",
|
|
2095
|
+
viewBox: "0 0 27 27",
|
|
2096
|
+
fill: "none",
|
|
2097
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2098
|
+
"aria-hidden": "true",
|
|
2099
|
+
children: [
|
|
2100
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { width: "27", height: "27", rx: "13.5", fill: "#6E3282" }),
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2102
|
+
"path",
|
|
2103
|
+
{
|
|
2104
|
+
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",
|
|
2105
|
+
fill: "white"
|
|
2106
|
+
}
|
|
2107
|
+
)
|
|
2108
|
+
]
|
|
2109
|
+
}
|
|
2110
|
+
),
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("a", { href: "www.pts.se", target: "_blank", rel: "noopener noreferrer", children: "Kakor (cookies) p\xE5 pts.se" })
|
|
2112
|
+
] }),
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "pts-cookieBanner-Buttons", children: [
|
|
2114
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { onClick: () => handleCookieChoice(false), children: "Nej, jag samtycker inte" })
|
|
2116
|
+
] })
|
|
2117
|
+
] }) });
|
|
2118
|
+
};
|
|
2119
|
+
var CookieBanner_default = CookieBanner;
|
|
2050
2120
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2051
2121
|
0 && (module.exports = {
|
|
2122
|
+
CookieBanner,
|
|
2052
2123
|
CreateApiDataObject,
|
|
2053
2124
|
DoCategoriesAndQuestionsVisible,
|
|
2054
2125
|
EditPreviewLinkStandard,
|
package/dist/index.mjs
CHANGED
|
@@ -1984,7 +1984,77 @@ var ValidationErrorSummaryList = ({
|
|
|
1984
1984
|
);
|
|
1985
1985
|
};
|
|
1986
1986
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
1987
|
+
|
|
1988
|
+
// src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
|
|
1989
|
+
import { useEffect as useEffect4 } from "react";
|
|
1990
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1991
|
+
var CookieBanner = ({
|
|
1992
|
+
visible = false,
|
|
1993
|
+
onCookieStateChange,
|
|
1994
|
+
onClose,
|
|
1995
|
+
acceptCookies,
|
|
1996
|
+
rejectCookies
|
|
1997
|
+
}) => {
|
|
1998
|
+
useEffect4(() => {
|
|
1999
|
+
if (visible) {
|
|
2000
|
+
document.body.classList.add("has-cookie-banner");
|
|
2001
|
+
} else {
|
|
2002
|
+
document.body.classList.remove("has-cookie-banner");
|
|
2003
|
+
}
|
|
2004
|
+
return () => {
|
|
2005
|
+
document.body.classList.remove("has-cookie-banner");
|
|
2006
|
+
};
|
|
2007
|
+
}, [visible]);
|
|
2008
|
+
if (!visible) return null;
|
|
2009
|
+
const handleCookieChoice = (accepted) => {
|
|
2010
|
+
if (accepted) {
|
|
2011
|
+
acceptCookies();
|
|
2012
|
+
} else {
|
|
2013
|
+
rejectCookies();
|
|
2014
|
+
}
|
|
2015
|
+
if (onCookieStateChange) {
|
|
2016
|
+
onCookieStateChange();
|
|
2017
|
+
}
|
|
2018
|
+
if (onClose) {
|
|
2019
|
+
onClose();
|
|
2020
|
+
}
|
|
2021
|
+
};
|
|
2022
|
+
return /* @__PURE__ */ jsx21("div", { className: "pts-cookieBanner", role: "dialog", "aria-labelledby": "cookie-banner-title", children: /* @__PURE__ */ jsxs19("div", { className: "content", children: [
|
|
2023
|
+
/* @__PURE__ */ jsx21("h3", { children: "Kakor (cookies)" }),
|
|
2024
|
+
/* @__PURE__ */ jsx21("p", { children: 'PTS skulle vilja anv\xE4nda en statistikkaka i syfte att rapportera anv\xE4ndarstatistik till Europeiska kommissionen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 "Kakor" l\xE4ngst ned till v\xE4nster p\xE5 webbplatsen.' }),
|
|
2025
|
+
/* @__PURE__ */ jsxs19("div", { className: "pts-cookieBanner-Links", children: [
|
|
2026
|
+
/* @__PURE__ */ jsxs19(
|
|
2027
|
+
"svg",
|
|
2028
|
+
{
|
|
2029
|
+
width: "27",
|
|
2030
|
+
height: "27",
|
|
2031
|
+
viewBox: "0 0 27 27",
|
|
2032
|
+
fill: "none",
|
|
2033
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2034
|
+
"aria-hidden": "true",
|
|
2035
|
+
children: [
|
|
2036
|
+
/* @__PURE__ */ jsx21("rect", { width: "27", height: "27", rx: "13.5", fill: "#6E3282" }),
|
|
2037
|
+
/* @__PURE__ */ jsx21(
|
|
2038
|
+
"path",
|
|
2039
|
+
{
|
|
2040
|
+
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",
|
|
2041
|
+
fill: "white"
|
|
2042
|
+
}
|
|
2043
|
+
)
|
|
2044
|
+
]
|
|
2045
|
+
}
|
|
2046
|
+
),
|
|
2047
|
+
/* @__PURE__ */ jsx21("a", { href: "www.pts.se", target: "_blank", rel: "noopener noreferrer", children: "Kakor (cookies) p\xE5 pts.se" })
|
|
2048
|
+
] }),
|
|
2049
|
+
/* @__PURE__ */ jsxs19("div", { className: "pts-cookieBanner-Buttons", children: [
|
|
2050
|
+
/* @__PURE__ */ jsx21("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),
|
|
2051
|
+
/* @__PURE__ */ jsx21("button", { onClick: () => handleCookieChoice(false), children: "Nej, jag samtycker inte" })
|
|
2052
|
+
] })
|
|
2053
|
+
] }) });
|
|
2054
|
+
};
|
|
2055
|
+
var CookieBanner_default = CookieBanner;
|
|
1987
2056
|
export {
|
|
2057
|
+
CookieBanner_default as CookieBanner,
|
|
1988
2058
|
CreateApiDataObject_default as CreateApiDataObject,
|
|
1989
2059
|
DoCategoriesAndQuestionsVisible_default as DoCategoriesAndQuestionsVisible,
|
|
1990
2060
|
EditPreviewLinkStandard_default as EditPreviewLinkStandard,
|