@riverty/web-components 5.7.0 → 6.0.0

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.
Files changed (273) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/custom-elements.json +152 -372
  3. package/dist/cjs/index-DJ4H_bFj.js +6 -10
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/r-accordion-panel.cjs.entry.js +1 -1
  6. package/dist/cjs/r-accordion-section.cjs.entry.js +1 -1
  7. package/dist/cjs/r-accordion-trigger.cjs.entry.js +5 -35
  8. package/dist/cjs/r-accordion.cjs.entry.js +3 -7
  9. package/dist/cjs/r-alert.cjs.entry.js +45 -14
  10. package/dist/cjs/r-badge.cjs.entry.js +1 -1
  11. package/dist/cjs/r-button.cjs.entry.js +2 -2
  12. package/dist/cjs/r-checkbox-group.cjs.entry.js +28 -24
  13. package/dist/cjs/r-checkbox.cjs.entry.js +97 -81
  14. package/dist/cjs/r-dialog.cjs.entry.js +3 -11
  15. package/dist/cjs/r-hint_2.cjs.entry.js +50 -0
  16. package/dist/cjs/{r-hint_3.cjs.entry.js → r-icon-button_2.cjs.entry.js} +64 -51
  17. package/dist/cjs/r-icon.cjs.entry.js +1 -1
  18. package/dist/cjs/r-input-code.cjs.entry.js +133 -25
  19. package/dist/cjs/r-input-date.cjs.entry.js +87 -23
  20. package/dist/cjs/r-input-password.cjs.entry.js +34 -13
  21. package/dist/cjs/r-input-phone-number.cjs.entry.js +30 -22
  22. package/dist/cjs/r-input.cjs.entry.js +108 -49
  23. package/dist/cjs/r-list-item.cjs.entry.js +5 -5
  24. package/dist/cjs/r-pagination.cjs.entry.js +1 -1
  25. package/dist/cjs/r-panel.cjs.entry.js +2 -2
  26. package/dist/cjs/r-popover-action.cjs.entry.js +2 -2
  27. package/dist/cjs/r-popover-content.cjs.entry.js +1 -1
  28. package/dist/cjs/r-popover-headline.cjs.entry.js +1 -1
  29. package/dist/cjs/r-popover-trigger.cjs.entry.js +1 -1
  30. package/dist/cjs/r-popover.cjs.entry.js +3 -3
  31. package/dist/cjs/r-progress-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/r-radio-button-description.cjs.entry.js +1 -1
  33. package/dist/cjs/r-radio-button-leading.cjs.entry.js +1 -1
  34. package/dist/cjs/r-radio-button-title.cjs.entry.js +1 -1
  35. package/dist/cjs/r-radio-button-trailing.cjs.entry.js +1 -1
  36. package/dist/cjs/r-radio-button.cjs.entry.js +29 -12
  37. package/dist/cjs/r-radio-group.cjs.entry.js +32 -32
  38. package/dist/cjs/r-select-option.cjs.entry.js +1 -1
  39. package/dist/cjs/r-select.cjs.entry.js +116 -40
  40. package/dist/cjs/r-skip-link.cjs.entry.js +1 -1
  41. package/dist/cjs/r-stepper-item.cjs.entry.js +2 -2
  42. package/dist/cjs/r-stepper.cjs.entry.js +1 -1
  43. package/dist/cjs/r-tab-panel.cjs.entry.js +1 -1
  44. package/dist/cjs/r-tab.cjs.entry.js +1 -1
  45. package/dist/cjs/r-tabs-list.cjs.entry.js +1 -1
  46. package/dist/cjs/r-tabs.cjs.entry.js +1 -1
  47. package/dist/cjs/r-textarea.cjs.entry.js +24 -23
  48. package/dist/cjs/r-toast-group.cjs.entry.js +1 -1
  49. package/dist/cjs/r-toast.cjs.entry.js +51 -20
  50. package/dist/cjs/web-components.cjs.js +1 -1
  51. package/dist/collection/collection-manifest.json +0 -1
  52. package/dist/collection/components/accordion/accordion.css +0 -2
  53. package/dist/collection/components/accordion/accordion.js +4 -8
  54. package/dist/collection/components/accordion/exports.js +1 -1
  55. package/dist/collection/components/accordion-panel/accordion-panel.js +1 -1
  56. package/dist/collection/components/accordion-section/accordion-section.js +1 -1
  57. package/dist/collection/components/accordion-trigger/accordion-trigger.css +0 -4
  58. package/dist/collection/components/accordion-trigger/accordion-trigger.js +4 -215
  59. package/dist/collection/components/alert/alert.css +58 -12
  60. package/dist/collection/components/alert/alert.js +92 -17
  61. package/dist/collection/components/alert/exports.js +1 -1
  62. package/dist/collection/components/badge/badge.js +1 -1
  63. package/dist/collection/components/button/button.css +6 -7
  64. package/dist/collection/components/button/button.js +1 -1
  65. package/dist/collection/components/checkbox/checkbox.js +121 -104
  66. package/dist/collection/components/checkbox-group/checkbox-group.js +48 -63
  67. package/dist/collection/components/dialog/dialog.css +1 -3
  68. package/dist/collection/components/dialog/dialog.js +2 -10
  69. package/dist/collection/components/hint/hint.js +2 -2
  70. package/dist/collection/components/icon/bundled-icons/riverty-kit.json +1 -1
  71. package/dist/collection/components/icon/riverty-kit.js +1 -1
  72. package/dist/collection/components/icon-button/icon-button.css +0 -7
  73. package/dist/collection/components/icon-button/icon-button.js +3 -3
  74. package/dist/collection/components/input/input.css +3 -0
  75. package/dist/collection/components/input/input.js +221 -378
  76. package/dist/collection/components/input-code/exports.js +2 -0
  77. package/dist/collection/components/input-code/input-code.js +335 -34
  78. package/dist/collection/components/input-date/input-date.js +237 -87
  79. package/dist/collection/components/input-password/exports.js +1 -0
  80. package/dist/collection/components/input-password/input-password.css +1 -0
  81. package/dist/collection/components/input-password/input-password.js +233 -75
  82. package/dist/collection/components/input-phone-number/input-phone-number.js +50 -85
  83. package/dist/collection/components/label/label.js +3 -113
  84. package/dist/collection/components/list-item/list-item/list-item.css +7 -7
  85. package/dist/collection/components/list-item/list-item/list-item.js +4 -26
  86. package/dist/collection/components/pagination/pagination.css +23 -23
  87. package/dist/collection/components/panel/panel.js +2 -2
  88. package/dist/collection/components/popover/exports.js +0 -1
  89. package/dist/collection/components/popover/popover.css +13 -13
  90. package/dist/collection/components/popover/popover.js +2 -55
  91. package/dist/collection/components/popover-action/popover-action.css +3 -5
  92. package/dist/collection/components/popover-action/popover-action.js +1 -1
  93. package/dist/collection/components/popover-content/popover-content.js +1 -1
  94. package/dist/collection/components/popover-headline/popover-headline.js +1 -1
  95. package/dist/collection/components/popover-trigger/popover-trigger.js +1 -1
  96. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  97. package/dist/collection/components/radio-button/radio-button.js +49 -12
  98. package/dist/collection/components/radio-button-description/radio-button-description.js +1 -1
  99. package/dist/collection/components/radio-button-leading/radio-button-leading.js +1 -1
  100. package/dist/collection/components/radio-button-title/radio-button-title.js +1 -1
  101. package/dist/collection/components/radio-button-trailing/radio-button-trailing.js +1 -1
  102. package/dist/collection/components/radio-group/radio-group.js +53 -135
  103. package/dist/collection/components/select/select.js +197 -349
  104. package/dist/collection/components/select-option/select-option.js +1 -1
  105. package/dist/collection/components/skip-link/skip-link.js +1 -1
  106. package/dist/collection/components/stepper/stepper.js +1 -1
  107. package/dist/collection/components/stepper-item/stepper-item.js +2 -2
  108. package/dist/collection/components/tab/tab.js +1 -1
  109. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  110. package/dist/collection/components/tabs/tabs.js +1 -1
  111. package/dist/collection/components/tabs-list/tabs-list.js +1 -1
  112. package/dist/collection/components/textarea/textarea.js +44 -163
  113. package/dist/collection/components/toast/toast.css +22 -14
  114. package/dist/collection/components/toast/toast.js +95 -43
  115. package/dist/collection/components/toast-group/toast-group.js +1 -1
  116. package/dist/collection/components/tooltip/tooltip.js +1 -1
  117. package/dist/esm/index-Da7qOBFr.js +6 -10
  118. package/dist/esm/loader.js +1 -1
  119. package/dist/esm/r-accordion-panel.entry.js +1 -1
  120. package/dist/esm/r-accordion-section.entry.js +1 -1
  121. package/dist/esm/r-accordion-trigger.entry.js +5 -35
  122. package/dist/esm/r-accordion.entry.js +3 -7
  123. package/dist/esm/r-alert.entry.js +45 -14
  124. package/dist/esm/r-badge.entry.js +1 -1
  125. package/dist/esm/r-button.entry.js +2 -2
  126. package/dist/esm/r-checkbox-group.entry.js +28 -24
  127. package/dist/esm/r-checkbox.entry.js +97 -81
  128. package/dist/esm/r-dialog.entry.js +3 -11
  129. package/dist/esm/r-hint_2.entry.js +47 -0
  130. package/dist/esm/{r-hint_3.entry.js → r-icon-button_2.entry.js} +65 -51
  131. package/dist/esm/r-icon.entry.js +1 -1
  132. package/dist/esm/r-input-code.entry.js +133 -25
  133. package/dist/esm/r-input-date.entry.js +87 -23
  134. package/dist/esm/r-input-password.entry.js +34 -13
  135. package/dist/esm/r-input-phone-number.entry.js +30 -22
  136. package/dist/esm/r-input.entry.js +108 -49
  137. package/dist/esm/r-list-item.entry.js +5 -5
  138. package/dist/esm/r-pagination.entry.js +1 -1
  139. package/dist/esm/r-panel.entry.js +2 -2
  140. package/dist/esm/r-popover-action.entry.js +2 -2
  141. package/dist/esm/r-popover-content.entry.js +1 -1
  142. package/dist/esm/r-popover-headline.entry.js +1 -1
  143. package/dist/esm/r-popover-trigger.entry.js +1 -1
  144. package/dist/esm/r-popover.entry.js +3 -3
  145. package/dist/esm/r-progress-bar.entry.js +1 -1
  146. package/dist/esm/r-radio-button-description.entry.js +1 -1
  147. package/dist/esm/r-radio-button-leading.entry.js +1 -1
  148. package/dist/esm/r-radio-button-title.entry.js +1 -1
  149. package/dist/esm/r-radio-button-trailing.entry.js +1 -1
  150. package/dist/esm/r-radio-button.entry.js +29 -12
  151. package/dist/esm/r-radio-group.entry.js +32 -32
  152. package/dist/esm/r-select-option.entry.js +1 -1
  153. package/dist/esm/r-select.entry.js +116 -40
  154. package/dist/esm/r-skip-link.entry.js +1 -1
  155. package/dist/esm/r-stepper-item.entry.js +2 -2
  156. package/dist/esm/r-stepper.entry.js +1 -1
  157. package/dist/esm/r-tab-panel.entry.js +1 -1
  158. package/dist/esm/r-tab.entry.js +1 -1
  159. package/dist/esm/r-tabs-list.entry.js +1 -1
  160. package/dist/esm/r-tabs.entry.js +1 -1
  161. package/dist/esm/r-textarea.entry.js +24 -23
  162. package/dist/esm/r-toast-group.entry.js +1 -1
  163. package/dist/esm/r-toast.entry.js +51 -20
  164. package/dist/esm/web-components.js +1 -1
  165. package/dist/types/components/accordion/accordion.d.ts +1 -5
  166. package/dist/types/components/accordion/exports.d.ts +1 -1
  167. package/dist/types/components/accordion-trigger/accordion-trigger.d.ts +0 -36
  168. package/dist/types/components/alert/alert.d.ts +9 -1
  169. package/dist/types/components/alert/exports.d.ts +1 -1
  170. package/dist/types/components/checkbox/checkbox.d.ts +29 -34
  171. package/dist/types/components/checkbox-group/checkbox-group.d.ts +6 -11
  172. package/dist/types/components/dialog/dialog.d.ts +0 -2
  173. package/dist/types/components/input/input.d.ts +35 -72
  174. package/dist/types/components/input-code/exports.d.ts +4 -0
  175. package/dist/types/components/input-code/input-code.d.ts +54 -7
  176. package/dist/types/components/input-date/input-date.d.ts +30 -16
  177. package/dist/types/components/input-password/exports.d.ts +1 -0
  178. package/dist/types/components/input-password/input-password.d.ts +53 -16
  179. package/dist/types/components/input-phone-number/input-phone-number.d.ts +5 -16
  180. package/dist/types/components/label/label.d.ts +0 -18
  181. package/dist/types/components/list-item/list-item/list-item.d.ts +0 -6
  182. package/dist/types/components/popover/exports.d.ts +0 -2
  183. package/dist/types/components/popover/popover.d.ts +1 -14
  184. package/dist/types/components/radio-button/radio-button.d.ts +5 -0
  185. package/dist/types/components/radio-group/radio-group.d.ts +6 -28
  186. package/dist/types/components/select/select.d.ts +34 -52
  187. package/dist/types/components/textarea/textarea.d.ts +5 -32
  188. package/dist/types/components/toast/toast.d.ts +10 -7
  189. package/dist/types/components.d.ts +347 -647
  190. package/dist/web-components/bundled-icons/riverty-kit.json +1 -1
  191. package/dist/web-components/p-0347feff.entry.js +1 -0
  192. package/dist/web-components/p-05738503.entry.js +1 -0
  193. package/dist/web-components/p-0e4c8bf1.entry.js +1 -0
  194. package/dist/web-components/p-1da75540.entry.js +1 -0
  195. package/dist/web-components/p-26ef77d6.entry.js +1 -0
  196. package/dist/web-components/p-3884c6e7.entry.js +1 -0
  197. package/dist/web-components/p-3a5a67e7.entry.js +1 -0
  198. package/dist/web-components/p-3f60c6c0.entry.js +1 -0
  199. package/dist/web-components/p-4254a383.entry.js +1 -0
  200. package/dist/web-components/{p-87f39749.entry.js → p-4595fa8e.entry.js} +1 -1
  201. package/dist/web-components/{p-4e3df002.entry.js → p-4cc58c6a.entry.js} +1 -1
  202. package/dist/web-components/p-5441b746.entry.js +1 -0
  203. package/dist/web-components/{p-72fa1fd1.entry.js → p-550e2237.entry.js} +1 -1
  204. package/dist/web-components/p-589baaf9.entry.js +1 -0
  205. package/dist/web-components/p-60341de2.entry.js +1 -0
  206. package/dist/web-components/{p-4bd3e077.entry.js → p-60ca994e.entry.js} +1 -1
  207. package/dist/web-components/{p-44ae9f33.entry.js → p-62b788bf.entry.js} +1 -1
  208. package/dist/web-components/{p-2b2f581a.entry.js → p-6303b9fe.entry.js} +1 -1
  209. package/dist/web-components/p-63fd817d.entry.js +1 -0
  210. package/dist/web-components/{p-e0e2f2b2.entry.js → p-673dbfd0.entry.js} +1 -1
  211. package/dist/web-components/p-67fa3f84.entry.js +1 -0
  212. package/dist/web-components/p-6a4f3836.entry.js +1 -0
  213. package/dist/web-components/p-6cc2ea2c.entry.js +1 -0
  214. package/dist/web-components/p-70784685.entry.js +1 -0
  215. package/dist/web-components/{p-429213ea.entry.js → p-7fed6f4d.entry.js} +1 -1
  216. package/dist/web-components/p-8a66d20c.entry.js +1 -0
  217. package/dist/web-components/{p-0bb04d79.entry.js → p-8b4d2448.entry.js} +1 -1
  218. package/dist/web-components/{p-c7f8e59b.entry.js → p-8c31cbd5.entry.js} +1 -1
  219. package/dist/web-components/p-8dac326b.entry.js +1 -0
  220. package/dist/web-components/{p-1c2497de.entry.js → p-9ef1bbee.entry.js} +1 -1
  221. package/dist/web-components/p-a0dbde7c.entry.js +1 -0
  222. package/dist/web-components/{p-755cc697.entry.js → p-a71485d8.entry.js} +1 -1
  223. package/dist/web-components/p-a7d22c76.entry.js +1 -0
  224. package/dist/web-components/{p-85a9af42.entry.js → p-ae251d2f.entry.js} +1 -1
  225. package/dist/web-components/{p-77155630.entry.js → p-b98ab649.entry.js} +1 -1
  226. package/dist/web-components/p-b9e3b3d6.entry.js +1 -0
  227. package/dist/web-components/p-c1e748f2.entry.js +1 -0
  228. package/dist/web-components/p-c478712b.entry.js +1 -0
  229. package/dist/web-components/{p-72c0c0d8.entry.js → p-d054eb4d.entry.js} +1 -1
  230. package/dist/web-components/p-d433a828.entry.js +1 -0
  231. package/dist/web-components/p-d7726e46.entry.js +1 -0
  232. package/dist/web-components/p-d819c8e5.entry.js +1 -0
  233. package/dist/web-components/p-e2188953.entry.js +1 -0
  234. package/dist/web-components/{p-3b4e3faf.entry.js → p-e5945c01.entry.js} +1 -1
  235. package/dist/web-components/{p-d1379ac6.entry.js → p-f9d5004c.entry.js} +1 -1
  236. package/dist/web-components/web-components.esm.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/cjs/r-accordion-item.cjs.entry.js +0 -78
  239. package/dist/cjs/r-icon-button.cjs.entry.js +0 -81
  240. package/dist/collection/components/accordion-item/accordion-item.css +0 -121
  241. package/dist/collection/components/accordion-item/accordion-item.js +0 -138
  242. package/dist/esm/r-accordion-item.entry.js +0 -76
  243. package/dist/esm/r-icon-button.entry.js +0 -79
  244. package/dist/types/components/accordion-item/accordion-item.d.ts +0 -26
  245. package/dist/web-components/p-00ca474f.entry.js +0 -1
  246. package/dist/web-components/p-289eb4b0.entry.js +0 -1
  247. package/dist/web-components/p-2b8e12ae.entry.js +0 -1
  248. package/dist/web-components/p-2e2c8a5b.entry.js +0 -1
  249. package/dist/web-components/p-3a39932b.entry.js +0 -1
  250. package/dist/web-components/p-3bc93d65.entry.js +0 -1
  251. package/dist/web-components/p-44be9992.entry.js +0 -1
  252. package/dist/web-components/p-4652635a.entry.js +0 -1
  253. package/dist/web-components/p-51a5804b.entry.js +0 -1
  254. package/dist/web-components/p-63474b32.entry.js +0 -1
  255. package/dist/web-components/p-74d2a563.entry.js +0 -1
  256. package/dist/web-components/p-7ad8e78b.entry.js +0 -1
  257. package/dist/web-components/p-8028c2a9.entry.js +0 -1
  258. package/dist/web-components/p-96ddeb7f.entry.js +0 -1
  259. package/dist/web-components/p-9d898089.entry.js +0 -1
  260. package/dist/web-components/p-9e50120b.entry.js +0 -1
  261. package/dist/web-components/p-9eb1f262.entry.js +0 -1
  262. package/dist/web-components/p-a022f356.entry.js +0 -1
  263. package/dist/web-components/p-a7e7f8fa.entry.js +0 -1
  264. package/dist/web-components/p-b2f03016.entry.js +0 -1
  265. package/dist/web-components/p-c300c22f.entry.js +0 -1
  266. package/dist/web-components/p-c937bd92.entry.js +0 -1
  267. package/dist/web-components/p-cbcd7699.entry.js +0 -1
  268. package/dist/web-components/p-d93c240d.entry.js +0 -1
  269. package/dist/web-components/p-e4b66277.entry.js +0 -1
  270. package/dist/web-components/p-e6a31881.entry.js +0 -1
  271. package/dist/web-components/p-f6a92287.entry.js +0 -1
  272. package/dist/web-components/p-f770e22b.entry.js +0 -1
  273. package/dist/web-components/p-f952161b.entry.js +0 -1
@@ -12,24 +12,19 @@ export class RInput {
12
12
  */
13
13
  this.value = '';
14
14
  /**
15
- * @deprecated Will be removed November 2025.
16
- * Position of legacy icon: `start` | `end`.
17
- */
18
- this.iconPosition = 'start';
19
- /**
20
- * @deprecated Will be removed November 2025.
21
- * Legacy boolean to show a validation marker icon.
22
- */
23
- this.validMarker = false;
24
- /**
25
- * @deprecated Will be removed November 2025.
26
- * Icon name used when `validMarker` is active and state is valid.
27
- */
28
- this.validMarkerIcon = 'circled-check';
15
+ * When `true` field renders valid/invalid marker within.
16
+ */
17
+ this.validityMarker = true;
29
18
  /** Validity state passed from validateFormElement function after validation */
30
19
  this.validityState = '';
31
20
  /** Validity message passed from validateFormElement function after validation */
32
21
  this.validityMessage = '';
22
+ /** Defines if the component has been touched by user */
23
+ this.touched = false;
24
+ /** Defines if the value has been changed by user interaction */
25
+ this.dirty = false;
26
+ /** Private flag to prevent validation during reset */
27
+ this.isResetting = false;
33
28
  this.nativeElement = null;
34
29
  this.uniqueId = `r-input-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
35
30
  /**
@@ -37,16 +32,29 @@ export class RInput {
37
32
  * */
38
33
  this.initial = {};
39
34
  this.getValidityStateData = (element) => {
35
+ let validityState = '';
36
+ let validityMessage = '';
37
+ if (this.type === 'email' && this.pattern) {
38
+ element.setCustomValidity('');
39
+ validityState = this.validEmailPattern ? 'valid' : 'patternMismatch';
40
+ validityMessage = this.validEmailPattern ? '' : this.patternMismatchMessage;
41
+ return { validityState, validityMessage };
42
+ }
40
43
  for (const state in element.validity) {
41
44
  if (element.validity[state]) {
42
- this.validityState = state;
43
- if (this[state + 'Message']) {
44
- this.validityMessage = this[state + 'Message'];
45
- return;
45
+ validityState = state;
46
+ const customMessage = this[state + 'Message'];
47
+ if (customMessage) {
48
+ validityMessage = customMessage;
49
+ return { validityState, validityMessage };
46
50
  }
47
- this.validityMessage = element.validationMessage;
51
+ validityMessage = element.validationMessage;
52
+ // Found an error, use it even if no custom message
53
+ return { validityState, validityMessage };
48
54
  }
49
55
  }
56
+ // No errors found, field is valid
57
+ return { validityState: 'valid', validityMessage: '' };
50
58
  };
51
59
  this.validateFormElement = (element) => {
52
60
  if (element === null)
@@ -55,13 +63,13 @@ export class RInput {
55
63
  return;
56
64
  if (this.error)
57
65
  return;
58
- if (this.type === 'email' && this.pattern) {
59
- element.setCustomValidity('');
60
- this.validityState = this.validEmailPattern ? 'valid' : 'patternMismatch';
61
- this.validityMessage = this.validEmailPattern ? '' : this.patternMismatchMessage;
66
+ // Trigger browser validation to populate validity states
67
+ if (element.checkValidity) {
68
+ element.checkValidity();
62
69
  }
63
- else
64
- this.getValidityStateData(element);
70
+ const { validityState, validityMessage } = this.getValidityStateData(element);
71
+ this.validityState = validityState;
72
+ this.validityMessage = validityMessage;
65
73
  const isValid = this.validityState === 'valid';
66
74
  this.valid = isValid;
67
75
  this.invalid = !isValid;
@@ -74,6 +82,8 @@ export class RInput {
74
82
  if (this.readonly)
75
83
  return;
76
84
  this.value = event.target.value;
85
+ this.touched = true;
86
+ this.dirty = true;
77
87
  const { host, value } = this;
78
88
  this.rInput.emit({ element: host, value });
79
89
  };
@@ -81,11 +91,14 @@ export class RInput {
81
91
  if (this.readonly)
82
92
  return;
83
93
  this.value = event.target.value;
94
+ this.touched = true;
95
+ this.dirty = true;
84
96
  const { host, value } = this;
85
97
  this.rChange.emit({ element: host, value });
86
98
  };
87
99
  this.onBlur = () => {
88
100
  this.host.classList.remove('focused');
101
+ this.touched = true;
89
102
  this.validateFormElement(this.nativeElement);
90
103
  this.rBlur.emit();
91
104
  };
@@ -99,17 +112,25 @@ export class RInput {
99
112
  this.onResetForm = () => {
100
113
  if (this.readonly)
101
114
  return;
115
+ this.isResetting = true;
116
+ this.markAsPristine();
102
117
  this.validityState = null;
103
118
  this.validityMessage = null;
104
- this.setValue(this.initial['value']);
119
+ // Restore initial value without triggering validation
120
+ if (this.nativeElement) {
121
+ this.nativeElement.value = this.initial['value'] || '';
122
+ }
123
+ this.value = this.initial['value'];
105
124
  this.invalid = this.initial['invalid'];
106
125
  this.valid = !this.invalid;
126
+ this.isResetting = false;
107
127
  const { host, value } = this;
108
128
  this.rReset.emit({ element: host, value });
109
129
  };
110
130
  this.onSubmitForm = (event) => {
111
131
  if (this.isNoValidate)
112
132
  return;
133
+ this.touched = true;
113
134
  this.validateFormElement(this.nativeElement);
114
135
  if (this.invalid) {
115
136
  event.preventDefault();
@@ -193,9 +214,39 @@ export class RInput {
193
214
  * Set the current value programmatically (does not fire native input/change automatically).
194
215
  */
195
216
  async setValue(value) {
196
- this.nativeElement.value = value;
217
+ if (this.nativeElement) {
218
+ this.nativeElement.value = value;
219
+ }
220
+ this.value = value;
197
221
  this.validateFormElement(this.nativeElement);
198
222
  }
223
+ /**
224
+ * Validates the input without triggering UI and returns a boolean indicating its validity.
225
+ * @returns A boolean indicating whether the input is valid.
226
+ */
227
+ async checkValidity() {
228
+ const { validityState } = this.getValidityStateData(this.nativeElement);
229
+ return validityState === 'valid';
230
+ }
231
+ /**
232
+ * Gets the touched state (whether user has interacted with the input)
233
+ */
234
+ async isTouched() {
235
+ return this.touched;
236
+ }
237
+ /**
238
+ * Gets the dirty state (whether value has been changed by user)
239
+ */
240
+ async isDirty() {
241
+ return this.dirty;
242
+ }
243
+ /**
244
+ * Resets touched and dirty states to pristine (untouched/clean)
245
+ */
246
+ async markAsPristine() {
247
+ this.touched = false;
248
+ this.dirty = false;
249
+ }
199
250
  /** Identify wrapping form element */
200
251
  get parentFormEl() {
201
252
  return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
@@ -211,11 +262,8 @@ export class RInput {
211
262
  get hasValidationError() {
212
263
  return (this.validityState !== 'valid' || this.invalid) && !!(this.validityMessage || this.customErrorMessage);
213
264
  }
214
- get hasValidationSuccess() {
215
- return (this.validityState === 'valid' || this.valid) && !!this.validMessage && this.showValid;
216
- }
217
265
  get hasMessage() {
218
- return this.hasError || this.hasValidationError || this.hasValidationSuccess;
266
+ return this.hasError || this.hasValidationError;
219
267
  }
220
268
  /**
221
269
  * Determine whether this element should be ignored
@@ -259,10 +307,15 @@ export class RInput {
259
307
  this.disconnectFormEventListeners();
260
308
  }
261
309
  handleValueChange() {
262
- this.validateFormElement(this.nativeElement);
310
+ if (!this.isResetting) {
311
+ this.validateFormElement(this.nativeElement);
312
+ }
313
+ }
314
+ handleTypeChange() {
315
+ this.setValue(this.nativeElement.value);
263
316
  }
264
317
  render() {
265
- const { name, placeholder, required, fieldIndicator, maxlength, minlength, min, max, value, disabled, form, pattern, invalid, valid, validMarker, hint, label, internal, tooltip, tooltipIcon, tooltipIconColor, uniqueId, autocomplete, readonly, autofocus } = this;
318
+ const { name, placeholder, required, fieldIndicator, maxlength, minlength, min, max, value, disabled, form, pattern, invalid, valid, hint, label, internal, uniqueId, autocomplete, readonly, autofocus, passwordrules, validityMarker } = this;
266
319
  const inputAttrs = {
267
320
  disabled,
268
321
  readonly,
@@ -278,6 +331,7 @@ export class RInput {
278
331
  pattern,
279
332
  autocomplete,
280
333
  autofocus: autofocus || null,
334
+ passwordrules,
281
335
  id: uniqueId,
282
336
  'data-value': value,
283
337
  'aria-placeholder': placeholder,
@@ -285,20 +339,25 @@ export class RInput {
285
339
  'aria-required': `${required || false}`,
286
340
  'aria-describedby': this.ariaDescribedBy
287
341
  };
288
- // DEPRECATED: will be removed in November 2025 release.
289
- const tooltipAttrs = tooltip && !disabled ? {
290
- tooltip,
291
- 'tooltip-icon': tooltipIcon,
292
- 'tooltip-icon-color': tooltipIconColor,
342
+ const labelAttr = label ? {
343
+ id: `${uniqueId}-label`,
344
+ fieldIndicator
293
345
  } : {};
294
- const labelAttr = label ? Object.assign({ id: `${uniqueId}-label`, fieldIndicator }, tooltipAttrs) : {};
295
346
  const renderValidationMarker = () => {
296
- if (!validMarker)
297
- return null;
298
- if (!valid && !invalid)
347
+ const icons = {
348
+ valid: 'circled-check',
349
+ invalid: 'circled-exclamation-mark'
350
+ };
351
+ const colors = {
352
+ valid: '--r-status-success-regular',
353
+ invalid: '--r-status-error-regular'
354
+ };
355
+ const shouldShowValidMarker = !!validityMarker && !!valid && !!value;
356
+ const shouldShowInvalidMarker = !!validityMarker && !!invalid;
357
+ if (!shouldShowValidMarker && !shouldShowInvalidMarker)
299
358
  return null;
300
- const iconName = invalid ? 'circled-exclamation-mark' : 'circled-check';
301
- const iconColor = invalid ? '--r-status-error-regular' : '--r-status-success-regular';
359
+ const iconName = shouldShowInvalidMarker ? icons.invalid : icons.valid;
360
+ const iconColor = shouldShowInvalidMarker ? colors.invalid : colors.valid;
302
361
  return h("r-icon", { class: "r-input--validation-icon", "aria-hidden": true, size: "s", name: iconName, color: iconColor });
303
362
  };
304
363
  // Filter out event listener properties based on naming convention.
@@ -309,13 +368,13 @@ export class RInput {
309
368
  }
310
369
  return acc;
311
370
  }, {});
312
- return (h(Host, { onClick: this.handleClick, onKeyup: this.handleKeyup }, h("div", { class: internal ? 'visually-hidden' : 'r-input--label-container' }, h("label", { htmlFor: uniqueId }, label ?
371
+ return (h(Host, { onClick: this.handleClick, onKeyup: this.handleKeyup, "data-touched": `${this.touched}`, "data-dirty": `${this.dirty}` }, h("div", { class: internal ? 'visually-hidden' : 'r-input--label-container' }, h("label", { htmlFor: uniqueId }, label ?
313
372
  h("r-label", Object.assign({ class: "r-input--label" }, labelAttr), label)
314
373
  :
315
374
  h("slot", { name: "label" })), h("slot", { name: "popover" })), hint &&
316
375
  h("r-hint", { id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { class: "r-input--container" }, h("slot", { name: "leading" }), h("input", Object.assign({ class: "r-input--input", type: this.type }, inputAttrs, eventListeners, { ref: el => this.nativeElement = el, value: this.value, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus })), h("div", { class: "r-input--trailing" }, this.readonly &&
317
376
  h("r-icon", { class: "r-input--readonly-icon", name: "pen-disabled", size: "s" }), renderValidationMarker(), this.hasTrailingSlot &&
318
- h("slot", { name: "trailing" }))), h("div", { id: `${uniqueId}-message`, "aria-live": !internal ? 'polite' : null, class: !internal ? 'r-input--message' : 'visually-hidden' }, h("slot", { name: "message" }, this.hasMessage && h("r-hint", { variant: valid ? 'success' : 'error' }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage), this.hasValidationSuccess && this.validMessage)))));
377
+ h("slot", { name: "trailing" }))), h("div", { id: `${uniqueId}-message`, "aria-live": !internal ? 'polite' : null, class: !internal ? 'r-input--message' : 'visually-hidden' }, h("slot", { name: "message" }, this.hasMessage && h("r-hint", { variant: valid ? 'success' : 'error' }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage))))));
319
378
  }
320
379
  static get is() { return "r-input"; }
321
380
  static get encapsulation() { return "shadow"; }
@@ -510,122 +569,6 @@ export class RInput {
510
569
  "setter": false,
511
570
  "reflect": true
512
571
  },
513
- "optional": {
514
- "type": "boolean",
515
- "attribute": "optional",
516
- "mutable": false,
517
- "complexType": {
518
- "original": "boolean",
519
- "resolved": "boolean",
520
- "references": {}
521
- },
522
- "required": false,
523
- "optional": true,
524
- "docs": {
525
- "tags": [{
526
- "name": "deprecated",
527
- "text": "Use `fieldIndicator` instead. Will be removed November 2025.\nBoolean flag to render an \u201Coptional\u201D marker."
528
- }],
529
- "text": ""
530
- },
531
- "getter": false,
532
- "setter": false,
533
- "reflect": false
534
- },
535
- "optionalText": {
536
- "type": "string",
537
- "attribute": "optional-text",
538
- "mutable": false,
539
- "complexType": {
540
- "original": "string",
541
- "resolved": "string",
542
- "references": {}
543
- },
544
- "required": false,
545
- "optional": true,
546
- "docs": {
547
- "tags": [{
548
- "name": "deprecated",
549
- "text": "Use `fieldIndicator` instead. Will be removed November 2025.\nCustom text for optional marker."
550
- }],
551
- "text": ""
552
- },
553
- "getter": false,
554
- "setter": false,
555
- "reflect": false
556
- },
557
- "tooltip": {
558
- "type": "string",
559
- "attribute": "tooltip",
560
- "mutable": false,
561
- "complexType": {
562
- "original": "string",
563
- "resolved": "string",
564
- "references": {}
565
- },
566
- "required": false,
567
- "optional": true,
568
- "docs": {
569
- "tags": [{
570
- "name": "deprecated",
571
- "text": "Use the `popover` slot instead. Will be removed November 2025.\nLabel tooltip text content."
572
- }],
573
- "text": ""
574
- },
575
- "getter": false,
576
- "setter": false,
577
- "reflect": false
578
- },
579
- "tooltipIcon": {
580
- "type": "string",
581
- "attribute": "tooltip-icon",
582
- "mutable": false,
583
- "complexType": {
584
- "original": "IconName",
585
- "resolved": "string",
586
- "references": {
587
- "IconName": {
588
- "location": "import",
589
- "path": "../icon/exports",
590
- "id": "src/components/icon/exports.ts::IconName"
591
- }
592
- }
593
- },
594
- "required": false,
595
- "optional": true,
596
- "docs": {
597
- "tags": [{
598
- "name": "deprecated",
599
- "text": "Use the `popover` slot instead. Will be removed November 2025.\nIcon name used as tooltip trigger."
600
- }],
601
- "text": ""
602
- },
603
- "getter": false,
604
- "setter": false,
605
- "reflect": false
606
- },
607
- "tooltipIconColor": {
608
- "type": "string",
609
- "attribute": "tooltip-icon-color",
610
- "mutable": false,
611
- "complexType": {
612
- "original": "string",
613
- "resolved": "string",
614
- "references": {}
615
- },
616
- "required": false,
617
- "optional": true,
618
- "docs": {
619
- "tags": [{
620
- "name": "deprecated",
621
- "text": "Use the `popover` slot instead. Will be removed November 2025.\nColor token for tooltip trigger icon."
622
- }],
623
- "text": ""
624
- },
625
- "getter": false,
626
- "setter": false,
627
- "reflect": false
628
- },
629
572
  "hint": {
630
573
  "type": "string",
631
574
  "attribute": "hint",
@@ -645,107 +588,6 @@ export class RInput {
645
588
  "setter": false,
646
589
  "reflect": false
647
590
  },
648
- "icon": {
649
- "type": "string",
650
- "attribute": "icon",
651
- "mutable": false,
652
- "complexType": {
653
- "original": "IconName",
654
- "resolved": "string",
655
- "references": {
656
- "IconName": {
657
- "location": "import",
658
- "path": "../icon/exports",
659
- "id": "src/components/icon/exports.ts::IconName"
660
- }
661
- }
662
- },
663
- "required": false,
664
- "optional": true,
665
- "docs": {
666
- "tags": [{
667
- "name": "deprecated",
668
- "text": "Will be removed November 2025.\nLegacy single icon (prefer `leading` / `trailing` slots)."
669
- }],
670
- "text": ""
671
- },
672
- "getter": false,
673
- "setter": false,
674
- "reflect": true
675
- },
676
- "iconColor": {
677
- "type": "string",
678
- "attribute": "icon-color",
679
- "mutable": false,
680
- "complexType": {
681
- "original": "string",
682
- "resolved": "string",
683
- "references": {}
684
- },
685
- "required": false,
686
- "optional": true,
687
- "docs": {
688
- "tags": [{
689
- "name": "deprecated",
690
- "text": "Will be removed November 2025.\nColor for legacy icon."
691
- }],
692
- "text": ""
693
- },
694
- "getter": false,
695
- "setter": false,
696
- "reflect": false
697
- },
698
- "iconPosition": {
699
- "type": "string",
700
- "attribute": "icon-position",
701
- "mutable": false,
702
- "complexType": {
703
- "original": "IconPosition",
704
- "resolved": "\"end\" | \"start\"",
705
- "references": {
706
- "IconPosition": {
707
- "location": "import",
708
- "path": "../icon/exports",
709
- "id": "src/components/icon/exports.ts::IconPosition"
710
- }
711
- }
712
- },
713
- "required": false,
714
- "optional": false,
715
- "docs": {
716
- "tags": [{
717
- "name": "deprecated",
718
- "text": "Will be removed November 2025.\nPosition of legacy icon: `start` | `end`."
719
- }],
720
- "text": ""
721
- },
722
- "getter": false,
723
- "setter": false,
724
- "reflect": false,
725
- "defaultValue": "'start'"
726
- },
727
- "iconSubmit": {
728
- "type": "boolean",
729
- "attribute": "icon-submit",
730
- "mutable": false,
731
- "complexType": {
732
- "original": "boolean",
733
- "resolved": "boolean",
734
- "references": {}
735
- },
736
- "required": false,
737
- "optional": true,
738
- "docs": {
739
- "tags": [{
740
- "name": "deprecated",
741
- "text": "Will be removed November 2025.\nTreat legacy icon as submit trigger."
742
- }],
743
- "text": ""
744
- },
745
- "getter": false,
746
- "setter": false,
747
- "reflect": false
748
- },
749
591
  "fullWidth": {
750
592
  "type": "boolean",
751
593
  "attribute": "full-width",
@@ -765,28 +607,6 @@ export class RInput {
765
607
  "setter": false,
766
608
  "reflect": true
767
609
  },
768
- "showValid": {
769
- "type": "boolean",
770
- "attribute": "show-valid",
771
- "mutable": false,
772
- "complexType": {
773
- "original": "boolean",
774
- "resolved": "boolean",
775
- "references": {}
776
- },
777
- "required": false,
778
- "optional": true,
779
- "docs": {
780
- "tags": [{
781
- "name": "deprecated",
782
- "text": "Will be removed November 2025.\nControls visibility of success validation marker."
783
- }],
784
- "text": ""
785
- },
786
- "getter": false,
787
- "setter": false,
788
- "reflect": true
789
- },
790
610
  "valid": {
791
611
  "type": "boolean",
792
612
  "attribute": "valid",
@@ -806,80 +626,6 @@ export class RInput {
806
626
  "setter": false,
807
627
  "reflect": true
808
628
  },
809
- "validMarker": {
810
- "type": "boolean",
811
- "attribute": "valid-marker",
812
- "mutable": false,
813
- "complexType": {
814
- "original": "boolean",
815
- "resolved": "boolean",
816
- "references": {}
817
- },
818
- "required": false,
819
- "optional": false,
820
- "docs": {
821
- "tags": [{
822
- "name": "deprecated",
823
- "text": "Will be removed November 2025.\nLegacy boolean to show a validation marker icon."
824
- }],
825
- "text": ""
826
- },
827
- "getter": false,
828
- "setter": false,
829
- "reflect": true,
830
- "defaultValue": "false"
831
- },
832
- "validMarkerIcon": {
833
- "type": "string",
834
- "attribute": "valid-marker-icon",
835
- "mutable": false,
836
- "complexType": {
837
- "original": "IconName",
838
- "resolved": "string",
839
- "references": {
840
- "IconName": {
841
- "location": "import",
842
- "path": "../icon/exports",
843
- "id": "src/components/icon/exports.ts::IconName"
844
- }
845
- }
846
- },
847
- "required": false,
848
- "optional": false,
849
- "docs": {
850
- "tags": [{
851
- "name": "deprecated",
852
- "text": "Will be removed November 2025.\nIcon name used when `validMarker` is active and state is valid."
853
- }],
854
- "text": ""
855
- },
856
- "getter": false,
857
- "setter": false,
858
- "reflect": true,
859
- "defaultValue": "'circled-check'"
860
- },
861
- "validMessage": {
862
- "type": "string",
863
- "attribute": "valid-message",
864
- "mutable": false,
865
- "complexType": {
866
- "original": "string",
867
- "resolved": "string",
868
- "references": {}
869
- },
870
- "required": false,
871
- "optional": true,
872
- "docs": {
873
- "tags": [{
874
- "name": "deprecated",
875
- "text": "Will be removed November 2025.\nCustom success message when field is valid."
876
- }],
877
- "text": ""
878
- },
879
- "getter": false,
880
- "setter": false,
881
- "reflect": false
882
- },
883
629
  "invalid": {
884
630
  "type": "boolean",
885
631
  "attribute": "invalid",
@@ -1285,6 +1031,25 @@ export class RInput {
1285
1031
  "setter": false,
1286
1032
  "reflect": false
1287
1033
  },
1034
+ "passwordrules": {
1035
+ "type": "string",
1036
+ "attribute": "passwordrules",
1037
+ "mutable": false,
1038
+ "complexType": {
1039
+ "original": "string",
1040
+ "resolved": "string",
1041
+ "references": {}
1042
+ },
1043
+ "required": false,
1044
+ "optional": true,
1045
+ "docs": {
1046
+ "tags": [],
1047
+ "text": "Safari-specific password rules for strong password generation (password inputs only).\nFormat: \"minlength: X; required: lower; required: upper; required: digit; required: special;\"\nThis attribute is Safari-specific and will be ignored by other browsers.\nSee: https://developer.apple.com/documentation/security/password_autofill/customizing_password_autofill_rules"
1048
+ },
1049
+ "getter": false,
1050
+ "setter": false,
1051
+ "reflect": false
1052
+ },
1288
1053
  "autofocus": {
1289
1054
  "type": "boolean",
1290
1055
  "attribute": "autofocus",
@@ -1322,35 +1087,39 @@ export class RInput {
1322
1087
  "getter": false,
1323
1088
  "setter": false,
1324
1089
  "reflect": true
1090
+ },
1091
+ "validityMarker": {
1092
+ "type": "boolean",
1093
+ "attribute": "validity-marker",
1094
+ "mutable": false,
1095
+ "complexType": {
1096
+ "original": "boolean",
1097
+ "resolved": "boolean",
1098
+ "references": {}
1099
+ },
1100
+ "required": false,
1101
+ "optional": false,
1102
+ "docs": {
1103
+ "tags": [],
1104
+ "text": "When `true` field renders valid/invalid marker within."
1105
+ },
1106
+ "getter": false,
1107
+ "setter": false,
1108
+ "reflect": true,
1109
+ "defaultValue": "true"
1325
1110
  }
1326
1111
  };
1327
1112
  }
1328
1113
  static get states() {
1329
1114
  return {
1330
1115
  "validityState": {},
1331
- "validityMessage": {}
1116
+ "validityMessage": {},
1117
+ "touched": {},
1118
+ "dirty": {}
1332
1119
  };
1333
1120
  }
1334
1121
  static get events() {
1335
1122
  return [{
1336
- "method": "rClickIcon",
1337
- "name": "rClickIcon",
1338
- "bubbles": true,
1339
- "cancelable": true,
1340
- "composed": true,
1341
- "docs": {
1342
- "tags": [{
1343
- "name": "deprecated",
1344
- "text": "Will be removed November 2025.\nEmitted when legacy icon is clicked."
1345
- }],
1346
- "text": ""
1347
- },
1348
- "complexType": {
1349
- "original": "any",
1350
- "resolved": "any",
1351
- "references": {}
1352
- }
1353
- }, {
1354
1123
  "method": "rValidate",
1355
1124
  "name": "rValidate",
1356
1125
  "bubbles": true,
@@ -1619,6 +1388,77 @@ export class RInput {
1619
1388
  "text": "Set the current value programmatically (does not fire native input/change automatically).",
1620
1389
  "tags": []
1621
1390
  }
1391
+ },
1392
+ "checkValidity": {
1393
+ "complexType": {
1394
+ "signature": "() => Promise<boolean>",
1395
+ "parameters": [],
1396
+ "references": {
1397
+ "Promise": {
1398
+ "location": "global",
1399
+ "id": "global::Promise"
1400
+ }
1401
+ },
1402
+ "return": "Promise<boolean>"
1403
+ },
1404
+ "docs": {
1405
+ "text": "Validates the input without triggering UI and returns a boolean indicating its validity.",
1406
+ "tags": [{
1407
+ "name": "returns",
1408
+ "text": "A boolean indicating whether the input is valid."
1409
+ }]
1410
+ }
1411
+ },
1412
+ "isTouched": {
1413
+ "complexType": {
1414
+ "signature": "() => Promise<boolean>",
1415
+ "parameters": [],
1416
+ "references": {
1417
+ "Promise": {
1418
+ "location": "global",
1419
+ "id": "global::Promise"
1420
+ }
1421
+ },
1422
+ "return": "Promise<boolean>"
1423
+ },
1424
+ "docs": {
1425
+ "text": "Gets the touched state (whether user has interacted with the input)",
1426
+ "tags": []
1427
+ }
1428
+ },
1429
+ "isDirty": {
1430
+ "complexType": {
1431
+ "signature": "() => Promise<boolean>",
1432
+ "parameters": [],
1433
+ "references": {
1434
+ "Promise": {
1435
+ "location": "global",
1436
+ "id": "global::Promise"
1437
+ }
1438
+ },
1439
+ "return": "Promise<boolean>"
1440
+ },
1441
+ "docs": {
1442
+ "text": "Gets the dirty state (whether value has been changed by user)",
1443
+ "tags": []
1444
+ }
1445
+ },
1446
+ "markAsPristine": {
1447
+ "complexType": {
1448
+ "signature": "() => Promise<void>",
1449
+ "parameters": [],
1450
+ "references": {
1451
+ "Promise": {
1452
+ "location": "global",
1453
+ "id": "global::Promise"
1454
+ }
1455
+ },
1456
+ "return": "Promise<void>"
1457
+ },
1458
+ "docs": {
1459
+ "text": "Resets touched and dirty states to pristine (untouched/clean)",
1460
+ "tags": []
1461
+ }
1622
1462
  }
1623
1463
  };
1624
1464
  }
@@ -1627,6 +1467,9 @@ export class RInput {
1627
1467
  return [{
1628
1468
  "propName": "value",
1629
1469
  "methodName": "handleValueChange"
1470
+ }, {
1471
+ "propName": "type",
1472
+ "methodName": "handleTypeChange"
1630
1473
  }];
1631
1474
  }
1632
1475
  }