optimized-react-component-library-xyz123 0.1.96 → 0.1.97

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
@@ -467,6 +467,14 @@ declare const toggleScriptByConsent: (consent: boolean, options: {
467
467
  declare const isScriptLoaded: (id: string) => boolean;
468
468
  declare const removeScriptById: (id: string) => void;
469
469
 
470
+ /**
471
+ * Sätter fokus på ett element med givet id (eller HTMLElement),
472
+ * sätter tabindex="-1" om inte redan finns, och scrollar dit smidigt.
473
+ *
474
+ * @param target Elementets id (t.ex. 'main-content') eller själva elementet.
475
+ */
476
+ declare const focusElement: (target: string | HTMLElement | null) => void;
477
+
470
478
  declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
471
479
 
472
480
  declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
@@ -573,4 +581,4 @@ interface CookieBannerProps {
573
581
 
574
582
  declare const CookieBanner: React.FC<CookieBannerProps>;
575
583
 
576
- export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, 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, type LanguageSupportConfig, 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, createCookieConsent, createLanguageSlice, createQuestionsSlice, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
584
+ export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, 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, type LanguageSupportConfig, 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, createCookieConsent, createLanguageSlice, createQuestionsSlice, focusElement, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
package/dist/index.d.ts CHANGED
@@ -467,6 +467,14 @@ declare const toggleScriptByConsent: (consent: boolean, options: {
467
467
  declare const isScriptLoaded: (id: string) => boolean;
468
468
  declare const removeScriptById: (id: string) => void;
469
469
 
470
+ /**
471
+ * Sätter fokus på ett element med givet id (eller HTMLElement),
472
+ * sätter tabindex="-1" om inte redan finns, och scrollar dit smidigt.
473
+ *
474
+ * @param target Elementets id (t.ex. 'main-content') eller själva elementet.
475
+ */
476
+ declare const focusElement: (target: string | HTMLElement | null) => void;
477
+
470
478
  declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
471
479
 
472
480
  declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
@@ -573,4 +581,4 @@ interface CookieBannerProps {
573
581
 
574
582
  declare const CookieBanner: React.FC<CookieBannerProps>;
575
583
 
576
- export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, 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, type LanguageSupportConfig, 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, createCookieConsent, createLanguageSlice, createQuestionsSlice, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
584
+ export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, 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, type LanguageSupportConfig, 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, createCookieConsent, createLanguageSlice, createQuestionsSlice, focusElement, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
package/dist/index.js CHANGED
@@ -63,6 +63,7 @@ __export(index_exports, {
63
63
  createCookieConsent: () => createCookieConsent,
64
64
  createLanguageSlice: () => createLanguageSlice,
65
65
  createQuestionsSlice: () => createQuestionsSlice,
66
+ focusElement: () => focusElement,
66
67
  isScriptLoaded: () => isScriptLoaded,
67
68
  makeLanguageSelectors: () => makeLanguageSelectors,
68
69
  makeQuestionsSelectors: () => makeQuestionsSelectors,
@@ -1901,6 +1902,17 @@ var removeScriptById = (id) => {
1901
1902
  if (el) el.remove();
1902
1903
  };
1903
1904
 
1905
+ // src/NewHelpMethodsStandard/FocusElement/focusElement.ts
1906
+ var focusElement = (target) => {
1907
+ const element = typeof target === "string" ? document.getElementById(target) : target;
1908
+ if (!element) return;
1909
+ if (!element.hasAttribute("tabindex")) {
1910
+ element.setAttribute("tabindex", "-1");
1911
+ }
1912
+ element.focus();
1913
+ element.scrollIntoView({ behavior: "smooth" });
1914
+ };
1915
+
1904
1916
  // src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
1905
1917
  var import_jsx_runtime12 = require("react/jsx-runtime");
1906
1918
  var RenderQuestion = ({
@@ -3194,6 +3206,7 @@ var CookieBanner_default = CookieBanner;
3194
3206
  createCookieConsent,
3195
3207
  createLanguageSlice,
3196
3208
  createQuestionsSlice,
3209
+ focusElement,
3197
3210
  isScriptLoaded,
3198
3211
  makeLanguageSelectors,
3199
3212
  makeQuestionsSelectors,
package/dist/index.mjs CHANGED
@@ -1831,6 +1831,17 @@ var removeScriptById = (id) => {
1831
1831
  if (el) el.remove();
1832
1832
  };
1833
1833
 
1834
+ // src/NewHelpMethodsStandard/FocusElement/focusElement.ts
1835
+ var focusElement = (target) => {
1836
+ const element = typeof target === "string" ? document.getElementById(target) : target;
1837
+ if (!element) return;
1838
+ if (!element.hasAttribute("tabindex")) {
1839
+ element.setAttribute("tabindex", "-1");
1840
+ }
1841
+ element.focus();
1842
+ element.scrollIntoView({ behavior: "smooth" });
1843
+ };
1844
+
1834
1845
  // src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
1835
1846
  import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1836
1847
  var RenderQuestion = ({
@@ -3123,6 +3134,7 @@ export {
3123
3134
  createCookieConsent,
3124
3135
  createLanguageSlice,
3125
3136
  createQuestionsSlice,
3137
+ focusElement,
3126
3138
  isScriptLoaded,
3127
3139
  makeLanguageSelectors,
3128
3140
  makeQuestionsSelectors,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.96",
3
+ "version": "0.1.97",
4
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",