optimized-react-component-library-xyz123 0.1.50 → 0.1.51

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.css CHANGED
@@ -1,7 +1,6 @@
1
1
  /* src/NewInputComponentStandard/RadioMultipleStandard/RadioMultipleStandard.css */
2
2
  /* src/NewInputComponentStandard/MultipleCheckboxesStandard/MultipleCheckboxesStandard.css */
3
3
  /* src/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.css */
4
- /* src/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.css */
5
4
  /* src/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.css */
6
5
  .files-upload {
7
6
  width: 100%;
package/dist/index.d.mts CHANGED
@@ -89,6 +89,9 @@ interface IQuestionExtraAttribute {
89
89
  showTextAreaCounter?: boolean;
90
90
  hideValidationMessage?: boolean;
91
91
  hideTextCounter?: boolean;
92
+ inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
93
+ spellCheck?: boolean;
94
+ autoCapitalize?: string;
92
95
  }
93
96
  interface IStepQuestionData {
94
97
  step: number;
package/dist/index.d.ts CHANGED
@@ -89,6 +89,9 @@ interface IQuestionExtraAttribute {
89
89
  showTextAreaCounter?: boolean;
90
90
  hideValidationMessage?: boolean;
91
91
  hideTextCounter?: boolean;
92
+ inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
93
+ spellCheck?: boolean;
94
+ autoCapitalize?: string;
92
95
  }
93
96
  interface IStepQuestionData {
94
97
  step: number;
package/dist/index.js CHANGED
@@ -78,9 +78,8 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
78
78
  !showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
79
79
  "fieldset",
80
80
  {
81
- role: "radiogroup",
82
- "aria-labelledby": `label-${groupId}`,
83
81
  "aria-invalid": question.hasValidationError,
82
+ "aria-describedby": question.hasValidationError ? errorId : void 0,
84
83
  "aria-errormessage": question.hasValidationError ? errorId : void 0,
85
84
  "aria-required": question.isQuestionMandatory || void 0,
86
85
  children: [
@@ -98,7 +97,8 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
98
97
  id: `${groupId}-option-${index}`,
99
98
  value: option.value,
100
99
  checked: question.answer === option.value,
101
- onChange: handleInputChange
100
+ onChange: handleInputChange,
101
+ required: question.isQuestionMandatory
102
102
  },
103
103
  index
104
104
  ),
@@ -106,8 +106,8 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
106
106
  " "
107
107
  ] }, index)),
108
108
  question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
109
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
110
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-label": "Felmeddelande.", className: "errorText", children: question.validationDefaultMessesege })
109
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
110
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
111
111
  ] })
112
112
  ]
113
113
  }
@@ -165,8 +165,8 @@ var MultipleCheckboxes = ({
165
165
  isTouched(e, question);
166
166
  };
167
167
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
168
- !showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { role: "group", "aria-labelledby": `label-${questionId}`, children: [
169
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h3", { id: `label-${questionId}`, children: [
168
+ !showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("fieldset", { children: [
169
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("legend", { id: `label-${questionId}`, children: [
170
170
  question.questionLabel,
171
171
  " ",
172
172
  question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
@@ -178,17 +178,16 @@ var MultipleCheckboxes = ({
178
178
  "input",
179
179
  {
180
180
  type: "checkbox",
181
- name: `${question.id}-option-${index}`,
181
+ name: `${question.id}-option`,
182
182
  id: `${question.id}-option-${index}`,
183
183
  value: option.label,
184
184
  checked: checkedValues.includes(option.label),
185
185
  onChange: (e) => handleInputChange(e, option.label),
186
186
  className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
187
- },
188
- index
187
+ }
189
188
  ),
190
189
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: `${question.id}-option-${index}`, children: option.label })
191
- ] }) })) })
190
+ ] }) }, index)) })
192
191
  ] }) }),
193
192
  " ",
194
193
  showPreview && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PrevieMultipleCheckboxes, { activatedLanguage, question })
@@ -316,7 +315,7 @@ var TextFieldStandard = ({
316
315
  showPreview = false,
317
316
  activatedLanguage
318
317
  }) => {
319
- var _a, _b, _c, _d, _e, _f, _g;
318
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
320
319
  const questionId = `question-${question.id}`;
321
320
  const inputId = `textField-${question.id}`;
322
321
  const aboutId = `about-${question.id}`;
@@ -349,23 +348,26 @@ var TextFieldStandard = ({
349
348
  {
350
349
  type: (_c = (_b = question.questionExtraAttribute) == null ? void 0 : _b.inputType) != null ? _c : "text",
351
350
  autoComplete: (_e = (_d = question.questionExtraAttribute) == null ? void 0 : _d.autoComplete) != null ? _e : void 0,
351
+ inputMode: (_g = (_f = question.questionExtraAttribute) == null ? void 0 : _f.inputMode) != null ? _g : void 0,
352
352
  name: `question-name-${question.id}`,
353
353
  className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0,
354
354
  onChange: (e) => isTouched(e, question),
355
355
  value: question.answer,
356
- maxLength: ((_f = question.questionExtraAttribute) == null ? void 0 : _f.answerMaxLength) || defaultMaxLength,
356
+ maxLength: ((_h = question.questionExtraAttribute) == null ? void 0 : _h.answerMaxLength) || defaultMaxLength,
357
357
  id: inputId,
358
- disabled: (_g = question.questionExtraAttribute) == null ? void 0 : _g.disabled,
358
+ disabled: (_i = question.questionExtraAttribute) == null ? void 0 : _i.disabled,
359
359
  required: question.isQuestionMandatory,
360
360
  "aria-required": question.isQuestionMandatory,
361
361
  "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
362
362
  "aria-invalid": question.hasValidationError,
363
- "aria-errormessage": question.hasValidationError ? errorId : void 0
363
+ "aria-errormessage": question.hasValidationError ? errorId : void 0,
364
+ spellCheck: (_k = (_j = question.questionExtraAttribute) == null ? void 0 : _j.spellCheck) != null ? _k : void 0,
365
+ autoCapitalize: (_m = (_l = question.questionExtraAttribute) == null ? void 0 : _l.autoCapitalize) != null ? _m : void 0
364
366
  }
365
367
  ),
366
368
  question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
367
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
368
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-label": "Felmeddelande.", className: "errorText", children: question.validationDefaultMessesege })
369
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
370
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
369
371
  ] })
370
372
  ]
371
373
  }
@@ -1731,10 +1733,10 @@ var RenderQuestionGroup = ({
1731
1733
  "fieldset",
1732
1734
  {
1733
1735
  className: "pts-root-question-group-fieldset",
1734
- "aria-required": questionArray[0].isQuestionMandatory,
1735
- "aria-invalid": questionArray[0].hasValidationError,
1736
- "aria-errormessage": questionArray[0].questionId + "-error",
1737
- "aria-describedby": questionArray[0].questionId + "-error",
1736
+ "aria-required": questionArray[0].isQuestionMandatory || void 0,
1737
+ "aria-invalid": questionArray[0].hasValidationError || void 0,
1738
+ "aria-errormessage": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
1739
+ "aria-describedby": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
1738
1740
  children: [
1739
1741
  legend && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("legend", { children: [
1740
1742
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: legend }),
@@ -1743,10 +1745,10 @@ var RenderQuestionGroup = ({
1743
1745
  questionArray[0].validationDefaultMessesege
1744
1746
  ] })
1745
1747
  ] }),
1746
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "pts-root-error", id: questionArray[0].questionId + "-error", children: questionArray[0].hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1747
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
1748
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-label": "Felmeddelande.", className: "errorText", children: questionArray[0].validationDefaultMessesege })
1749
- ] }) }),
1748
+ questionArray[0].hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "pts-root-error", id: questionArray[0].id + "-error", children: [
1749
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
1750
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "errorText", children: questionArray[0].validationDefaultMessesege })
1751
+ ] }),
1750
1752
  questions
1751
1753
  ]
1752
1754
  }
package/dist/index.mjs CHANGED
@@ -13,9 +13,8 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
13
13
  !showPreview && question.visible && /* @__PURE__ */ jsx("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: /* @__PURE__ */ jsxs(
14
14
  "fieldset",
15
15
  {
16
- role: "radiogroup",
17
- "aria-labelledby": `label-${groupId}`,
18
16
  "aria-invalid": question.hasValidationError,
17
+ "aria-describedby": question.hasValidationError ? errorId : void 0,
19
18
  "aria-errormessage": question.hasValidationError ? errorId : void 0,
20
19
  "aria-required": question.isQuestionMandatory || void 0,
21
20
  children: [
@@ -33,7 +32,8 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
33
32
  id: `${groupId}-option-${index}`,
34
33
  value: option.value,
35
34
  checked: question.answer === option.value,
36
- onChange: handleInputChange
35
+ onChange: handleInputChange,
36
+ required: question.isQuestionMandatory
37
37
  },
38
38
  index
39
39
  ),
@@ -41,8 +41,8 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
41
41
  " "
42
42
  ] }, index)),
43
43
  question.hasValidationError && /* @__PURE__ */ jsxs("div", { className: "pts-root-error", id: errorId, children: [
44
- /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
45
- /* @__PURE__ */ jsx("span", { "aria-label": "Felmeddelande.", className: "errorText", children: question.validationDefaultMessesege })
44
+ /* @__PURE__ */ jsx("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
45
+ /* @__PURE__ */ jsx("span", { className: "errorText", children: question.validationDefaultMessesege })
46
46
  ] })
47
47
  ]
48
48
  }
@@ -100,8 +100,8 @@ var MultipleCheckboxes = ({
100
100
  isTouched(e, question);
101
101
  };
102
102
  return /* @__PURE__ */ jsxs2(Fragment2, { children: [
103
- !showPreview && question.visible && /* @__PURE__ */ jsx2("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs2("section", { role: "group", "aria-labelledby": `label-${questionId}`, children: [
104
- /* @__PURE__ */ jsxs2("h3", { id: `label-${questionId}`, children: [
103
+ !showPreview && question.visible && /* @__PURE__ */ jsx2("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs2("fieldset", { children: [
104
+ /* @__PURE__ */ jsxs2("legend", { id: `label-${questionId}`, children: [
105
105
  question.questionLabel,
106
106
  " ",
107
107
  question.isQuestionMandatory && /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
@@ -113,17 +113,16 @@ var MultipleCheckboxes = ({
113
113
  "input",
114
114
  {
115
115
  type: "checkbox",
116
- name: `${question.id}-option-${index}`,
116
+ name: `${question.id}-option`,
117
117
  id: `${question.id}-option-${index}`,
118
118
  value: option.label,
119
119
  checked: checkedValues.includes(option.label),
120
120
  onChange: (e) => handleInputChange(e, option.label),
121
121
  className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
122
- },
123
- index
122
+ }
124
123
  ),
125
124
  /* @__PURE__ */ jsx2("label", { htmlFor: `${question.id}-option-${index}`, children: option.label })
126
- ] }) })) })
125
+ ] }) }, index)) })
127
126
  ] }) }),
128
127
  " ",
129
128
  showPreview && /* @__PURE__ */ jsx2(PrevieMultipleCheckboxes, { activatedLanguage, question })
@@ -251,7 +250,7 @@ var TextFieldStandard = ({
251
250
  showPreview = false,
252
251
  activatedLanguage
253
252
  }) => {
254
- var _a, _b, _c, _d, _e, _f, _g;
253
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
255
254
  const questionId = `question-${question.id}`;
256
255
  const inputId = `textField-${question.id}`;
257
256
  const aboutId = `about-${question.id}`;
@@ -284,23 +283,26 @@ var TextFieldStandard = ({
284
283
  {
285
284
  type: (_c = (_b = question.questionExtraAttribute) == null ? void 0 : _b.inputType) != null ? _c : "text",
286
285
  autoComplete: (_e = (_d = question.questionExtraAttribute) == null ? void 0 : _d.autoComplete) != null ? _e : void 0,
286
+ inputMode: (_g = (_f = question.questionExtraAttribute) == null ? void 0 : _f.inputMode) != null ? _g : void 0,
287
287
  name: `question-name-${question.id}`,
288
288
  className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0,
289
289
  onChange: (e) => isTouched(e, question),
290
290
  value: question.answer,
291
- maxLength: ((_f = question.questionExtraAttribute) == null ? void 0 : _f.answerMaxLength) || defaultMaxLength,
291
+ maxLength: ((_h = question.questionExtraAttribute) == null ? void 0 : _h.answerMaxLength) || defaultMaxLength,
292
292
  id: inputId,
293
- disabled: (_g = question.questionExtraAttribute) == null ? void 0 : _g.disabled,
293
+ disabled: (_i = question.questionExtraAttribute) == null ? void 0 : _i.disabled,
294
294
  required: question.isQuestionMandatory,
295
295
  "aria-required": question.isQuestionMandatory,
296
296
  "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
297
297
  "aria-invalid": question.hasValidationError,
298
- "aria-errormessage": question.hasValidationError ? errorId : void 0
298
+ "aria-errormessage": question.hasValidationError ? errorId : void 0,
299
+ spellCheck: (_k = (_j = question.questionExtraAttribute) == null ? void 0 : _j.spellCheck) != null ? _k : void 0,
300
+ autoCapitalize: (_m = (_l = question.questionExtraAttribute) == null ? void 0 : _l.autoCapitalize) != null ? _m : void 0
299
301
  }
300
302
  ),
301
303
  question.hasValidationError && /* @__PURE__ */ jsxs4("div", { className: "pts-root-error", id: errorId, children: [
302
- /* @__PURE__ */ jsx4("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
303
- /* @__PURE__ */ jsx4("span", { "aria-label": "Felmeddelande.", className: "errorText", children: question.validationDefaultMessesege })
304
+ /* @__PURE__ */ jsx4("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
305
+ /* @__PURE__ */ jsx4("span", { className: "errorText", children: question.validationDefaultMessesege })
304
306
  ] })
305
307
  ]
306
308
  }
@@ -1666,10 +1668,10 @@ var RenderQuestionGroup = ({
1666
1668
  "fieldset",
1667
1669
  {
1668
1670
  className: "pts-root-question-group-fieldset",
1669
- "aria-required": questionArray[0].isQuestionMandatory,
1670
- "aria-invalid": questionArray[0].hasValidationError,
1671
- "aria-errormessage": questionArray[0].questionId + "-error",
1672
- "aria-describedby": questionArray[0].questionId + "-error",
1671
+ "aria-required": questionArray[0].isQuestionMandatory || void 0,
1672
+ "aria-invalid": questionArray[0].hasValidationError || void 0,
1673
+ "aria-errormessage": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
1674
+ "aria-describedby": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
1673
1675
  children: [
1674
1676
  legend && /* @__PURE__ */ jsxs12("legend", { children: [
1675
1677
  /* @__PURE__ */ jsx13("span", { children: legend }),
@@ -1678,10 +1680,10 @@ var RenderQuestionGroup = ({
1678
1680
  questionArray[0].validationDefaultMessesege
1679
1681
  ] })
1680
1682
  ] }),
1681
- /* @__PURE__ */ jsx13("div", { className: "pts-root-error", id: questionArray[0].questionId + "-error", children: questionArray[0].hasValidationError && /* @__PURE__ */ jsxs12(Fragment13, { children: [
1682
- /* @__PURE__ */ jsx13("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
1683
- /* @__PURE__ */ jsx13("span", { "aria-label": "Felmeddelande.", className: "errorText", children: questionArray[0].validationDefaultMessesege })
1684
- ] }) }),
1683
+ questionArray[0].hasValidationError && /* @__PURE__ */ jsxs12("div", { className: "pts-root-error", id: questionArray[0].id + "-error", children: [
1684
+ /* @__PURE__ */ jsx13("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
1685
+ /* @__PURE__ */ jsx13("span", { className: "errorText", children: questionArray[0].validationDefaultMessesege })
1686
+ ] }),
1685
1687
  questions
1686
1688
  ]
1687
1689
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
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",