optimized-react-component-library-xyz123 0.1.14 → 0.1.16

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 CHANGED
@@ -298,4 +298,11 @@ interface ValidationErrorSummaryListProps {
298
298
 
299
299
  declare const ValidationErrorSummaryList: React.FC<ValidationErrorSummaryListProps>;
300
300
 
301
- export { 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 };
301
+ interface CookieBannerProps {
302
+ isTouched: any;
303
+ visible?: boolean;
304
+ }
305
+
306
+ declare const CookieBanner: FC<CookieBannerProps>;
307
+
308
+ 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,11 @@ interface ValidationErrorSummaryListProps {
298
298
 
299
299
  declare const ValidationErrorSummaryList: React.FC<ValidationErrorSummaryListProps>;
300
300
 
301
- export { 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 };
301
+ interface CookieBannerProps {
302
+ isTouched: any;
303
+ visible?: boolean;
304
+ }
305
+
306
+ declare const CookieBanner: FC<CookieBannerProps>;
307
+
308
+ 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,
@@ -768,6 +769,7 @@ var FilesUpload = ({
768
769
  var FilesUploadStandard_default = FilesUpload;
769
770
 
770
771
  // src/NewHelpMethodsStandard/QuestionHasValidationError/QuestionHasValidationError.tsx
772
+ var import_date_fns = require("date-fns");
771
773
  var questionHasValidationError = (questionObject, arrayOfQuestionObjects) => {
772
774
  var _a, _b, _c, _d, _e;
773
775
  let error = false;
@@ -800,14 +802,17 @@ var questionHasValidationError = (questionObject, arrayOfQuestionObjects) => {
800
802
  error = true;
801
803
  }
802
804
  const isValidDate = (dateString) => {
803
- return false;
805
+ const date = (0, import_date_fns.parseISO)(dateString);
806
+ return (0, import_date_fns.isValid)(date);
804
807
  };
805
808
  const validDate = isValidDate(questionObject.answer);
806
809
  if (!validDate) {
807
810
  error = true;
808
811
  }
809
812
  }
810
- const groupCheckError = (_e = questionObject.validationType) == null ? void 0 : _e.find((e) => e.startsWith("groupCheck-"));
813
+ const groupCheckError = (_e = questionObject.validationType) == null ? void 0 : _e.find(
814
+ (e) => e.startsWith("groupCheck-")
815
+ );
811
816
  if (groupCheckError) {
812
817
  const ids = groupCheckError.replace("groupCheck-", "").split("-");
813
818
  const relatedAnswers = ids.map(
@@ -2043,8 +2048,62 @@ var ValidationErrorSummaryList = ({
2043
2048
  );
2044
2049
  };
2045
2050
  var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
2051
+
2052
+ // src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
2053
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2054
+ var CookieBanner = ({ isTouched, visible = true }) => {
2055
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: visible && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "pts-cookieBanner", children: [
2056
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { children: "Kakor (cookies)" }),
2057
+ /* @__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 \u201DKakor\u201D l\xE4ngst ned till v\xE4nster p\xE5 webbplatsen." }),
2058
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "pts-cookieBanner-link", children: [
2059
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2060
+ "svg",
2061
+ {
2062
+ width: "27",
2063
+ height: "27",
2064
+ viewBox: "0 0 27 27",
2065
+ fill: "none",
2066
+ xmlns: "http://www.w3.org/2000/svg",
2067
+ children: [
2068
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { width: "27", height: "27", rx: "13.5", fill: "#6E3282" }),
2069
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2070
+ "path",
2071
+ {
2072
+ 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",
2073
+ fill: "white"
2074
+ }
2075
+ )
2076
+ ]
2077
+ }
2078
+ ),
2079
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("a", { href: "www.pts.se", target: "blank", children: "Kakor (cookies) p\xE5 pts.se (\xF6ppnas i ny flik)" })
2080
+ ] }),
2081
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "pts-cookieBanner-buttons", children: [
2082
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2083
+ "button",
2084
+ {
2085
+ onClick: () => {
2086
+ isTouched(true);
2087
+ },
2088
+ children: "Ja, jag samtycker"
2089
+ }
2090
+ ),
2091
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2092
+ "button",
2093
+ {
2094
+ onClick: () => {
2095
+ isTouched(false);
2096
+ },
2097
+ children: "Nej, jag samtycker inte"
2098
+ }
2099
+ )
2100
+ ] })
2101
+ ] }) });
2102
+ };
2103
+ var CookieBanner_default = CookieBanner;
2046
2104
  // Annotate the CommonJS export names for ESM import in node:
2047
2105
  0 && (module.exports = {
2106
+ CookieBanner,
2048
2107
  CreateApiDataObject,
2049
2108
  DoCategoriesAndQuestionsVisible,
2050
2109
  EditPreviewLinkStandard,
package/dist/index.mjs CHANGED
@@ -705,6 +705,7 @@ var FilesUpload = ({
705
705
  var FilesUploadStandard_default = FilesUpload;
706
706
 
707
707
  // src/NewHelpMethodsStandard/QuestionHasValidationError/QuestionHasValidationError.tsx
708
+ import { isValid, parseISO } from "date-fns";
708
709
  var questionHasValidationError = (questionObject, arrayOfQuestionObjects) => {
709
710
  var _a, _b, _c, _d, _e;
710
711
  let error = false;
@@ -737,14 +738,17 @@ var questionHasValidationError = (questionObject, arrayOfQuestionObjects) => {
737
738
  error = true;
738
739
  }
739
740
  const isValidDate = (dateString) => {
740
- return false;
741
+ const date = parseISO(dateString);
742
+ return isValid(date);
741
743
  };
742
744
  const validDate = isValidDate(questionObject.answer);
743
745
  if (!validDate) {
744
746
  error = true;
745
747
  }
746
748
  }
747
- const groupCheckError = (_e = questionObject.validationType) == null ? void 0 : _e.find((e) => e.startsWith("groupCheck-"));
749
+ const groupCheckError = (_e = questionObject.validationType) == null ? void 0 : _e.find(
750
+ (e) => e.startsWith("groupCheck-")
751
+ );
748
752
  if (groupCheckError) {
749
753
  const ids = groupCheckError.replace("groupCheck-", "").split("-");
750
754
  const relatedAnswers = ids.map(
@@ -1980,7 +1984,61 @@ var ValidationErrorSummaryList = ({
1980
1984
  );
1981
1985
  };
1982
1986
  var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
1987
+
1988
+ // src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
1989
+ import { Fragment as Fragment10, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
1990
+ var CookieBanner = ({ isTouched, visible = true }) => {
1991
+ return /* @__PURE__ */ jsx21(Fragment10, { children: visible && /* @__PURE__ */ jsxs19("div", { className: "pts-cookieBanner", children: [
1992
+ /* @__PURE__ */ jsx21("h3", { children: "Kakor (cookies)" }),
1993
+ /* @__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 \u201DKakor\u201D l\xE4ngst ned till v\xE4nster p\xE5 webbplatsen." }),
1994
+ /* @__PURE__ */ jsxs19("div", { className: "pts-cookieBanner-link", children: [
1995
+ /* @__PURE__ */ jsxs19(
1996
+ "svg",
1997
+ {
1998
+ width: "27",
1999
+ height: "27",
2000
+ viewBox: "0 0 27 27",
2001
+ fill: "none",
2002
+ xmlns: "http://www.w3.org/2000/svg",
2003
+ children: [
2004
+ /* @__PURE__ */ jsx21("rect", { width: "27", height: "27", rx: "13.5", fill: "#6E3282" }),
2005
+ /* @__PURE__ */ jsx21(
2006
+ "path",
2007
+ {
2008
+ 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",
2009
+ fill: "white"
2010
+ }
2011
+ )
2012
+ ]
2013
+ }
2014
+ ),
2015
+ /* @__PURE__ */ jsx21("a", { href: "www.pts.se", target: "blank", children: "Kakor (cookies) p\xE5 pts.se (\xF6ppnas i ny flik)" })
2016
+ ] }),
2017
+ /* @__PURE__ */ jsxs19("div", { className: "pts-cookieBanner-buttons", children: [
2018
+ /* @__PURE__ */ jsx21(
2019
+ "button",
2020
+ {
2021
+ onClick: () => {
2022
+ isTouched(true);
2023
+ },
2024
+ children: "Ja, jag samtycker"
2025
+ }
2026
+ ),
2027
+ /* @__PURE__ */ jsx21(
2028
+ "button",
2029
+ {
2030
+ onClick: () => {
2031
+ isTouched(false);
2032
+ },
2033
+ children: "Nej, jag samtycker inte"
2034
+ }
2035
+ )
2036
+ ] })
2037
+ ] }) });
2038
+ };
2039
+ var CookieBanner_default = CookieBanner;
1983
2040
  export {
2041
+ CookieBanner_default as CookieBanner,
1984
2042
  CreateApiDataObject_default as CreateApiDataObject,
1985
2043
  DoCategoriesAndQuestionsVisible_default as DoCategoriesAndQuestionsVisible,
1986
2044
  EditPreviewLinkStandard_default as EditPreviewLinkStandard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "A modern React component library using TypeScript.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -64,6 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "clsx": "^2.1.1",
67
+ "date-fns": "^4.1.0",
67
68
  "dompurify": "^3.2.6"
68
69
  }
69
70
  }