@x15ventures/x15-ui-library 3.15.0 → 3.15.1

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 (130) hide show
  1. package/dist/cjs/autoGenerated/libraryThemes.js +12 -12
  2. package/dist/cjs/autoGenerated/libraryThemes.js.map +1 -1
  3. package/dist/cjs/autoGenerated/libraryThemes.json +12 -12
  4. package/dist/cjs/components/design/dialog/Dialog.js +1 -1
  5. package/dist/cjs/components/design/dialog/Dialog.js.map +1 -1
  6. package/dist/cjs/components/design/headerBar/HeaderBar.js +3 -1
  7. package/dist/cjs/components/design/headerBar/HeaderBar.js.map +1 -1
  8. package/dist/cjs/components/design/headerBar/headerBar.css +6 -1
  9. package/dist/cjs/components/form/formFields/formFieldWrapper/FormField.js +8 -5
  10. package/dist/cjs/components/form/formFields/formFieldWrapper/FormField.js.map +1 -1
  11. package/dist/cjs/components/form/formFields/formFieldWrapper/formFieldProps.js.map +1 -1
  12. package/dist/cjs/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.js +15 -11
  13. package/dist/cjs/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.js.map +1 -1
  14. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js +37 -15
  15. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js.map +1 -1
  16. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/inputCheckbox.css +4 -4
  17. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.js.map +1 -1
  18. package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +9 -9
  19. package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
  20. package/dist/cjs/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.js +14 -4
  21. package/dist/cjs/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.js.map +1 -1
  22. package/dist/cjs/components/form/formFields/subComponents/inputs/text/InputText.js +23 -17
  23. package/dist/cjs/components/form/formFields/subComponents/inputs/text/InputText.js.map +1 -1
  24. package/dist/cjs/components/form/formFields/subComponents/select/Select.js +6 -5
  25. package/dist/cjs/components/form/formFields/subComponents/select/Select.js.map +1 -1
  26. package/dist/cjs/components/form/formFields/subComponents/textarea/Textarea.js +55 -83
  27. package/dist/cjs/components/form/formFields/subComponents/textarea/Textarea.js.map +1 -1
  28. package/dist/cjs/components/form/formFields/subComponents/textarea/textarea.css +20 -0
  29. package/dist/cjs/components/form/hookFormWrapper/HookFormWrapper.js +22 -5
  30. package/dist/cjs/components/form/hookFormWrapper/HookFormWrapper.js.map +1 -1
  31. package/dist/cjs/components/form/validation/ValidationMessages.js +36 -38
  32. package/dist/cjs/components/form/validation/ValidationMessages.js.map +1 -1
  33. package/dist/cjs/exampleUIs/exampleComponents/DemoContactForm.js +1 -2
  34. package/dist/cjs/exampleUIs/exampleComponents/DemoContactForm.js.map +1 -1
  35. package/dist/cjs/helpers/index.js +12 -0
  36. package/dist/cjs/helpers/index.js.map +1 -1
  37. package/dist/cjs/helpers/stringHelpers.js +48 -2
  38. package/dist/cjs/helpers/stringHelpers.js.map +1 -1
  39. package/dist/cjs/interfaces/headerText.interface.js.map +1 -1
  40. package/dist/cjs/package.json +137 -151
  41. package/dist/cjs/styles/index.css +22 -25
  42. package/dist/cjs/styles/shared/_allPartials.css +22 -25
  43. package/dist/cjs/styles/shared/forms/_forms.css +22 -25
  44. package/dist/components/design/dialog/Dialog.d.ts.map +1 -1
  45. package/dist/components/design/dialog/Dialog.test.d.ts +5 -0
  46. package/dist/components/design/dialog/Dialog.test.d.ts.map +1 -0
  47. package/dist/components/design/headerBar/HeaderBar.d.ts.map +1 -1
  48. package/dist/components/form/formFields/formFieldWrapper/FormField.d.ts.map +1 -1
  49. package/dist/components/form/formFields/formFieldWrapper/formFieldProps.d.ts +7 -2
  50. package/dist/components/form/formFields/formFieldWrapper/formFieldProps.d.ts.map +1 -1
  51. package/dist/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.d.ts.map +1 -1
  52. package/dist/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.d.ts.map +1 -1
  53. package/dist/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.test.d.ts +5 -0
  54. package/dist/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.test.d.ts.map +1 -0
  55. package/dist/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.d.ts +8 -6
  56. package/dist/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.d.ts.map +1 -1
  57. package/dist/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.d.ts.map +1 -1
  58. package/dist/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.d.ts.map +1 -1
  59. package/dist/components/form/formFields/subComponents/inputs/text/InputText.d.ts.map +1 -1
  60. package/dist/components/form/formFields/subComponents/nestedFormContext.test.d.ts +5 -0
  61. package/dist/components/form/formFields/subComponents/nestedFormContext.test.d.ts.map +1 -0
  62. package/dist/components/form/formFields/subComponents/select/Select.d.ts.map +1 -1
  63. package/dist/components/form/formFields/subComponents/textarea/Textarea.d.ts +4 -3
  64. package/dist/components/form/formFields/subComponents/textarea/Textarea.d.ts.map +1 -1
  65. package/dist/components/form/hookFormWrapper/HookFormWrapper.d.ts +3 -0
  66. package/dist/components/form/hookFormWrapper/HookFormWrapper.d.ts.map +1 -1
  67. package/dist/components/form/hookFormWrapper/HookFormWrapper.test.d.ts +5 -0
  68. package/dist/components/form/hookFormWrapper/HookFormWrapper.test.d.ts.map +1 -0
  69. package/dist/components/form/validation/ValidationMessages.d.ts +8 -1
  70. package/dist/components/form/validation/ValidationMessages.d.ts.map +1 -1
  71. package/dist/components/form/validation/ValidationMessages.test.d.ts +5 -0
  72. package/dist/components/form/validation/ValidationMessages.test.d.ts.map +1 -0
  73. package/dist/esm/autoGenerated/libraryThemes.js +12 -12
  74. package/dist/esm/autoGenerated/libraryThemes.js.map +1 -1
  75. package/dist/esm/autoGenerated/libraryThemes.json +12 -12
  76. package/dist/esm/components/design/dialog/Dialog.js +1 -1
  77. package/dist/esm/components/design/dialog/Dialog.js.map +1 -1
  78. package/dist/esm/components/design/headerBar/HeaderBar.js +3 -1
  79. package/dist/esm/components/design/headerBar/HeaderBar.js.map +1 -1
  80. package/dist/esm/components/design/headerBar/headerBar.css +6 -1
  81. package/dist/esm/components/form/formFields/formFieldWrapper/FormField.js +8 -5
  82. package/dist/esm/components/form/formFields/formFieldWrapper/FormField.js.map +1 -1
  83. package/dist/esm/components/form/formFields/formFieldWrapper/formFieldProps.js.map +1 -1
  84. package/dist/esm/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.js +16 -12
  85. package/dist/esm/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.js.map +1 -1
  86. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js +37 -15
  87. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js.map +1 -1
  88. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/inputCheckbox.css +4 -4
  89. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.js.map +1 -1
  90. package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +8 -8
  91. package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
  92. package/dist/esm/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.js +16 -6
  93. package/dist/esm/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.js.map +1 -1
  94. package/dist/esm/components/form/formFields/subComponents/inputs/text/InputText.js +23 -17
  95. package/dist/esm/components/form/formFields/subComponents/inputs/text/InputText.js.map +1 -1
  96. package/dist/esm/components/form/formFields/subComponents/select/Select.js +6 -5
  97. package/dist/esm/components/form/formFields/subComponents/select/Select.js.map +1 -1
  98. package/dist/esm/components/form/formFields/subComponents/textarea/Textarea.js +50 -78
  99. package/dist/esm/components/form/formFields/subComponents/textarea/Textarea.js.map +1 -1
  100. package/dist/esm/components/form/formFields/subComponents/textarea/textarea.css +20 -0
  101. package/dist/esm/components/form/hookFormWrapper/HookFormWrapper.js +22 -5
  102. package/dist/esm/components/form/hookFormWrapper/HookFormWrapper.js.map +1 -1
  103. package/dist/esm/components/form/validation/ValidationMessages.js +36 -38
  104. package/dist/esm/components/form/validation/ValidationMessages.js.map +1 -1
  105. package/dist/esm/exampleUIs/exampleComponents/DemoContactForm.js +1 -2
  106. package/dist/esm/exampleUIs/exampleComponents/DemoContactForm.js.map +1 -1
  107. package/dist/esm/helpers/index.js +1 -1
  108. package/dist/esm/helpers/index.js.map +1 -1
  109. package/dist/esm/helpers/stringHelpers.js +44 -0
  110. package/dist/esm/helpers/stringHelpers.js.map +1 -1
  111. package/dist/esm/interfaces/headerText.interface.js.map +1 -1
  112. package/dist/esm/package.json +137 -151
  113. package/dist/esm/styles/index.css +22 -25
  114. package/dist/esm/styles/shared/_allPartials.css +22 -25
  115. package/dist/esm/styles/shared/forms/_forms.css +22 -25
  116. package/dist/exampleUIs/exampleComponents/DemoContactForm.d.ts.map +1 -1
  117. package/dist/helpers/index.d.ts +1 -1
  118. package/dist/helpers/index.d.ts.map +1 -1
  119. package/dist/helpers/stringHelpers.d.ts +17 -0
  120. package/dist/helpers/stringHelpers.d.ts.map +1 -1
  121. package/dist/interfaces/headerText.interface.d.ts +1 -0
  122. package/dist/interfaces/headerText.interface.d.ts.map +1 -1
  123. package/dist/package.json +137 -151
  124. package/package.json +137 -151
  125. package/dist/cjs/components/form/formFields/utilities/formUtilities.js +0 -22
  126. package/dist/cjs/components/form/formFields/utilities/formUtilities.js.map +0 -1
  127. package/dist/components/form/formFields/utilities/formUtilities.d.ts +0 -18
  128. package/dist/components/form/formFields/utilities/formUtilities.d.ts.map +0 -1
  129. package/dist/esm/components/form/formFields/utilities/formUtilities.js +0 -16
  130. package/dist/esm/components/form/formFields/utilities/formUtilities.js.map +0 -1
@@ -32,6 +32,50 @@ export const capitalizeFirstLetter = pString => `${pString.substring(0, 1).toUpp
32
32
  */
33
33
  export const lowerCaseFirstLetter = pString => `${pString.substring(0, 1).toLowerCase()}${pString.substring(1)}`;
34
34
 
35
+ /**
36
+ * Splits a string into grapheme clusters so text metrics and clamping can share
37
+ * the same segmentation logic without forcing callers to pass pre-segmented data.
38
+ *
39
+ * @param {string} pString - The string to segment.
40
+ * @returns {string[]} The grapheme units in order, falling back to code points when Intl.Segmenter is unavailable.
41
+ */
42
+ const getGraphemeSegments = pString => {
43
+ if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {
44
+ const segmenter = new Intl.Segmenter(undefined, {
45
+ granularity: 'grapheme'
46
+ });
47
+ return Array.from(segmenter.segment(pString), ({
48
+ segment
49
+ }) => segment);
50
+ }
51
+ return Array.from(pString);
52
+ };
53
+
54
+ /**
55
+ * Counts user-perceived characters (grapheme clusters) so emojis and composed
56
+ * characters such as accented letters count as one.
57
+ *
58
+ * @param {string} pString - A string of text.
59
+ * @returns {number} The number of grapheme clusters, falling back to code points where Intl.Segmenter is unavailable.
60
+ */
61
+ export const getCharacterCount = pString => getGraphemeSegments(pString).length;
62
+
63
+ /**
64
+ * Truncates a string to a maximum number of grapheme clusters without splitting
65
+ * an emoji or composed character in half.
66
+ *
67
+ * @param {string} pString - A string of text.
68
+ * @param {number} maxAllowed - The maximum number of user-perceived characters to keep.
69
+ * @returns {string} The truncated string, or the unchanged pString if it is already within the limit.
70
+ */
71
+ export const clampToGraphemeMax = (pString, maxAllowed) => {
72
+ const graphemeSegments = getGraphemeSegments(pString);
73
+ if (graphemeSegments.length <= maxAllowed) {
74
+ return pString;
75
+ }
76
+ return graphemeSegments.slice(0, maxAllowed).join('');
77
+ };
78
+
35
79
  /**
36
80
  * Determines if "an" should be used instead of "a" before the given word.
37
81
  *
@@ -1 +1 @@
1
- {"version":3,"file":"stringHelpers.js","names":["parse","richTextParser","richText","supportEscapedCharacters","adjustedText","split","join","capitalize","pString","substring","toUpperCase","toLowerCase","capitalizeFirstLetter","lowerCaseFirstLetter","useAnInsteadOfA","word","lettersRequiringAn","firstLetter","includes","splitCamelCase","replace","pluralize","endsWith","slice","pluralizeIfNeeded","count","getInitialsOrAcronym","map","piece"],"sources":["../../../src/helpers/stringHelpers.ts"],"sourcesContent":["import React from 'react';\nimport parse from 'html-react-parser';\n\nexport const richTextParser = (richText: string, supportEscapedCharacters: boolean): string | React.JSX.Element | React.JSX.Element[] => {\n // Adjusts text to replace line breaks with <br/> tags\n const adjustedText = richText.split('\\r\\n').join('<br/>');\n if (supportEscapedCharacters) {\n return parse(adjustedText);\n }\n return parse(richText);\n};\n\n/**\n * Takes a string and returns it with the first character capitalized and the remaining characters as lowercase.\n *\n * @param {string} pString - A string of text.\n * @returns {string} The capitalized string or the unchanged pString if anything other than a string is sent to it.\n */\nexport const capitalize = (pString: string): string => `${ pString.substring(0, 1).toUpperCase() }${ pString.substring(1).toLowerCase() }`;\n\n/**\n * Capitalizes the first letter of the given string.\n *\n * @param {string} pString - A string of text.\n * @returns {string} The string with the first letter capitalized, or the unchanged pString if it's not a string.\n */\nexport const capitalizeFirstLetter = (pString: string): string => `${ pString.substring(0, 1).toUpperCase() }${ pString.substring(1) }`;\n\n/**\n * Converts the first letter of the given string to lowercase.\n *\n * @param {string} pString - A string of text.\n * @returns {string} The string with the first letter converted to lowercase, or the unchanged pString if it's not a string.\n */\nexport const lowerCaseFirstLetter = (pString: string): string => `${ pString.substring(0, 1).toLowerCase() }${ pString.substring(1) }`;\n\n/**\n * Determines if \"an\" should be used instead of \"a\" before the given word.\n *\n * @param {string} word - The word to check.\n * @returns {boolean} True if \"an\" should be used, false otherwise.\n */\nexport const useAnInsteadOfA = (word: string): boolean => {\n const lettersRequiringAn = ['a', 'e', 'i', 'o', 'u', 'h'];\n const firstLetter = word.substring(0, 1).toLowerCase();\n return lettersRequiringAn.includes(firstLetter);\n};\n\nexport const splitCamelCase = (pString: string): string => pString\n// Single regex to handle all cases: lowercase followed by uppercase/number, or number followed by letter\n .replace(/([a-z])([A-Z0-9])|([0-9])([a-zA-Z])/g, '$1$3 $2$4')\n// Insert a space between capital letters and lowercase letters where missing\n .replace(/([A-Z])([A-Z][a-z])/g, '$1 $2')\n// Convert the entire string to lowercase for consistency\n .toLowerCase();\n\nexport const pluralize = (pString: string): string => {\n if (pString.endsWith('y')) {\n // If the word ends with 'y', replace 'y' with 'ies'\n return `${ pString.slice(0, -1) }ies`;\n } if (pString.endsWith('s') || pString.endsWith('x') || pString.endsWith('z') || pString.endsWith('ch') || pString.endsWith('sh')) {\n // If the word ends with s, x, z, ch, or sh, add 'es'\n return `${ pString }es`;\n }\n // For other cases, just add 's'\n return `${ pString }s`;\n};\n\nexport const pluralizeIfNeeded = (pString: string, count: number): string => {\n if (count && count > 1) {\n return pluralize(pString);\n }\n return pString;\n};\n\nexport const getInitialsOrAcronym = (pString: string): string => {\n return pString.split(' ').map((piece) => capitalize(piece.substring(0, 1))).join('');\n};\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,mBAAmB;AAErC,OAAO,MAAMC,cAAc,GAAGA,CAACC,QAAgB,EAAEC,wBAAiC,KAAuD;EACvI;EACA,MAAMC,YAAY,GAAGF,QAAQ,CAACG,KAAK,CAAC,MAAM,CAAC,CAACC,IAAI,CAAC,OAAO,CAAC;EACzD,IAAIH,wBAAwB,EAAE;IAC5B,OAAOH,KAAK,CAACI,YAAY,CAAC;EAC5B;EACA,OAAOJ,KAAK,CAACE,QAAQ,CAAC;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,UAAU,GAAIC,OAAe,IAAa,GAAIA,OAAO,CAACC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAKF,OAAO,CAACC,SAAS,CAAC,CAAC,CAAC,CAACE,WAAW,CAAC,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AG,CAAC,IAAId,OAAO,CAACc,QAAQ,CAAC,GAAG,CAAC,IAAId,OAAO,CAACc,QAAQ,CAAC,IAAI,CAAC,IAAId,OAAO,CAACc,QAAQ,CAAC,IAAI,CAAC,EAAE;IACjI;IACA,OAAO,GAAId,OAAO,IAAK;EACzB;EACA;EACA,OAAO,GAAIA,OAAO,GAAI;AACxB,CAAC;AAED,OAAO,MAAMgB,iBAAiB,GAAGA,CAAChB,OAAe,EAAEiB,KAAa,KAAa;EAC3E,IAAIA,KAAK,IAAIA,KAAK,GAAG,CAAC,EAAE;IACtB,OAAOJ,SAAS,CAACb,OAAO,CAAC;EAC3B;EACA,OAAOA,OAAO;AAChB,CAAC;AAED,OAAO,MAAMkB,oBAAoB,GAAIlB,OAAe,IAAa;EAC/D,OAAOA,OAAO,CAACH,KAAK,CAAC,GAAG,CAAC,CAACsB,GAAG,CAAEC,KAAK,IAAKrB,UAAU,CAACqB,KAAK,CAACnB,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAACH,IAAI,CAAC,EAAE,CAAC;AACtF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"stringHelpers.js","names":["parse","richTextParser","richText","supportEscapedCharacters","adjustedText","split","join","capitalize","pString","substring","toUpperCase","toLowerCase","capitalizeFirstLetter","lowerCaseFirstLetter","getGraphemeSegments","Intl","segmenter","Segmenter","undefined","granularity","Array","from","segment","getCharacterCount","length","clampToGraphemeMax","maxAllowed","graphemeSegments","slice","useAnInsteadOfA","word","lettersRequiringAn","firstLetter","includes","splitCamelCase","replace","pluralize","endsWith","pluralizeIfNeeded","count","getInitialsOrAcronym","map","piece"],"sources":["../../../src/helpers/stringHelpers.ts"],"sourcesContent":["import React from 'react';\nimport parse from 'html-react-parser';\n\nexport const richTextParser = (richText: string, supportEscapedCharacters: boolean): string | React.JSX.Element | React.JSX.Element[] => {\n // Adjusts text to replace line breaks with <br/> tags\n const adjustedText = richText.split('\\r\\n').join('<br/>');\n if (supportEscapedCharacters) {\n return parse(adjustedText);\n }\n return parse(richText);\n};\n\n/**\n * Takes a string and returns it with the first character capitalized and the remaining characters as lowercase.\n *\n * @param {string} pString - A string of text.\n * @returns {string} The capitalized string or the unchanged pString if anything other than a string is sent to it.\n */\nexport const capitalize = (pString: string): string => `${ pString.substring(0, 1).toUpperCase() }${ pString.substring(1).toLowerCase() }`;\n\n/**\n * Capitalizes the first letter of the given string.\n *\n * @param {string} pString - A string of text.\n * @returns {string} The string with the first letter capitalized, or the unchanged pString if it's not a string.\n */\nexport const capitalizeFirstLetter = (pString: string): string => `${ pString.substring(0, 1).toUpperCase() }${ pString.substring(1) }`;\n\n/**\n * Converts the first letter of the given string to lowercase.\n *\n * @param {string} pString - A string of text.\n * @returns {string} The string with the first letter converted to lowercase, or the unchanged pString if it's not a string.\n */\nexport const lowerCaseFirstLetter = (pString: string): string => `${ pString.substring(0, 1).toLowerCase() }${ pString.substring(1) }`;\n\n/**\n * Splits a string into grapheme clusters so text metrics and clamping can share\n * the same segmentation logic without forcing callers to pass pre-segmented data.\n *\n * @param {string} pString - The string to segment.\n * @returns {string[]} The grapheme units in order, falling back to code points when Intl.Segmenter is unavailable.\n */\nconst getGraphemeSegments = (pString: string): string[] => {\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n\n return Array.from(segmenter.segment(pString), ({ segment }) => segment);\n }\n\n return Array.from(pString);\n};\n\n/**\n * Counts user-perceived characters (grapheme clusters) so emojis and composed\n * characters such as accented letters count as one.\n *\n * @param {string} pString - A string of text.\n * @returns {number} The number of grapheme clusters, falling back to code points where Intl.Segmenter is unavailable.\n */\nexport const getCharacterCount = (pString: string): number => getGraphemeSegments(pString).length;\n\n/**\n * Truncates a string to a maximum number of grapheme clusters without splitting\n * an emoji or composed character in half.\n *\n * @param {string} pString - A string of text.\n * @param {number} maxAllowed - The maximum number of user-perceived characters to keep.\n * @returns {string} The truncated string, or the unchanged pString if it is already within the limit.\n */\nexport const clampToGraphemeMax = (pString: string, maxAllowed: number): string => {\n const graphemeSegments = getGraphemeSegments(pString);\n\n if (graphemeSegments.length <= maxAllowed) {\n return pString;\n }\n\n return graphemeSegments.slice(0, maxAllowed).join('');\n};\n\n/**\n * Determines if \"an\" should be used instead of \"a\" before the given word.\n *\n * @param {string} word - The word to check.\n * @returns {boolean} True if \"an\" should be used, false otherwise.\n */\nexport const useAnInsteadOfA = (word: string): boolean => {\n const lettersRequiringAn = ['a', 'e', 'i', 'o', 'u', 'h'];\n const firstLetter = word.substring(0, 1).toLowerCase();\n return lettersRequiringAn.includes(firstLetter);\n};\n\nexport const splitCamelCase = (pString: string): string => pString\n// Single regex to handle all cases: lowercase followed by uppercase/number, or number followed by letter\n .replace(/([a-z])([A-Z0-9])|([0-9])([a-zA-Z])/g, '$1$3 $2$4')\n// Insert a space between capital letters and lowercase letters where missing\n .replace(/([A-Z])([A-Z][a-z])/g, '$1 $2')\n// Convert the entire string to lowercase for consistency\n .toLowerCase();\n\nexport const pluralize = (pString: string): string => {\n if (pString.endsWith('y')) {\n // If the word ends with 'y', replace 'y' with 'ies'\n return `${ pString.slice(0, -1) }ies`;\n } if (pString.endsWith('s') || pString.endsWith('x') || pString.endsWith('z') || pString.endsWith('ch') || pString.endsWith('sh')) {\n // If the word ends with s, x, z, ch, or sh, add 'es'\n return `${ pString }es`;\n }\n // For other cases, just add 's'\n return `${ pString }s`;\n};\n\nexport const pluralizeIfNeeded = (pString: string, count: number): string => {\n if (count && count > 1) {\n return pluralize(pString);\n }\n return pString;\n};\n\nexport const getInitialsOrAcronym = (pString: string): string => {\n return pString.split(' ').map((piece) => capitalize(piece.substring(0, 1))).join('');\n};\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,mBAAmB;AAErC,OAAO,MAAMC,cAAc,GAAGA,CAACC,QAAgB,EAAEC,wBAAiC,KAAuD;EACvI;EACA,MAAMC,YAAY,GAAGF,QAAQ,CAACG,KAAK,CAAC,MAAM,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AAIpB,OAAO,CAAC6B,QAAQ,CAAC,GAAG,CAAC,IAAI7B,OAAO,CAAC6B,QAAQ,CAAC,GAAG,CAAC,IAAI7B,OAAO,CAAC6B,QAAQ,CAAC,GAAG,CAAC,IAAI7B,OAAO,CAAC6B,QAAQ,CAAC,IAAI,CAAC,IAAI7B,OAAO,CAAC6B,QAAQ,CAAC,IAAI,CAAC,EAAE;IACjI;IACA,OAAO,GAAI7B,OAAO,IAAK;EACzB;EACA;EACA,OAAO,GAAIA,OAAO,GAAI;AACxB,CAAC;AAED,OAAO,MAAM8B,iBAAiB,GAAGA,CAAC9B,OAAe,EAAE+B,KAAa,KAAa;EAC3E,IAAIA,KAAK,IAAIA,KAAK,GAAG,CAAC,EAAE;IACtB,OAAOH,SAAS,CAAC5B,OAAO,CAAC;EAC3B;EACA,OAAOA,OAAO;AAChB,CAAC;AAED,OAAO,MAAMgC,oBAAoB,GAAIhC,OAAe,IAAa;EAC/D,OAAOA,OAAO,CAACH,KAAK,CAAC,GAAG,CAAC,CAACoC,GAAG,CAAEC,KAAK,IAAKnC,UAAU,CAACmC,KAAK,CAACjC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAACH,IAAI,CAAC,EAAE,CAAC;AACtF,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"headerText.interface.js","names":[],"sources":["../../../src/interfaces/headerText.interface.ts"],"sourcesContent":["import React from 'react';\nimport { NotificationIconProps } from '../components/design/icons/notificationIcon/NotificationIcon';\nimport { ButtonProps } from '../components/form/buttons/button.interface';\nimport { IconProps } from '../components/design/icons/basicIcon/Icon';\nimport { NotificationsButtonProps } from '../components/form/buttons/notificationsButton/NotificationsButton';\n\nexport type SimpleHeaderButton = ButtonProps & {\n kind?: 'simple'\n};\n\nexport type NotificationsHeaderButton = Omit<NotificationsButtonProps, 'label'> & {\n kind?: 'notifications'\n};\n\nexport type HeaderButtonTypes = SimpleHeaderButton | NotificationsHeaderButton;\n\nexport interface HeaderTextInterface {\n leftIcon?: IconProps;\n rightIcon?: IconProps;\n text?: string;\n notificationIcon?: NotificationIconProps;\n buttons?: HeaderButtonTypes[];\n children?: React.ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"headerText.interface.js","names":[],"sources":["../../../src/interfaces/headerText.interface.ts"],"sourcesContent":["import React from 'react';\nimport { NotificationIconProps } from '../components/design/icons/notificationIcon/NotificationIcon';\nimport { ButtonProps } from '../components/form/buttons/button.interface';\nimport { IconProps } from '../components/design/icons/basicIcon/Icon';\nimport { NotificationsButtonProps } from '../components/form/buttons/notificationsButton/NotificationsButton';\n\nexport type SimpleHeaderButton = ButtonProps & {\n kind?: 'simple'\n};\n\nexport type NotificationsHeaderButton = Omit<NotificationsButtonProps, 'label'> & {\n kind?: 'notifications'\n};\n\nexport type HeaderButtonTypes = SimpleHeaderButton | NotificationsHeaderButton;\n\nexport interface HeaderTextInterface {\n leftIcon?: IconProps;\n rightIcon?: IconProps;\n text?: string;\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n notificationIcon?: NotificationIconProps;\n buttons?: HeaderButtonTypes[];\n children?: React.ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
@@ -137,8 +137,23 @@
137
137
  "files": [
138
138
  "dist"
139
139
  ],
140
- "version": "3.14.0",
141
- "packageManager": "pnpm@10.11.0",
140
+ "version": "3.15.0",
141
+ "devEngines": {
142
+ "runtime": {
143
+ "name": "node",
144
+ "version": "24.15.0",
145
+ "onFail": "warn"
146
+ },
147
+ "packageManager": {
148
+ "name": "pnpm",
149
+ "version": "12.4.1",
150
+ "onFail": "warn"
151
+ }
152
+ },
153
+ "engines": {
154
+ "node": "24.15.0"
155
+ },
156
+ "packageManager": "pnpm@12.4.1",
142
157
  "repository": {
143
158
  "type": "git",
144
159
  "url": "https://github.com/x15ventures/x15-ui-library.git"
@@ -173,162 +188,133 @@
173
188
  "storybook:build": "pnpm install --frozen-lockfile && pnpm build:cicd && storybook build --config-dir config/storybook/web --output-dir ./storybook-static"
174
189
  },
175
190
  "dependencies": {
176
- "@hookform/error-message": "^2.0.1",
177
- "@x15stack/aws": "^1.7.2",
178
- "@x15ventures/x15-ui-library-icons": "^1.1.3",
179
- "babel-plugin-transform-imports": "^2.0.0",
180
- "html-react-parser": "^5.2.17",
181
- "jsdom": "^26.1.0",
182
- "react": "^18.3.1",
183
- "react-dom": "^18.3.1",
184
- "react-helmet": "^6.1.0",
185
- "react-hook-form": "^7.74.0",
186
- "run-func": "^3.0.0",
187
- "storybook": "^10.3.5",
188
- "use-debounce": "^10.1.1"
191
+ "@x15ventures/x15-ui-library-icons": "1.1.3",
192
+ "babel-plugin-transform-imports": "2.0.0",
193
+ "html-react-parser": "5.2.17",
194
+ "jsdom": "26.1.0",
195
+ "react": "18.3.1",
196
+ "react-dom": "18.3.1",
197
+ "react-helmet": "6.1.0",
198
+ "run-func": "3.0.0",
199
+ "storybook": "10.3.5",
200
+ "use-debounce": "10.1.1"
189
201
  },
190
202
  "peerDependencies": {
191
- "core-js": "^3.44.0",
192
- "react": "^18.0.0",
193
- "react-dom": "^18.0.0",
194
- "storybook": "^10.1.10"
203
+ "core-js": "3.49.0",
204
+ "react": "18.3.1",
205
+ "react-dom": "18.3.1",
206
+ "react-hook-form": "7.74.0",
207
+ "storybook": "10.3.5"
195
208
  },
196
209
  "devDependencies": {
197
- "@babel/cli": "^7.28.6",
210
+ "@babel/cli": "7.28.6",
198
211
  "@babel/core": "7.29.6",
199
- "@babel/eslint-parser": "^7.28.6",
200
- "@babel/eslint-plugin": "^7.27.1",
201
- "@babel/plugin-syntax-jsx": "^7.28.6",
202
- "@babel/plugin-transform-class-properties": "^7.28.6",
203
- "@babel/plugin-transform-modules-commonjs": "^7.28.6",
204
- "@babel/plugin-transform-runtime": "^7.29.0",
205
- "@babel/preset-env": "^7.29.2",
206
- "@babel/preset-react": "^7.28.5",
207
- "@babel/preset-typescript": "^7.28.5",
208
- "@babel/runtime": "^7.29.2",
209
- "@commitlint/cli": "^20.5.2",
210
- "@commitlint/config-conventional": "^20.5.0",
211
- "@eslint/js": "^9.39.4",
212
- "@jest/globals": "^29.7.0",
213
- "@jest/types": "^29.6.3",
214
- "@mdx-js/mdx": "^3.1.1",
215
- "@mdx-js/react": "^3.1.1",
216
- "@rollup/plugin-commonjs": "^28.0.9",
217
- "@rollup/plugin-node-resolve": "^16.0.3",
218
- "@rollup/plugin-typescript": "^12.3.0",
219
- "@semantic-release/changelog": "^6.0.3",
220
- "@semantic-release/commit-analyzer": "^13.0.1",
221
- "@semantic-release/exec": "^7.1.0",
222
- "@semantic-release/git": "^10.0.1",
223
- "@semantic-release/npm": "^12.0.2",
224
- "@semantic-release/release-notes-generator": "^14.1.0",
225
- "@storybook/addon-a11y": "^10.3.5",
226
- "@storybook/addon-docs": "^10.3.5",
227
- "@storybook/addon-knobs": "^8.0.1",
228
- "@storybook/addon-links": "^10.3.5",
229
- "@storybook/addon-styling-webpack": "^1.0.1",
230
- "@storybook/cli": "^10.3.5",
231
- "@storybook/core-events": "^8.6.14",
232
- "@storybook/manager-api": "^8.6.14",
233
- "@storybook/mdx2-csf": "^1.1.0",
234
- "@storybook/preset-scss": "^1.0.3",
235
- "@storybook/preview-api": "^8.6.14",
236
- "@storybook/react": "^10.3.5",
237
- "@storybook/react-webpack5": "^10.3.5",
238
- "@storybook/types": "^8.6.14",
239
- "@testing-library/jest-dom": "^6.9.1",
240
- "@testing-library/react": "^16.3.2",
241
- "@testing-library/user-event": "^14.6.1",
242
- "@types/enzyme": "^3.10.19",
243
- "@types/enzyme-adapter-react-16": "^1.0.9",
244
- "@types/jest": "^29.5.14",
245
- "@types/node": "^20.19.39",
246
- "@types/react": "^18.3.28",
247
- "@types/react-dom": "^18.3.7",
248
- "@types/react-helmet": "^6.1.11",
249
- "@types/webpack": "^5.28.5",
250
- "@types/webpack-env": "^1.18.8",
251
- "@typescript-eslint/eslint-plugin": "^8.59.1",
252
- "@typescript-eslint/parser": "^8.59.1",
253
- "@x15stack/aws": "^1.6.5",
254
- "autoprefixer": "^10.5.0",
255
- "babel-jest": "^30.3.0",
256
- "babel-loader": "^9.2.1",
257
- "babel-plugin-macros": "^3.1.0",
258
- "chromatic": "^11.29.0",
259
- "commitlint": "^20.5.3",
260
- "copy-webpack-plugin": "^12.0.2",
261
- "cors": "^2.8.6",
262
- "cross-env": "^7.0.3",
263
- "css-loader": "^7.1.4",
264
- "enzyme": "^3.11.0",
265
- "enzyme-adapter-react-16": "^1.15.8",
266
- "esbuild": "^0.25.12",
267
- "esbuild-sass-plugin": "^3.7.0",
268
- "eslint": "^9.39.4",
269
- "eslint-import-resolver-typescript": "^3.10.1",
270
- "eslint-plugin-import": "^2.32.0",
271
- "eslint-plugin-jest": "^28.14.0",
272
- "eslint-plugin-jsx-a11y": "^6.10.2",
273
- "eslint-plugin-react": "^7.37.5",
212
+ "@babel/eslint-parser": "7.28.6",
213
+ "@babel/eslint-plugin": "7.27.1",
214
+ "@babel/plugin-syntax-jsx": "7.28.6",
215
+ "@babel/plugin-transform-class-properties": "7.28.6",
216
+ "@babel/plugin-transform-modules-commonjs": "7.28.6",
217
+ "@babel/plugin-transform-runtime": "7.29.0",
218
+ "@babel/preset-env": "7.29.2",
219
+ "@babel/preset-react": "7.28.5",
220
+ "@babel/preset-typescript": "7.28.5",
221
+ "@babel/runtime": "7.29.2",
222
+ "@commitlint/cli": "20.5.2",
223
+ "@commitlint/config-conventional": "20.5.0",
224
+ "@eslint/js": "9.39.4",
225
+ "@jest/globals": "29.7.0",
226
+ "@jest/types": "29.6.3",
227
+ "@mdx-js/mdx": "3.1.1",
228
+ "@mdx-js/react": "3.1.1",
229
+ "@rollup/plugin-commonjs": "28.0.9",
230
+ "@rollup/plugin-node-resolve": "16.0.3",
231
+ "@rollup/plugin-typescript": "12.3.0",
232
+ "@semantic-release/changelog": "6.0.3",
233
+ "@semantic-release/commit-analyzer": "13.0.1",
234
+ "@semantic-release/exec": "7.1.0",
235
+ "@semantic-release/git": "10.0.1",
236
+ "@semantic-release/npm": "12.0.2",
237
+ "@semantic-release/release-notes-generator": "14.1.0",
238
+ "@storybook/addon-a11y": "10.3.5",
239
+ "@storybook/addon-docs": "10.3.5",
240
+ "@storybook/addon-knobs": "8.0.1",
241
+ "@storybook/addon-links": "10.3.5",
242
+ "@storybook/addon-styling-webpack": "1.0.1",
243
+ "@storybook/cli": "10.3.5",
244
+ "@storybook/core-events": "8.6.14",
245
+ "@storybook/manager-api": "8.6.14",
246
+ "@storybook/mdx2-csf": "1.1.0",
247
+ "@storybook/preset-scss": "1.0.3",
248
+ "@storybook/preview-api": "8.6.14",
249
+ "@storybook/react": "10.3.5",
250
+ "@storybook/react-webpack5": "10.3.5",
251
+ "@storybook/types": "8.6.14",
252
+ "@testing-library/jest-dom": "6.9.1",
253
+ "@testing-library/react": "16.3.2",
254
+ "@testing-library/user-event": "14.6.1",
255
+ "@types/enzyme": "3.10.19",
256
+ "@types/enzyme-adapter-react-16": "1.0.9",
257
+ "@types/jest": "29.5.14",
258
+ "@types/node": "20.19.39",
259
+ "@types/react": "18.3.28",
260
+ "@types/react-dom": "18.3.7",
261
+ "@types/react-helmet": "6.1.11",
262
+ "@types/webpack": "5.28.5",
263
+ "@types/webpack-env": "1.18.8",
264
+ "@typescript-eslint/eslint-plugin": "8.59.1",
265
+ "@typescript-eslint/parser": "8.59.1",
266
+ "@x15stack/aws": "1.7.2",
267
+ "autoprefixer": "10.5.0",
268
+ "babel-jest": "30.3.0",
269
+ "babel-loader": "9.2.1",
270
+ "babel-plugin-macros": "3.1.0",
271
+ "chromatic": "11.29.0",
272
+ "commitlint": "20.5.3",
273
+ "copy-webpack-plugin": "12.0.2",
274
+ "cors": "2.8.6",
275
+ "cross-env": "7.0.3",
276
+ "css-loader": "7.1.4",
277
+ "enzyme": "3.11.0",
278
+ "enzyme-adapter-react-16": "1.15.8",
279
+ "esbuild": "0.25.12",
280
+ "esbuild-sass-plugin": "3.7.0",
281
+ "eslint": "9.39.4",
282
+ "eslint-import-resolver-typescript": "4.4.5",
283
+ "eslint-plugin-import": "2.32.0",
284
+ "eslint-plugin-jest": "28.14.0",
285
+ "eslint-plugin-jsx-a11y": "6.10.2",
286
+ "eslint-plugin-react": "7.37.5",
274
287
  "eslint-plugin-storybook": "10.1.10",
275
- "express": "^5.2.1",
276
- "file-loader": "^6.2.0",
288
+ "express": "5.2.1",
289
+ "file-loader": "6.2.0",
277
290
  "fs": "0.0.1-security",
278
- "fs-extra": "^11.3.4",
279
- "glob": "^13.0.6",
280
- "globals": "^15.15.0",
281
- "jest": "^30.3.0",
282
- "jest-environment-jsdom": "^29.7.0",
283
- "lefthook": "^1.13.6",
284
- "minimatch": "^10.2.5",
285
- "nodemon": "^3.1.14",
286
- "npm-run-all": "^4.1.5",
287
- "null-loader": "^4.0.1",
288
- "postcss": "^8.5.12",
289
- "postcss-loader": "^8.2.1",
290
- "raw-loader": "^4.0.2",
291
- "react-docgen-typescript": "^2.4.0",
292
- "react-docgen-typescript-loader": "^3.7.2",
293
- "react-dropzone": "^14.4.1",
294
- "sass": "^1.99.0",
295
- "sass-loader": "^16.0.7",
296
- "semantic-release": "^24.2.9",
297
- "style-loader": "^4.0.0",
298
- "ts-jest": "^29.4.9",
299
- "ts-morph": "^25.0.1",
300
- "tsconfig-paths-webpack-plugin": "^4.2.0",
301
- "ttab": "^0.9.0",
291
+ "fs-extra": "11.3.4",
292
+ "glob": "13.0.6",
293
+ "globals": "15.15.0",
294
+ "jest": "30.3.0",
295
+ "jest-environment-jsdom": "29.7.0",
296
+ "lefthook": "1.13.6",
297
+ "minimatch": "9.0.7",
298
+ "nodemon": "3.1.14",
299
+ "npm-run-all": "4.1.5",
300
+ "null-loader": "4.0.1",
301
+ "postcss": "8.5.23",
302
+ "postcss-loader": "8.2.1",
303
+ "raw-loader": "4.0.2",
304
+ "react-docgen-typescript": "2.4.0",
305
+ "react-docgen-typescript-loader": "3.7.2",
306
+ "react-dropzone": "14.4.1",
307
+ "react-hook-form": "7.74.0",
308
+ "sass": "1.99.0",
309
+ "sass-loader": "16.0.7",
310
+ "semantic-release": "24.2.9",
311
+ "style-loader": "4.0.0",
312
+ "ts-jest": "29.4.9",
313
+ "ts-morph": "25.0.1",
314
+ "tsconfig-paths-webpack-plugin": "4.2.0",
315
+ "ttab": "0.9.0",
302
316
  "typescript": "5.5.4",
303
- "url-loader": "^4.1.1",
304
- "vitest": "3.2.6"
305
- },
306
- "pnpm": {
307
- "overrides": {
308
- "@babel/plugin-transform-modules-systemjs": "7.29.4",
309
- "@tootallnate/once@<3.0.1": ">=3.0.1",
310
- "brace-expansion": "5.0.6",
311
- "fast-uri": "3.1.2",
312
- "form-data": "4.0.6",
313
- "flatted": ">=3.4.2",
314
- "flatted@<3.4.0": ">=3.4.0",
315
- "handlebars": ">=4.7.9",
316
- "immutable@>=5.0.0 <5.1.5": ">=5.1.5",
317
- "js-yaml": "4.2.0",
318
- "minimatch": "9.0.7",
319
- "path-to-regexp": ">=8.4.0",
320
- "picomatch": ">=4.0.4",
321
- "qs": "6.15.2",
322
- "rollup": ">=4.59.0",
323
- "serialize-javascript": ">=7.0.3",
324
- "shell-quote": "1.8.4",
325
- "storybook": ">=10.2.10",
326
- "undici": "8.5.0",
327
- "uuid": "11.1.1",
328
- "vite": "6.4.3",
329
- "webpack": ">=5.104.1",
330
- "ws": "8.21.0",
331
- "yaml": ">=1.10.3"
332
- }
317
+ "url-loader": "4.1.1",
318
+ "vitest": "4.1.11"
333
319
  }
334
320
  }
@@ -1928,31 +1928,6 @@ form select:placeholder-shown {
1928
1928
  font-weight: 200;
1929
1929
  font-family: var(--bodyFont);
1930
1930
  }
1931
- form .textareaFieldContainer {
1932
- display: flex;
1933
- flex-direction: column;
1934
- row-gap: 5px;
1935
- align-items: stretch;
1936
- justify-content: flex-start;
1937
- width: 100%;
1938
- }
1939
- form .textareaFooter {
1940
- min-height: 1.5em;
1941
- }
1942
- form .textarea_Field.stacked label .textareaFooter .validation {
1943
- position: static;
1944
- height: auto;
1945
- }
1946
- form .textarea_Field.withValidation label {
1947
- padding-bottom: 0;
1948
- }
1949
- form .textareaCharacterCount {
1950
- line-height: 1.5;
1951
- color: var(--inputLabelColor);
1952
- }
1953
- form .textareaCharacterCountExceeded {
1954
- color: var(--inputErrorColor);
1955
- }
1956
1931
  form input[type=number] {
1957
1932
  padding-right: 0;
1958
1933
  }
@@ -2064,6 +2039,28 @@ fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select
2064
2039
  opacity: 0.75;
2065
2040
  }
2066
2041
 
2042
+ /* Autofill detection: browsers trigger onAnimationStart when autofill occurs */
2043
+ /* This animation is used to detect autofill events in browsers */
2044
+ @keyframes onAutoFill {
2045
+ from {
2046
+ opacity: 0.99;
2047
+ }
2048
+ to {
2049
+ opacity: 1;
2050
+ }
2051
+ }
2052
+ input:-webkit-autofill {
2053
+ animation-name: onAutoFill;
2054
+ animation-duration: 0.001s;
2055
+ animation-fill-mode: both;
2056
+ }
2057
+
2058
+ textarea:-webkit-autofill {
2059
+ animation-name: onAutoFill;
2060
+ animation-duration: 0.001s;
2061
+ animation-fill-mode: both;
2062
+ }
2063
+
2067
2064
  @font-face {
2068
2065
  font-family: "icomoon";
2069
2066
  src: url("../icons/fonts/icomoon.ttf?wbxtd8") format("truetype"), url("../icons/fonts/icomoon.woff?wbxtd8") format("woff"), url("../icons/fonts/icomoon.svg?wbxtd8#icomoon") format("svg");
@@ -1262,31 +1262,6 @@ form select:placeholder-shown {
1262
1262
  font-weight: 200;
1263
1263
  font-family: var(--bodyFont);
1264
1264
  }
1265
- form .textareaFieldContainer {
1266
- display: flex;
1267
- flex-direction: column;
1268
- row-gap: 5px;
1269
- align-items: stretch;
1270
- justify-content: flex-start;
1271
- width: 100%;
1272
- }
1273
- form .textareaFooter {
1274
- min-height: 1.5em;
1275
- }
1276
- form .textarea_Field.stacked label .textareaFooter .validation {
1277
- position: static;
1278
- height: auto;
1279
- }
1280
- form .textarea_Field.withValidation label {
1281
- padding-bottom: 0;
1282
- }
1283
- form .textareaCharacterCount {
1284
- line-height: 1.5;
1285
- color: var(--inputLabelColor);
1286
- }
1287
- form .textareaCharacterCountExceeded {
1288
- color: var(--inputErrorColor);
1289
- }
1290
1265
  form input[type=number] {
1291
1266
  padding-right: 0;
1292
1267
  }
@@ -1396,4 +1371,26 @@ label.keyValuePair .value {
1396
1371
  fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select, fieldset[disabled] button, fieldset[disabled] .radioLabel {
1397
1372
  cursor: not-allowed;
1398
1373
  opacity: 0.75;
1374
+ }
1375
+
1376
+ /* Autofill detection: browsers trigger onAnimationStart when autofill occurs */
1377
+ /* This animation is used to detect autofill events in browsers */
1378
+ @keyframes onAutoFill {
1379
+ from {
1380
+ opacity: 0.99;
1381
+ }
1382
+ to {
1383
+ opacity: 1;
1384
+ }
1385
+ }
1386
+ input:-webkit-autofill {
1387
+ animation-name: onAutoFill;
1388
+ animation-duration: 0.001s;
1389
+ animation-fill-mode: both;
1390
+ }
1391
+
1392
+ textarea:-webkit-autofill {
1393
+ animation-name: onAutoFill;
1394
+ animation-duration: 0.001s;
1395
+ animation-fill-mode: both;
1399
1396
  }
@@ -261,31 +261,6 @@ form select:placeholder-shown {
261
261
  font-weight: 200;
262
262
  font-family: var(--bodyFont);
263
263
  }
264
- form .textareaFieldContainer {
265
- display: flex;
266
- flex-direction: column;
267
- row-gap: 5px;
268
- align-items: stretch;
269
- justify-content: flex-start;
270
- width: 100%;
271
- }
272
- form .textareaFooter {
273
- min-height: 1.5em;
274
- }
275
- form .textarea_Field.stacked label .textareaFooter .validation {
276
- position: static;
277
- height: auto;
278
- }
279
- form .textarea_Field.withValidation label {
280
- padding-bottom: 0;
281
- }
282
- form .textareaCharacterCount {
283
- line-height: 1.5;
284
- color: var(--inputLabelColor);
285
- }
286
- form .textareaCharacterCountExceeded {
287
- color: var(--inputErrorColor);
288
- }
289
264
  form input[type=number] {
290
265
  padding-right: 0;
291
266
  }
@@ -395,4 +370,26 @@ label.keyValuePair .value {
395
370
  fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select, fieldset[disabled] button, fieldset[disabled] .radioLabel {
396
371
  cursor: not-allowed;
397
372
  opacity: 0.75;
373
+ }
374
+
375
+ /* Autofill detection: browsers trigger onAnimationStart when autofill occurs */
376
+ /* This animation is used to detect autofill events in browsers */
377
+ @keyframes onAutoFill {
378
+ from {
379
+ opacity: 0.99;
380
+ }
381
+ to {
382
+ opacity: 1;
383
+ }
384
+ }
385
+ input:-webkit-autofill {
386
+ animation-name: onAutoFill;
387
+ animation-duration: 0.001s;
388
+ animation-fill-mode: both;
389
+ }
390
+
391
+ textarea:-webkit-autofill {
392
+ animation-name: onAutoFill;
393
+ animation-duration: 0.001s;
394
+ animation-fill-mode: both;
398
395
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DemoContactForm.d.ts","sourceRoot":"","sources":["../../../src/exampleUIs/exampleComponents/DemoContactForm.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAW7C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC;IAC/B,cAAc,EAAE,eAAe,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;CACzB,CAoHA,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"DemoContactForm.d.ts","sourceRoot":"","sources":["../../../src/exampleUIs/exampleComponents/DemoContactForm.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAW7C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC;IAC/B,cAAc,EAAE,eAAe,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;CACzB,CAmHA,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -5,6 +5,6 @@ export type { NamePieces } from './dataHelpers';
5
5
  export { dateToShortIsoString, isValidDate, dateToShortReadableDate, dateToShortReadableMonth, timeStampToShortReadableDate, dateToReadableTime, dateToShortReadableDateTime, getLastDateOfMonth, daysSince } from './dateHelpers';
6
6
  export { USER_CURRENCY, intlCurrencyFormatter, intlNumberFormatter, formatNumberForLocale, formatAsCurrencyForLocale, getNumberAbbreviation, formatRoundedNumberWithAbbreviation, formatNumberWithAbbreviation, formatNumberForChartAxis, formatAsSimpleCurrencyForChartAxis, formatAsInternationalCurrencyForChartAxis, formatAsCurrencyWithAbbreviation, formatFileSize } from './formatters';
7
7
  export { getRandomNumberBelow, getRandomBetweenInclusive, getRandomBetweenExclusive, hashCode, roundToDecimal, formatNumberToMinDigits, formatDigitalTime } from './numberHelpers';
8
- export { richTextParser, capitalize, capitalizeFirstLetter, lowerCaseFirstLetter, useAnInsteadOfA, splitCamelCase, pluralize, pluralizeIfNeeded, getInitialsOrAcronym } from './stringHelpers';
8
+ export { richTextParser, capitalize, capitalizeFirstLetter, lowerCaseFirstLetter, getCharacterCount, clampToGraphemeMax, useAnInsteadOfA, splitCamelCase, pluralize, pluralizeIfNeeded, getInitialsOrAcronym } from './stringHelpers';
9
9
  export { objectsAreTheSame, isAnObject, createCompareValueOverride, deepMergeObjects, overrideMergeObjects, makeInheritanceObject, updateNestedProperty, filterObject, getArrayOfObjectKeys, getArrayOfReadableObjectKeys, getBranchFromPath, deepRemoveProps } from './objectHelpers';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,SAAS,EACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,mCAAmC,EACnC,4BAA4B,EAC5B,wBAAwB,EACxB,kCAAkC,EAClC,yCAAyC,EACzC,gCAAgC,EAChC,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,SAAS,EACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,mCAAmC,EACnC,4BAA4B,EAC5B,wBAAwB,EACxB,kCAAkC,EAClC,yCAAyC,EACzC,gCAAgC,EAChC,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC"}
@@ -21,6 +21,23 @@ export declare const capitalizeFirstLetter: (pString: string) => string;
21
21
  * @returns {string} The string with the first letter converted to lowercase, or the unchanged pString if it's not a string.
22
22
  */
23
23
  export declare const lowerCaseFirstLetter: (pString: string) => string;
24
+ /**
25
+ * Counts user-perceived characters (grapheme clusters) so emojis and composed
26
+ * characters such as accented letters count as one.
27
+ *
28
+ * @param {string} pString - A string of text.
29
+ * @returns {number} The number of grapheme clusters, falling back to code points where Intl.Segmenter is unavailable.
30
+ */
31
+ export declare const getCharacterCount: (pString: string) => number;
32
+ /**
33
+ * Truncates a string to a maximum number of grapheme clusters without splitting
34
+ * an emoji or composed character in half.
35
+ *
36
+ * @param {string} pString - A string of text.
37
+ * @param {number} maxAllowed - The maximum number of user-perceived characters to keep.
38
+ * @returns {string} The truncated string, or the unchanged pString if it is already within the limit.
39
+ */
40
+ export declare const clampToGraphemeMax: (pString: string, maxAllowed: number) => string;
24
41
  /**
25
42
  * Determines if "an" should be used instead of "a" before the given word.
26
43
  *