@x15ventures/x15-ui-library 3.15.0 → 3.16.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 (145) 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/design/tooltip/Tooltip.js +67 -15
  10. package/dist/cjs/components/design/tooltip/Tooltip.js.map +1 -1
  11. package/dist/cjs/components/design/tooltip/tooltip.css +1 -1
  12. package/dist/cjs/components/form/formFields/formFieldWrapper/FormField.js +8 -5
  13. package/dist/cjs/components/form/formFields/formFieldWrapper/FormField.js.map +1 -1
  14. package/dist/cjs/components/form/formFields/formFieldWrapper/formFieldProps.js.map +1 -1
  15. package/dist/cjs/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.js +15 -11
  16. package/dist/cjs/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.js.map +1 -1
  17. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js +37 -15
  18. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js.map +1 -1
  19. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/inputCheckbox.css +4 -4
  20. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.js.map +1 -1
  21. package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +9 -9
  22. package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
  23. package/dist/cjs/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.js +14 -4
  24. package/dist/cjs/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.js.map +1 -1
  25. package/dist/cjs/components/form/formFields/subComponents/inputs/text/InputText.js +23 -17
  26. package/dist/cjs/components/form/formFields/subComponents/inputs/text/InputText.js.map +1 -1
  27. package/dist/cjs/components/form/formFields/subComponents/select/Select.js +6 -5
  28. package/dist/cjs/components/form/formFields/subComponents/select/Select.js.map +1 -1
  29. package/dist/cjs/components/form/formFields/subComponents/textarea/Textarea.js +55 -83
  30. package/dist/cjs/components/form/formFields/subComponents/textarea/Textarea.js.map +1 -1
  31. package/dist/cjs/components/form/formFields/subComponents/textarea/textarea.css +20 -0
  32. package/dist/cjs/components/form/hookFormWrapper/HookFormWrapper.js +22 -5
  33. package/dist/cjs/components/form/hookFormWrapper/HookFormWrapper.js.map +1 -1
  34. package/dist/cjs/components/form/validation/ValidationMessages.js +36 -38
  35. package/dist/cjs/components/form/validation/ValidationMessages.js.map +1 -1
  36. package/dist/cjs/exampleUIs/exampleComponents/DemoContactForm.js +1 -2
  37. package/dist/cjs/exampleUIs/exampleComponents/DemoContactForm.js.map +1 -1
  38. package/dist/cjs/helpers/index.js +12 -0
  39. package/dist/cjs/helpers/index.js.map +1 -1
  40. package/dist/cjs/helpers/stringHelpers.js +48 -2
  41. package/dist/cjs/helpers/stringHelpers.js.map +1 -1
  42. package/dist/cjs/hooks/EdgeProximityDetect.js +18 -10
  43. package/dist/cjs/hooks/EdgeProximityDetect.js.map +1 -1
  44. package/dist/cjs/interfaces/headerText.interface.js.map +1 -1
  45. package/dist/cjs/package.json +137 -151
  46. package/dist/cjs/styles/index.css +22 -25
  47. package/dist/cjs/styles/shared/_allPartials.css +22 -25
  48. package/dist/cjs/styles/shared/forms/_forms.css +22 -25
  49. package/dist/components/design/dialog/Dialog.d.ts.map +1 -1
  50. package/dist/components/design/dialog/Dialog.test.d.ts +5 -0
  51. package/dist/components/design/dialog/Dialog.test.d.ts.map +1 -0
  52. package/dist/components/design/headerBar/HeaderBar.d.ts.map +1 -1
  53. package/dist/components/design/tooltip/Tooltip.d.ts +2 -0
  54. package/dist/components/design/tooltip/Tooltip.d.ts.map +1 -1
  55. package/dist/components/design/tooltip/Tooltip.test.d.ts +2 -0
  56. package/dist/components/design/tooltip/Tooltip.test.d.ts.map +1 -0
  57. package/dist/components/form/formFields/formFieldWrapper/FormField.d.ts.map +1 -1
  58. package/dist/components/form/formFields/formFieldWrapper/formFieldProps.d.ts +7 -2
  59. package/dist/components/form/formFields/formFieldWrapper/formFieldProps.d.ts.map +1 -1
  60. package/dist/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.d.ts.map +1 -1
  61. package/dist/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.d.ts.map +1 -1
  62. package/dist/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.test.d.ts +5 -0
  63. package/dist/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.test.d.ts.map +1 -0
  64. package/dist/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.d.ts +8 -6
  65. package/dist/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.d.ts.map +1 -1
  66. package/dist/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.d.ts.map +1 -1
  67. package/dist/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.d.ts.map +1 -1
  68. package/dist/components/form/formFields/subComponents/inputs/text/InputText.d.ts.map +1 -1
  69. package/dist/components/form/formFields/subComponents/nestedFormContext.test.d.ts +5 -0
  70. package/dist/components/form/formFields/subComponents/nestedFormContext.test.d.ts.map +1 -0
  71. package/dist/components/form/formFields/subComponents/select/Select.d.ts.map +1 -1
  72. package/dist/components/form/formFields/subComponents/textarea/Textarea.d.ts +4 -3
  73. package/dist/components/form/formFields/subComponents/textarea/Textarea.d.ts.map +1 -1
  74. package/dist/components/form/hookFormWrapper/HookFormWrapper.d.ts +3 -0
  75. package/dist/components/form/hookFormWrapper/HookFormWrapper.d.ts.map +1 -1
  76. package/dist/components/form/hookFormWrapper/HookFormWrapper.test.d.ts +5 -0
  77. package/dist/components/form/hookFormWrapper/HookFormWrapper.test.d.ts.map +1 -0
  78. package/dist/components/form/validation/ValidationMessages.d.ts +8 -1
  79. package/dist/components/form/validation/ValidationMessages.d.ts.map +1 -1
  80. package/dist/components/form/validation/ValidationMessages.test.d.ts +5 -0
  81. package/dist/components/form/validation/ValidationMessages.test.d.ts.map +1 -0
  82. package/dist/esm/autoGenerated/libraryThemes.js +12 -12
  83. package/dist/esm/autoGenerated/libraryThemes.js.map +1 -1
  84. package/dist/esm/autoGenerated/libraryThemes.json +12 -12
  85. package/dist/esm/components/design/dialog/Dialog.js +1 -1
  86. package/dist/esm/components/design/dialog/Dialog.js.map +1 -1
  87. package/dist/esm/components/design/headerBar/HeaderBar.js +3 -1
  88. package/dist/esm/components/design/headerBar/HeaderBar.js.map +1 -1
  89. package/dist/esm/components/design/headerBar/headerBar.css +6 -1
  90. package/dist/esm/components/design/tooltip/Tooltip.js +67 -15
  91. package/dist/esm/components/design/tooltip/Tooltip.js.map +1 -1
  92. package/dist/esm/components/design/tooltip/tooltip.css +1 -1
  93. package/dist/esm/components/form/formFields/formFieldWrapper/FormField.js +8 -5
  94. package/dist/esm/components/form/formFields/formFieldWrapper/FormField.js.map +1 -1
  95. package/dist/esm/components/form/formFields/formFieldWrapper/formFieldProps.js.map +1 -1
  96. package/dist/esm/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.js +16 -12
  97. package/dist/esm/components/form/formFields/subComponents/inputs/autocomplete/Autocomplete.js.map +1 -1
  98. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js +37 -15
  99. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js.map +1 -1
  100. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/inputCheckbox.css +4 -4
  101. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.js.map +1 -1
  102. package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +8 -8
  103. package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
  104. package/dist/esm/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.js +16 -6
  105. package/dist/esm/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.js.map +1 -1
  106. package/dist/esm/components/form/formFields/subComponents/inputs/text/InputText.js +23 -17
  107. package/dist/esm/components/form/formFields/subComponents/inputs/text/InputText.js.map +1 -1
  108. package/dist/esm/components/form/formFields/subComponents/select/Select.js +6 -5
  109. package/dist/esm/components/form/formFields/subComponents/select/Select.js.map +1 -1
  110. package/dist/esm/components/form/formFields/subComponents/textarea/Textarea.js +50 -78
  111. package/dist/esm/components/form/formFields/subComponents/textarea/Textarea.js.map +1 -1
  112. package/dist/esm/components/form/formFields/subComponents/textarea/textarea.css +20 -0
  113. package/dist/esm/components/form/hookFormWrapper/HookFormWrapper.js +22 -5
  114. package/dist/esm/components/form/hookFormWrapper/HookFormWrapper.js.map +1 -1
  115. package/dist/esm/components/form/validation/ValidationMessages.js +36 -38
  116. package/dist/esm/components/form/validation/ValidationMessages.js.map +1 -1
  117. package/dist/esm/exampleUIs/exampleComponents/DemoContactForm.js +1 -2
  118. package/dist/esm/exampleUIs/exampleComponents/DemoContactForm.js.map +1 -1
  119. package/dist/esm/helpers/index.js +1 -1
  120. package/dist/esm/helpers/index.js.map +1 -1
  121. package/dist/esm/helpers/stringHelpers.js +44 -0
  122. package/dist/esm/helpers/stringHelpers.js.map +1 -1
  123. package/dist/esm/hooks/EdgeProximityDetect.js +19 -11
  124. package/dist/esm/hooks/EdgeProximityDetect.js.map +1 -1
  125. package/dist/esm/interfaces/headerText.interface.js.map +1 -1
  126. package/dist/esm/package.json +137 -151
  127. package/dist/esm/styles/index.css +22 -25
  128. package/dist/esm/styles/shared/_allPartials.css +22 -25
  129. package/dist/esm/styles/shared/forms/_forms.css +22 -25
  130. package/dist/exampleUIs/exampleComponents/DemoContactForm.d.ts.map +1 -1
  131. package/dist/helpers/index.d.ts +1 -1
  132. package/dist/helpers/index.d.ts.map +1 -1
  133. package/dist/helpers/stringHelpers.d.ts +17 -0
  134. package/dist/helpers/stringHelpers.d.ts.map +1 -1
  135. package/dist/hooks/EdgeProximityDetect.d.ts.map +1 -1
  136. package/dist/interfaces/headerText.interface.d.ts +1 -0
  137. package/dist/interfaces/headerText.interface.d.ts.map +1 -1
  138. package/dist/package.json +137 -151
  139. package/package.json +137 -151
  140. package/dist/cjs/components/form/formFields/utilities/formUtilities.js +0 -22
  141. package/dist/cjs/components/form/formFields/utilities/formUtilities.js.map +0 -1
  142. package/dist/components/form/formFields/utilities/formUtilities.d.ts +0 -18
  143. package/dist/components/form/formFields/utilities/formUtilities.d.ts.map +0 -1
  144. package/dist/esm/components/form/formFields/utilities/formUtilities.js +0 -16
  145. package/dist/esm/components/form/formFields/utilities/formUtilities.js.map +0 -1
@@ -1,23 +1,25 @@
1
- import { Message, Validate, ValidationRule } from 'react-hook-form';
2
- import { CustomContentProps, CustomFieldCssClassesProps, FieldProps, FormFieldProps, LabelProps } from '../../../formFieldWrapper/formFieldProps';
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { CustomContentProps, CustomFieldCssClassesProps, FieldProps, FormFieldProps, LabelProps, ValidationProps } from '../../../formFieldWrapper/formFieldProps';
3
3
  export interface InputCheckboxLabelProps extends Omit<LabelProps, 'hide' | 'position'> {
4
4
  position?: 'left' | 'right';
5
5
  }
6
+ export interface InputCheckboxIconsProps {
7
+ checked: string | ReactNode | ReactElement;
8
+ unchecked: string | ReactNode | ReactElement;
9
+ }
6
10
  export interface InputCheckboxFieldProps extends Omit<FieldProps, 'type' | 'placeholder' | 'value' | 'defaultValue' | 'referenceDate' | 'includeEmptyOption' | 'options'> {
7
11
  value: boolean | string;
8
12
  defaultChecked?: boolean;
9
13
  defaultValue?: boolean | string | number | readonly string[];
10
14
  }
11
- export interface InputCheckboxValidationProps<TFieldValue = unknown, TFormValues = unknown> {
12
- required?: Message | ValidationRule<boolean>;
13
- validate?: Validate<TFieldValue, TFormValues> | Record<string, Validate<TFieldValue, TFormValues>>;
14
- [key: string]: Message | ValidationRule<RegExp> | ValidationRule<number | string | boolean> | Validate<TFieldValue, TFormValues> | Record<string, Validate<TFieldValue, TFormValues>> | undefined;
15
+ export interface InputCheckboxValidationProps<TFieldValue = unknown, TFormValues = unknown> extends Omit<ValidationProps<TFieldValue, TFormValues>, 'validate'> {
15
16
  }
16
17
  export interface InputCheckboxProps extends Omit<FormFieldProps, 'label' | 'field' | 'layout' | 'validation'> {
17
18
  label: InputCheckboxLabelProps;
18
19
  field: InputCheckboxFieldProps;
19
20
  validation?: InputCheckboxValidationProps;
20
21
  showSpinner?: boolean;
22
+ icons?: InputCheckboxIconsProps;
21
23
  customCssClasses?: CustomFieldCssClassesProps;
22
24
  customContent?: CustomContentProps;
23
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"inputCheckboxProps.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,UAAU,EACV,cAAc,EACd,UAAU,EACX,MAAM,0CAA0C,CAAC;AAElD,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;IACpF,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,cAAc,GAAG,eAAe,GAAG,oBAAoB,GAAG,SAAS,CAAC;IACvK,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CAC9D;AAED,MAAM,WAAW,4BAA4B,CAAC,WAAW,GAAG,OAAO,EAAE,WAAW,GAAG,OAAO;IACxF,QAAQ,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IACnG,CAAC,GAAG,EAAE,MAAM,GACR,OAAO,GACP,cAAc,CAAC,MAAM,CAAC,GACtB,cAAc,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GACzC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,GAClD,SAAS,CAAC;CACf;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;IAC3G,KAAK,EAAE,uBAAuB,CAAC;IAC/B,KAAK,EAAE,uBAAuB,CAAC;IAC/B,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;IAC9C,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACpC"}
1
+ {"version":3,"file":"inputCheckboxProps.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA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,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DragAndDropFileUpload.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAY5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAO/D,OAAO,8BAA8B,CAAC;AAEtC,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAkOtE,CAAC;;;;AAEF,wBAAyC"}
1
+ {"version":3,"file":"DragAndDropFileUpload.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAW5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAO/D,OAAO,8BAA8B,CAAC;AAEtC,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAItE,CAAC;;;;AAoOF,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StyledRadioGroup.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAO5D,OAAO,yBAAyB,CAAC;AAEjC,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAkF5D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"StyledRadioGroup.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/form/formFields/subComponents/inputs/radio/styled/StyledRadioGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAO5D,OAAO,yBAAyB,CAAC;AAEjC,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAuF5D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputText.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/form/formFields/subComponents/inputs/text/InputText.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAiB,MAAM,0CAA0C,CAAC;AAIzF,MAAM,WAAW,cAAe,SAAQ,cAAc,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;CAAI;AAEvG,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA8G9C,CAAC"}
1
+ {"version":3,"file":"InputText.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/form/formFields/subComponents/inputs/text/InputText.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAiB,MAAM,0CAA0C,CAAC;AAGzF,MAAM,WAAW,cAAe,SAAQ,cAAc,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;CAAI;AAEvG,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA+G9C,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import '@testing-library/jest-dom';
5
+ //# sourceMappingURL=nestedFormContext.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestedFormContext.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/formFields/subComponents/nestedFormContext.test.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/formFields/subComponents/select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EACL,UAAU,EACV,cAAc,EAGf,MAAM,uCAAuC,CAAC;AAG/C,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IAC/G,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgGxC,CAAC"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/formFields/subComponents/select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EACL,UAAU,EACV,cAAc,EAGf,MAAM,uCAAuC,CAAC;AAE/C,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IAC/G,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;CACjC;AAmGD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAIxC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- import { FormFieldProps } from '../../formFieldWrapper/formFieldProps';
3
- interface TextareaProps extends FormFieldProps, React.TextareaHTMLAttributes<HTMLTextAreaElement> {
2
+ import { FormFieldProps, TextareaFieldProps } from '../../formFieldWrapper/formFieldProps';
3
+ import './textarea.scss';
4
+ export interface TextareaProps extends Omit<FormFieldProps, 'field'> {
5
+ field: Omit<TextareaFieldProps, 'type'>;
4
6
  }
5
7
  export declare const Textarea: React.FC<TextareaProps>;
6
- export {};
7
8
  //# sourceMappingURL=Textarea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/formFields/subComponents/textarea/Textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAIvE,UAAU,aAAc,SAAQ,cAAc,EAAE,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC;CAAG;AAoCpG,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoO5C,CAAC"}
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/formFields/subComponents/textarea/Textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EACL,cAAc,EACd,kBAAkB,EACnB,MAAM,uCAAuC,CAAC;AAI/C,OAAO,iBAAiB,CAAC;AAEzB,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IAClE,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAI5C,CAAC"}
@@ -1,8 +1,11 @@
1
1
  import React, { ReactNode, ReactElement, FormHTMLAttributes } from 'react';
2
+ import { FieldValues, UseFormReturn } from 'react-hook-form';
2
3
  interface FormWrapperProps {
3
4
  formCssClass?: string;
4
5
  formProps?: FormHTMLAttributes<HTMLFormElement>;
5
6
  children: ReactNode | ReactElement;
7
+ formContext?: UseFormReturn<FieldValues, any, FieldValues>;
8
+ onSubmit?: (values: FieldValues) => void | Promise<void>;
6
9
  }
7
10
  export declare const HookFormWrapper: React.FC<FormWrapperProps>;
8
11
  export default HookFormWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"HookFormWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hookFormWrapper/HookFormWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAG3E,UAAU,gBAAgB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAChD,QAAQ,EAAE,SAAS,GAAG,YAAY,CAAC;CACpC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4BtD,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"HookFormWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hookFormWrapper/HookFormWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAyC,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEpG,UAAU,gBAAgB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAChD,QAAQ,EAAE,SAAS,GAAG,YAAY,CAAC;IACnC,WAAW,CAAC,EAAE,aAAa,CAAC,WAAW,EAAE,GAAG,EAAE,WAAW,CAAC,CAAA;IAE1D,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoDtD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import '@testing-library/jest-dom';
5
+ //# sourceMappingURL=HookFormWrapper.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HookFormWrapper.test.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hookFormWrapper/HookFormWrapper.test.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,2BAA2B,CAAC"}
@@ -2,7 +2,14 @@ import React from 'react';
2
2
  import { FieldError, FieldErrors, FieldErrorsImpl, Merge } from 'react-hook-form';
3
3
  import { ValidationProps } from '../formFields/formFieldWrapper/formFieldProps';
4
4
  import { InputCheckboxValidationProps } from '../formFields/subComponents/inputs/checkbox/inputCheckboxProps';
5
- export declare const GenericErrorMessages: Record<string, (value?: never) => string>;
5
+ export declare const GenericErrorMessages: {
6
+ required: string;
7
+ minLength: string;
8
+ maxLength: string;
9
+ min: string;
10
+ max: string;
11
+ unknown: string;
12
+ };
6
13
  export declare const extractError: (errors: FieldErrors, fieldName: string) => FieldError | Merge<FieldError, FieldErrorsImpl<never>> | undefined;
7
14
  interface ValidationMessagesProps {
8
15
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationMessages.d.ts","sourceRoot":"","sources":["../../../../src/components/form/validation/ValidationMessages.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,KAAK,EACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EAChB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gEAAgE,CAAC;AAG9G,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,MAAM,CAO1E,CAAC;AAGF,eAAO,MAAM,YAAY,WACf,WAAW,aACR,MAAM,KAChB,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,GAAG,SAiB3D,CAAC;AAEF,UAAU,uBAAuB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,eAAe,GAAG,4BAA4B,CAAA;CAC5D;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAmDhE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ValidationMessages.d.ts","sourceRoot":"","sources":["../../../../src/components/form/validation/ValidationMessages.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,KAAK,EAGN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EAChB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gEAAgE,CAAC;AAG9G,eAAO,MAAM,oBAAoB;;;;;;;CAOhC,CAAC;AAmCF,eAAO,MAAM,YAAY,WACf,WAAW,aACR,MAAM,KAChB,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,GAAG,SAiB3D,CAAC;AAEF,UAAU,uBAAuB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,eAAe,GAAG,4BAA4B,CAAA;CAC5D;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA8ChE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import '@testing-library/jest-dom';
5
+ //# sourceMappingURL=ValidationMessages.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationMessages.test.d.ts","sourceRoot":"","sources":["../../../../src/components/form/validation/ValidationMessages.test.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,2BAA2B,CAAC"}
@@ -11,8 +11,8 @@ export const libraryThemes = {
11
11
  "map": "index.min.css.map"
12
12
  },
13
13
  "versioned": {
14
- "css": "index.min.3.15.0.css",
15
- "map": "index.min.3.15.0.css.map"
14
+ "css": "index.min.3.16.0.css",
15
+ "map": "index.min.3.16.0.css.map"
16
16
  }
17
17
  },
18
18
  "cba": {
@@ -26,8 +26,8 @@ export const libraryThemes = {
26
26
  "map": "cba.min.css.map"
27
27
  },
28
28
  "versioned": {
29
- "css": "cba.min.3.15.0.css",
30
- "map": "cba.min.3.15.0.css.map"
29
+ "css": "cba.min.3.16.0.css",
30
+ "map": "cba.min.3.16.0.css.map"
31
31
  }
32
32
  },
33
33
  "creditSavvy": {
@@ -41,8 +41,8 @@ export const libraryThemes = {
41
41
  "map": "creditSavvy.min.css.map"
42
42
  },
43
43
  "versioned": {
44
- "css": "creditSavvy.min.3.15.0.css",
45
- "map": "creditSavvy.min.3.15.0.css.map"
44
+ "css": "creditSavvy.min.3.16.0.css",
45
+ "map": "creditSavvy.min.3.16.0.css.map"
46
46
  }
47
47
  },
48
48
  "doshii": {
@@ -56,8 +56,8 @@ export const libraryThemes = {
56
56
  "map": "doshii.min.css.map"
57
57
  },
58
58
  "versioned": {
59
- "css": "doshii.min.3.15.0.css",
60
- "map": "doshii.min.3.15.0.css.map"
59
+ "css": "doshii.min.3.16.0.css",
60
+ "map": "doshii.min.3.16.0.css.map"
61
61
  }
62
62
  },
63
63
  "homeIn": {
@@ -71,8 +71,8 @@ export const libraryThemes = {
71
71
  "map": "homeIn.min.css.map"
72
72
  },
73
73
  "versioned": {
74
- "css": "homeIn.min.3.15.0.css",
75
- "map": "homeIn.min.3.15.0.css.map"
74
+ "css": "homeIn.min.3.16.0.css",
75
+ "map": "homeIn.min.3.16.0.css.map"
76
76
  }
77
77
  },
78
78
  "x15Core": {
@@ -86,8 +86,8 @@ export const libraryThemes = {
86
86
  "map": "x15Core.min.css.map"
87
87
  },
88
88
  "versioned": {
89
- "css": "x15Core.min.3.15.0.css",
90
- "map": "x15Core.min.3.15.0.css.map"
89
+ "css": "x15Core.min.3.16.0.css",
90
+ "map": "x15Core.min.3.16.0.css.map"
91
91
  }
92
92
  }
93
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"libraryThemes.js","names":["libraryThemes"],"sources":["../../../src/autoGenerated/libraryThemes.ts"],"sourcesContent":["/* eslint-disable */\nexport const libraryThemes = {\n \"base\": {\n \"buildPath\": \"styles\",\n \"dev\": {\n \"css\": \"index.css\",\n \"map\": \"index.css.map\"\n },\n \"min\": {\n \"css\": \"index.min.css\",\n \"map\": \"index.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"index.min.3.15.0.css\",\n \"map\": \"index.min.3.15.0.css.map\"\n }\n },\n \"cba\": {\n \"buildPath\": \"styles/themes/cba\",\n \"dev\": {\n \"css\": \"cba.css\",\n \"map\": \"cba.css.map\"\n },\n \"min\": {\n \"css\": \"cba.min.css\",\n \"map\": \"cba.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"cba.min.3.15.0.css\",\n \"map\": \"cba.min.3.15.0.css.map\"\n }\n },\n \"creditSavvy\": {\n \"buildPath\": \"styles/themes/creditSavvy\",\n \"dev\": {\n \"css\": \"creditSavvy.css\",\n \"map\": \"creditSavvy.css.map\"\n },\n \"min\": {\n \"css\": \"creditSavvy.min.css\",\n \"map\": \"creditSavvy.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"creditSavvy.min.3.15.0.css\",\n \"map\": \"creditSavvy.min.3.15.0.css.map\"\n }\n },\n \"doshii\": {\n \"buildPath\": \"styles/themes/doshii\",\n \"dev\": {\n \"css\": \"doshii.css\",\n \"map\": \"doshii.css.map\"\n },\n \"min\": {\n \"css\": \"doshii.min.css\",\n \"map\": \"doshii.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"doshii.min.3.15.0.css\",\n \"map\": \"doshii.min.3.15.0.css.map\"\n }\n },\n \"homeIn\": {\n \"buildPath\": \"styles/themes/homeIn\",\n \"dev\": {\n \"css\": \"homeIn.css\",\n \"map\": \"homeIn.css.map\"\n },\n \"min\": {\n \"css\": \"homeIn.min.css\",\n \"map\": \"homeIn.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"homeIn.min.3.15.0.css\",\n \"map\": \"homeIn.min.3.15.0.css.map\"\n }\n },\n \"x15Core\": {\n \"buildPath\": \"styles/themes/x15Core\",\n \"dev\": {\n \"css\": \"x15Core.css\",\n \"map\": \"x15Core.css.map\"\n },\n \"min\": {\n \"css\": \"x15Core.min.css\",\n \"map\": \"x15Core.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"x15Core.min.3.15.0.css\",\n \"map\": \"x15Core.min.3.15.0.css.map\"\n }\n }\n}; export default libraryThemes;"],"mappings":"AAAA;AACA,OAAO,MAAMA,aAAa,GAAG;EAC3B,MAAM,EAAE;IACN,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE;MACL,KAAK,EAAE,WAAW;MAClB,KAAK,EAAE;IACT,CAAC;IACD,KAAK,EAAE;MACL,KAAK,EAAE,eAAe;MACtB,KAAK,EAAE;IACT,CAAC;IACD,WAAW,EAAE;MACX,KAAK,EAAE,sBAAsB;MAC7B,KAAK,EAAE;IACT;EACF,CAAC;EACD,KAAK,EAAE;IACL,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE;MACL,KAAK,EAAE,SAAS;MAChB,KAAK,EAAE;IACT,CAAC;IACD,KAAK,EAAE;MACL,KAAK,EAAE,aAAa;MACpB,KAAK,EAAE;IACT,CAAC;IACD,WAAW,EAAE;MACX,KAAK,EAAE,oBAAoB;MAC3B,KAAK,EAAE;IACT;EACF,CAAC;EACD,aAAa,EAAE;IACb,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE;MACL,KAAK,EAAE,iBAAiB;MACxB,KAAK,EAAE;IACT,CAAC;IACD,KAAK,EAAE;MACL,KAAK,EAAE,qBAAqB;MAC5B,KAAK,EAAE;IACT,CAAC;IACD,WAAW,EAAE;MACX,KAAK,EAAE,4BAA4B;MACnC,KAAK,EAAE;IACT;EACF,CAAC;EACD,QAAQ,EAAE;IACR,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE;MACL,KAAK,EAAE,YAAY;MACnB,KAAK,EAAE;IACT,CAAC;IACD,KAAK,EAAE;MACL,KAAK,EAAE,gBAAgB;MACvB,KAAK,EAAE;IACT,CAAC;IACD,WAAW,EAAE;MACX,KAAK,EAAE,uBAAuB;MAC9B,KAAK,EAAE;IACT;EACF,CAAC;EACD,QAAQ,EAAE;IACR,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE;MACL,KAAK,EAAE,YAAY;MACnB,KAAK,EAAE;IACT,CAAC;IACD,KAAK,EAAE;MACL,KAAK,EAAE,gBAAgB;MACvB,KAAK,EAAE;IACT,CAAC;IACD,WAAW,EAAE;MACX,KAAK,EAAE,uBAAuB;MAC9B,KAAK,EAAE;IACT;EACF,CAAC;EACD,SAAS,EAAE;IACT,WAAW,EAAE,uBAAuB;IACpC,KAAK,EAAE;MACL,KAAK,EAAE,aAAa;MACpB,KAAK,EAAE;IACT,CAAC;IACD,KAAK,EAAE;MACL,KAAK,EAAE,iBAAiB;MACxB,KAAK,EAAE;IACT,CAAC;IACD,WAAW,EAAE;MACX,KAAK,EAAE,wBAAwB;MAC/B,KAAK,EAAE;IACT;EACF;AACF,CAAC;AAAE,eAAeA,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"libraryThemes.js","names":["libraryThemes"],"sources":["../../../src/autoGenerated/libraryThemes.ts"],"sourcesContent":["/* eslint-disable */\nexport const libraryThemes = {\n \"base\": {\n \"buildPath\": \"styles\",\n \"dev\": {\n \"css\": \"index.css\",\n \"map\": \"index.css.map\"\n },\n \"min\": {\n \"css\": \"index.min.css\",\n \"map\": \"index.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"index.min.3.16.0.css\",\n \"map\": \"index.min.3.16.0.css.map\"\n }\n },\n \"cba\": {\n \"buildPath\": \"styles/themes/cba\",\n \"dev\": {\n \"css\": \"cba.css\",\n \"map\": \"cba.css.map\"\n },\n \"min\": {\n \"css\": \"cba.min.css\",\n \"map\": \"cba.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"cba.min.3.16.0.css\",\n \"map\": \"cba.min.3.16.0.css.map\"\n }\n },\n \"creditSavvy\": {\n \"buildPath\": \"styles/themes/creditSavvy\",\n \"dev\": {\n \"css\": \"creditSavvy.css\",\n \"map\": \"creditSavvy.css.map\"\n },\n \"min\": {\n \"css\": \"creditSavvy.min.css\",\n \"map\": \"creditSavvy.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"creditSavvy.min.3.16.0.css\",\n \"map\": \"creditSavvy.min.3.16.0.css.map\"\n }\n },\n \"doshii\": {\n \"buildPath\": \"styles/themes/doshii\",\n \"dev\": {\n \"css\": \"doshii.css\",\n \"map\": \"doshii.css.map\"\n },\n \"min\": {\n \"css\": \"doshii.min.css\",\n \"map\": \"doshii.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"doshii.min.3.16.0.css\",\n \"map\": \"doshii.min.3.16.0.css.map\"\n }\n },\n \"homeIn\": {\n \"buildPath\": \"styles/themes/homeIn\",\n \"dev\": {\n \"css\": \"homeIn.css\",\n \"map\": \"homeIn.css.map\"\n },\n \"min\": {\n \"css\": \"homeIn.min.css\",\n \"map\": \"homeIn.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"homeIn.min.3.16.0.css\",\n \"map\": \"homeIn.min.3.16.0.css.map\"\n }\n },\n \"x15Core\": {\n \"buildPath\": \"styles/themes/x15Core\",\n \"dev\": {\n \"css\": \"x15Core.css\",\n \"map\": \"x15Core.css.map\"\n },\n \"min\": {\n \"css\": \"x15Core.min.css\",\n \"map\": \"x15Core.min.css.map\"\n },\n \"versioned\": {\n \"css\": \"x15Core.min.3.16.0.css\",\n \"map\": \"x15Core.min.3.16.0.css.map\"\n }\n }\n}; export default libraryThemes;"],"mappings":"AAAA;AACA,OAAO,MAAMA,aAAa,GAAG;EAC3B,MAAM,EAAE;IACN,WAAW,EAAE,QAAQ;IAC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,EAAE;IACT;EACF,CAAC;EACD,SAAS,EAAE;IACT,WAAW,EAAE,uBAAuB;IACpC,KAAK,EAAE;MACL,KAAK,EAAE,aAAa;MACpB,KAAK,EAAE;IACT,CAAC;IACD,KAAK,EAAE;MACL,KAAK,EAAE,iBAAiB;MACxB,KAAK,EAAE;IACT,CAAC;IACD,WAAW,EAAE;MACX,KAAK,EAAE,wBAAwB;MAC/B,KAAK,EAAE;IACT;EACF;AACF,CAAC;AAAE,eAAeA,aAAa","ignoreList":[]}
@@ -10,8 +10,8 @@
10
10
  "map": "index.min.css.map"
11
11
  },
12
12
  "versioned": {
13
- "css": "base.min.3.15.0.css",
14
- "map": "base.min.3.15.0.css.map"
13
+ "css": "base.min.3.16.0.css",
14
+ "map": "base.min.3.16.0.css.map"
15
15
  }
16
16
  },
17
17
  "cba": {
@@ -25,8 +25,8 @@
25
25
  "map": "cba.min.css.map"
26
26
  },
27
27
  "versioned": {
28
- "css": "cba.min.3.15.0.css",
29
- "map": "cba.min.3.15.0.css.map"
28
+ "css": "cba.min.3.16.0.css",
29
+ "map": "cba.min.3.16.0.css.map"
30
30
  }
31
31
  },
32
32
  "creditSavvy": {
@@ -40,8 +40,8 @@
40
40
  "map": "creditSavvy.min.css.map"
41
41
  },
42
42
  "versioned": {
43
- "css": "creditSavvy.min.3.15.0.css",
44
- "map": "creditSavvy.min.3.15.0.css.map"
43
+ "css": "creditSavvy.min.3.16.0.css",
44
+ "map": "creditSavvy.min.3.16.0.css.map"
45
45
  }
46
46
  },
47
47
  "doshii": {
@@ -55,8 +55,8 @@
55
55
  "map": "doshii.min.css.map"
56
56
  },
57
57
  "versioned": {
58
- "css": "doshii.min.3.15.0.css",
59
- "map": "doshii.min.3.15.0.css.map"
58
+ "css": "doshii.min.3.16.0.css",
59
+ "map": "doshii.min.3.16.0.css.map"
60
60
  }
61
61
  },
62
62
  "homeIn": {
@@ -70,8 +70,8 @@
70
70
  "map": "homeIn.min.css.map"
71
71
  },
72
72
  "versioned": {
73
- "css": "homeIn.min.3.15.0.css",
74
- "map": "homeIn.min.3.15.0.css.map"
73
+ "css": "homeIn.min.3.16.0.css",
74
+ "map": "homeIn.min.3.16.0.css.map"
75
75
  }
76
76
  },
77
77
  "x15Core": {
@@ -85,8 +85,8 @@
85
85
  "map": "x15Core.min.css.map"
86
86
  },
87
87
  "versioned": {
88
- "css": "x15Core.min.3.15.0.css",
89
- "map": "x15Core.min.3.15.0.css.map"
88
+ "css": "x15Core.min.3.16.0.css",
89
+ "map": "x15Core.min.3.16.0.css.map"
90
90
  }
91
91
  }
92
92
  }
@@ -108,7 +108,7 @@ export const Dialog = ({
108
108
  }, /*#__PURE__*/React.createElement("section", {
109
109
  className: `dialogContent ${customCssClasses?.content || ''}`,
110
110
  tabIndex: 0
111
- }, children), /*#__PURE__*/React.createElement("div", {
111
+ }, children), footer && /*#__PURE__*/React.createElement("div", {
112
112
  className: `dialogFooter ${customCssClasses?.footer || ''}`,
113
113
  tabIndex: 0
114
114
  }, typeof footer === 'string' ? /*#__PURE__*/React.createElement("span", {
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","xmarkLarge","SvgIcon","EllipsisTooltip","useDialogOverlay","useFocusTrap","Dialog","id","size","position","animation","scrollBehaviour","onClose","open","overlay","header","footer","children","screenReaderInstruction","customCssClasses","showFocusOutline","isOpen","setIsOpen","dialogElement","dialogHeaderElement","TOGGLE_TEXT","dialogCloseButton","createOverlay","removeOverlay","HandleClose","dialogCssClass","dialog","HandleOpen","dialogOverlay","showOverlay","current","focus","DialogCloseButton","createElement","ref","className","title","type","onClick","svgDefinition","role","tabIndex","lineClamp","tooltipProps","customCssClass","content"],"sources":["../../../../../src/components/design/dialog/Dialog.tsx"],"sourcesContent":["/* eslint-disable jsxA11y/no-noninteractive-tabindex */\n'use client';\n\nimport React, { ReactNode, useCallback, useEffect, useRef, useState, useMemo } from 'react';\nimport { xmarkLarge } from '@x15ventures/x15-ui-library-icons/iconDefinitions/index';\nimport { SvgIcon } from '@x15ventures/x15-ui-library-icons/svgIcon/SvgIcon';\nimport { EllipsisTooltip } from '../tooltip';\nimport { GenericFunction } from '../../../interfaces';\nimport { useDialogOverlay } from '../../../hooks/DialogOverlay';\nimport { useFocusTrap } from '../../../hooks/FocusTrap';\n\nimport './dialog.scss';\n\nexport interface DialogInterface {\n id: string;\n size?: 'xs' | 's' | 'm' | 'l' | 'xl' | 'dynamic';\n position?: 'left' | 'right' | 'top' | 'bottom' | 'center' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright';\n animation?: 'none' | 'grow' | 'reveal';\n scrollBehaviour?: 'contentOnly' | 'contentAndFooter' | 'all';\n onClose: GenericFunction;\n open?: boolean;\n overlay?: {\n parentNode?: HTMLElement;\n customCssClass?: string;\n };\n header: string | ReactNode;\n footer?: string | ReactNode;\n children: ReactNode;\n screenReaderInstruction?: string;\n showFocusOutline?: boolean;\n customCssClasses?: {\n dialog?: string;\n content?: string;\n header?: string;\n footer?: string;\n };\n}\n\nexport const Dialog: React.FC<DialogInterface> = ({\n id,\n size = 'm',\n position = 'center',\n animation = 'none',\n scrollBehaviour = 'contentOnly',\n onClose = () => {},\n open = false,\n overlay,\n header,\n footer,\n children,\n screenReaderInstruction = `The following content is in a dialog. \n You can press the Tab key to navigate through the elements, and press Escape to close the dialog.`,\n customCssClasses,\n showFocusOutline = false,\n}) => {\n const [isOpen, setIsOpen] = useState<boolean>(open);\n const dialogElement = useRef<HTMLDivElement>(null);\n const dialogHeaderElement = useRef<HTMLDivElement>(null);\n\n const TOGGLE_TEXT = 'Open and close dialog';\n const dialogCloseButton = useRef(null);\n\n const { createOverlay, removeOverlay } = useDialogOverlay(overlay || {});\n useFocusTrap(dialogElement, () => HandleClose());\n\n const dialogCssClass = useMemo(() => {\n return `dialog \n ${ isOpen || open ? 'isOpen' : '' }\n dialogSize_${ size }\n dialogPosition_${ position }\n dialogAnimation_${ animation }\n dialogScrollBehaviour_${ scrollBehaviour }\n ${ size === 'dynamic' ? 'dialogSize_dynamic' : '' }\n ${ customCssClasses?.dialog || '' }\n ${ showFocusOutline ? 'showFocusOutline' : '' }`;\n }, [open, isOpen, size, position, animation, scrollBehaviour, customCssClasses, showFocusOutline]);\n\n const HandleClose = useCallback(() => {\n setIsOpen(false);\n removeOverlay();\n onClose();\n }, [onClose, removeOverlay]);\n\n const HandleOpen = useCallback(() => {\n const dialogOverlay = createOverlay();\n dialogOverlay.showOverlay();\n }, [createOverlay]);\n\n useEffect(() => {\n if (open || isOpen) {\n if (dialogHeaderElement.current) {\n dialogHeaderElement.current.focus();\n }\n HandleOpen();\n } else {\n HandleClose();\n }\n }, [customCssClasses, createOverlay, open, isOpen, HandleOpen, HandleClose, dialogHeaderElement]);\n\n const DialogCloseButton: React.FC = () => (\n <button\n ref={ dialogCloseButton }\n className=\"dialogClose\"\n title={ TOGGLE_TEXT }\n type=\"button\"\n onClick={ () => HandleClose() }\n >\n <SvgIcon svgDefinition={ xmarkLarge } />\n <span className=\"sr-only\">Close dialog</span>\n </button>\n );\n\n return (\n <div\n className={ dialogCssClass }\n role=\"dialog\"\n aria-labelledby={ `dialogHeader_${ id }` }\n tabIndex={ 0 }\n aria-describedby={ `dialogSRInstruction_${ id }` }\n aria-modal=\"true\"\n ref={ dialogElement }\n >\n <div className=\"dialogFullScroller\">\n <div\n ref={ dialogHeaderElement }\n id={ `dialogHeader_${ id }` }\n className={ `dialogHeader ${ customCssClasses?.header || '' }` }\n tabIndex={ 0 }\n >\n <span id={ `dialogSRInstruction_${ id }` } className=\"sr-only\">\n { screenReaderInstruction }\n </span>\n <div className=\"dialogHeaderTextWrapper\">\n <EllipsisTooltip \n lineClamp={ 2 } \n tooltipProps={ { \n customCssClass: 'shiftDown large dialogEllipsisTooltip'\n } }\n >\n { typeof header === 'string' ? <span className=\"dialogHeaderText\">{ header }</span> : header }\n </EllipsisTooltip>\n </div>\n <DialogCloseButton />\n </div>\n\n <div className=\"dialogContentAndFooterScroller\">\n <section className={ `dialogContent ${ customCssClasses?.content || '' }` } tabIndex={ 0 }>\n { children }\n </section>\n\n <div className={ `dialogFooter ${ customCssClasses?.footer || '' }` } tabIndex={ 0 }>\n { typeof footer === 'string' ? <span className=\"dialogFooterText\">{ footer }</span> : footer }\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":"AAAA;AACA,YAAY;;AAEZ,OAAOA,KAAK,IAAeC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAC3F,SAASC,UAAU,QAAQ,yDAAyD;AACpF,SAASC,OAAO,QAAQ,mDAAmD;AAC3E,SAASC,eAAe,QAAQ,YAAY;AAE5C,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,YAAY,QAAQ,0BAA0B;AAEvD,OAAO,eAAe;AA2BtB,OAAO,MAAMC,MAAiC,GAAGA,CAAC;EAChDC,EAAE;EACFC,IAAI,GAAG,GAAG;EACVC,QAAQ,GAAG,QAAQ;EACnBC,SAAS,GAAG,MAAM;EAClBC,eAAe,GAAG,aAAa;EAC/BC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClBC,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,MAAM;EACNC,MAAM;EACNC,QAAQ;EACRC,uBAAuB,GAAG;AAC5B,wGAAwG;EACtGC,gBAAgB;EAChBC,gBAAgB,GAAG;AACrB,CAAC,KAAK;EACJ,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGvB,QAAQ,CAAUc,IAAI,CAAC;EACnD,MAAMU,aAAa,GAAGzB,MAAM,CAAiB,IAAI,CAAC;EAClD,MAAM0B,mBAAmB,GAAG1B,MAAM,CAAiB,IAAI,CAAC;EAExD,MAAM2B,WAAW,GAAG,uBAAuB;EAC3C,MAAMC,iBAAiB,GAAG5B,MAAM,CAAC,IAAI,CAAC;EAEtC,MAAM;IAAE6B,aAAa;IAAEC;EAAc,CAAC,GAAGxB,gBAAgB,CA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AG;MACbC,cAAc,EAAE;IAClB;EAAG,GAED,OAAOlC,MAAM,KAAK,QAAQ,gBAAGpB,KAAA,CAAA2C,aAAA;IAAME,SAAS,EAAC;EAAkB,GAAGzB,MAAc,CAAC,GAAGA,MACvE,CACd,CAAC,eACNpB,KAAA,CAAA2C,aAAA,CAACD,iBAAiB,MAAE,CACjB,CAAC,eAEN1C,KAAA,CAAA2C,aAAA;IAAKE,SAAS,EAAC;EAAgC,gBAC7C7C,KAAA,CAAA2C,aAAA;IAASE,SAAS,EAAG,iBAAkBrB,gBAAgB,EAAE+B,OAAO,IAAI,EAAE,EAAK;IAACJ,QAAQ,EAAG;EAAG,GACtF7B,QACK,CAAC,eAEVtB,KAAA,CAAA2C,aAAA;IAAKE,SAAS,EAAG,gBAAiBrB,gBAAgB,EAAEH,MAAM,IAAI,EAAE,EAAK;IAAC8B,QAAQ,EAAG;EAAG,GAChF,OAAO9B,MAAM,KAAK,QAAQ,gBAAGrB,KAAA,CAAA2C,aAAA;IAAME,SAAS,EAAC;EAAkB,GAAGxB,MAAc,CAAC,GAAGA,MACnF,CACF,CACF,CACF,CAAC;AAEV,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Dialog.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","xmarkLarge","SvgIcon","EllipsisTooltip","useDialogOverlay","useFocusTrap","Dialog","id","size","position","animation","scrollBehaviour","onClose","open","overlay","header","footer","children","screenReaderInstruction","customCssClasses","showFocusOutline","isOpen","setIsOpen","dialogElement","dialogHeaderElement","TOGGLE_TEXT","dialogCloseButton","createOverlay","removeOverlay","HandleClose","dialogCssClass","dialog","HandleOpen","dialogOverlay","showOverlay","current","focus","DialogCloseButton","createElement","ref","className","title","type","onClick","svgDefinition","role","tabIndex","lineClamp","tooltipProps","customCssClass","content"],"sources":["../../../../../src/components/design/dialog/Dialog.tsx"],"sourcesContent":["/* eslint-disable jsxA11y/no-noninteractive-tabindex */\n'use client';\n\nimport React, { ReactNode, useCallback, useEffect, useRef, useState, useMemo } from 'react';\nimport { xmarkLarge } from '@x15ventures/x15-ui-library-icons/iconDefinitions/index';\nimport { SvgIcon } from '@x15ventures/x15-ui-library-icons/svgIcon/SvgIcon';\nimport { EllipsisTooltip } from '../tooltip';\nimport { GenericFunction } from '../../../interfaces';\nimport { useDialogOverlay } from '../../../hooks/DialogOverlay';\nimport { useFocusTrap } from '../../../hooks/FocusTrap';\n\nimport './dialog.scss';\n\nexport interface DialogInterface {\n id: string;\n size?: 'xs' | 's' | 'm' | 'l' | 'xl' | 'dynamic';\n position?: 'left' | 'right' | 'top' | 'bottom' | 'center' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright';\n animation?: 'none' | 'grow' | 'reveal';\n scrollBehaviour?: 'contentOnly' | 'contentAndFooter' | 'all';\n onClose: GenericFunction;\n open?: boolean;\n overlay?: {\n parentNode?: HTMLElement;\n customCssClass?: string;\n };\n header: string | ReactNode;\n footer?: string | ReactNode;\n children: ReactNode;\n screenReaderInstruction?: string;\n showFocusOutline?: boolean;\n customCssClasses?: {\n dialog?: string;\n content?: string;\n header?: string;\n footer?: string;\n };\n}\n\nexport const Dialog: React.FC<DialogInterface> = ({\n id,\n size = 'm',\n position = 'center',\n animation = 'none',\n scrollBehaviour = 'contentOnly',\n onClose = () => {},\n open = false,\n overlay,\n header,\n footer,\n children,\n screenReaderInstruction = `The following content is in a dialog. \n You can press the Tab key to navigate through the elements, and press Escape to close the dialog.`,\n customCssClasses,\n showFocusOutline = false,\n}) => {\n const [isOpen, setIsOpen] = useState<boolean>(open);\n const dialogElement = useRef<HTMLDivElement>(null);\n const dialogHeaderElement = useRef<HTMLDivElement>(null);\n\n const TOGGLE_TEXT = 'Open and close dialog';\n const dialogCloseButton = useRef(null);\n\n const { createOverlay, removeOverlay } = useDialogOverlay(overlay || {});\n useFocusTrap(dialogElement, () => HandleClose());\n\n const dialogCssClass = useMemo(() => {\n return `dialog \n ${ isOpen || open ? 'isOpen' : '' }\n dialogSize_${ size }\n dialogPosition_${ position }\n dialogAnimation_${ animation }\n dialogScrollBehaviour_${ scrollBehaviour }\n ${ size === 'dynamic' ? 'dialogSize_dynamic' : '' }\n ${ customCssClasses?.dialog || '' }\n ${ showFocusOutline ? 'showFocusOutline' : '' }`;\n }, [open, isOpen, size, position, animation, scrollBehaviour, customCssClasses, showFocusOutline]);\n\n const HandleClose = useCallback(() => {\n setIsOpen(false);\n removeOverlay();\n onClose();\n }, [onClose, removeOverlay]);\n\n const HandleOpen = useCallback(() => {\n const dialogOverlay = createOverlay();\n dialogOverlay.showOverlay();\n }, [createOverlay]);\n\n useEffect(() => {\n if (open || isOpen) {\n if (dialogHeaderElement.current) {\n dialogHeaderElement.current.focus();\n }\n HandleOpen();\n } else {\n HandleClose();\n }\n }, [customCssClasses, createOverlay, open, isOpen, HandleOpen, HandleClose, dialogHeaderElement]);\n\n const DialogCloseButton: React.FC = () => (\n <button\n ref={ dialogCloseButton }\n className=\"dialogClose\"\n title={ TOGGLE_TEXT }\n type=\"button\"\n onClick={ () => HandleClose() }\n >\n <SvgIcon svgDefinition={ xmarkLarge } />\n <span className=\"sr-only\">Close dialog</span>\n </button>\n );\n\n return (\n <div\n className={ dialogCssClass }\n role=\"dialog\"\n aria-labelledby={ `dialogHeader_${ id }` }\n tabIndex={ 0 }\n aria-describedby={ `dialogSRInstruction_${ id }` }\n aria-modal=\"true\"\n ref={ dialogElement }\n >\n <div className=\"dialogFullScroller\">\n <div\n ref={ dialogHeaderElement }\n id={ `dialogHeader_${ id }` }\n className={ `dialogHeader ${ customCssClasses?.header || '' }` }\n tabIndex={ 0 }\n >\n <span id={ `dialogSRInstruction_${ id }` } className=\"sr-only\">\n { screenReaderInstruction }\n </span>\n <div className=\"dialogHeaderTextWrapper\">\n <EllipsisTooltip \n lineClamp={ 2 } \n tooltipProps={ { \n customCssClass: 'shiftDown large dialogEllipsisTooltip'\n } }\n >\n { typeof header === 'string' ? <span className=\"dialogHeaderText\">{ header }</span> : header }\n </EllipsisTooltip>\n </div>\n <DialogCloseButton />\n </div>\n\n <div className=\"dialogContentAndFooterScroller\">\n <section className={ `dialogContent ${ customCssClasses?.content || '' }` } tabIndex={ 0 }>\n { children }\n </section>\n\n {\n footer && (\n <div className={ `dialogFooter ${ customCssClasses?.footer || '' }` } tabIndex={ 0 }>\n { typeof footer === 'string' ? <span className=\"dialogFooterText\">{ footer }</span> : footer }\n </div>\n )\n }\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":"AAAA;AACA,YAAY;;AAEZ,OAAOA,KAAK,IAAeC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAC3F,SAASC,UAAU,QAAQ,yDAAyD;AACpF,SAASC,OAAO,QAAQ,mDAAmD;AAC3E,SAASC,eAAe,QAAQ,YAAY;AAE5C,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,YAAY,QAAQ,0BAA0B;AAEvD,OAAO,eAAe;AA2BtB,OAAO,MAAMC,MAAiC,GAAGA,CAAC;EAChDC,EAAE;EACFC,IAAI,GAAG,GAAG;EACVC,QAAQ,GAAG,QAAQ;EACnBC,SAAS,GAAG,MAAM;EAClBC,eAAe,GAAG,aAAa;EAC/BC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClBC,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,MAAM;EACNC,MAAM;EACNC,QAAQ;EACRC,uBAAuB,GAAG;AAC5B,wGAAwG;EACtGC,gBAAgB;EAChBC,gBAAgB,GAAG;AACrB,CAAC,KAAK;EACJ,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGvB,QAAQ,CAAUc,IAAI,CAAC;EACnD,MAAMU,aAAa,GAAGzB,MAAM,CAAiB,IAAI,CAAC;EAClD,MAAM0B,mBAAmB,GAAG1B,MAAM,CAAiB,IAAI,CAAC;EAExD,MAAM2B,WAAW,GAAG,uBAAuB;EAC3C,MAAMC,iBAAiB,GAAG5B,MAAM,CAAC,IAA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,KAAA,CAAA2C,aAAA,CAACnC,eAAe;IACd4C,SAAS,EAAG,CAAG;IACfC,YAAY,EAAG;MACbC,cAAc,EAAE;IAClB;EAAG,GAED,OAAOlC,MAAM,KAAK,QAAQ,gBAAGpB,KAAA,CAAA2C,aAAA;IAAME,SAAS,EAAC;EAAkB,GAAGzB,MAAc,CAAC,GAAGA,MACvE,CACd,CAAC,eACNpB,KAAA,CAAA2C,aAAA,CAACD,iBAAiB,MAAE,CACjB,CAAC,eAEN1C,KAAA,CAAA2C,aAAA;IAAKE,SAAS,EAAC;EAAgC,gBAC7C7C,KAAA,CAAA2C,aAAA;IAASE,SAAS,EAAG,iBAAkBrB,gBAAgB,EAAE+B,OAAO,IAAI,EAAE,EAAK;IAACJ,QAAQ,EAAG;EAAG,GACtF7B,QACK,CAAC,EAGRD,MAAM,iBACJrB,KAAA,CAAA2C,aAAA;IAAKE,SAAS,EAAG,gBAAiBrB,gBAAgB,EAAEH,MAAM,IAAI,EAAE,EAAK;IAAC8B,QAAQ,EAAG;EAAG,GAChF,OAAO9B,MAAM,KAAK,QAAQ,gBAAGrB,KAAA,CAAA2C,aAAA;IAAME,SAAS,EAAC;EAAkB,GAAGxB,MAAc,CAAC,GAAGA,MACnF,CAGN,CACF,CACF,CAAC;AAEV,CAAC","ignoreList":[]}
@@ -13,6 +13,7 @@ export const HeaderBar = ({
13
13
  rightIcon,
14
14
  buttons,
15
15
  notificationIcon,
16
+ headingLevel = 2,
16
17
  children
17
18
  }) => {
18
19
  const headerCssClass = `headerBar
@@ -20,9 +21,10 @@ export const HeaderBar = ({
20
21
  ${rightIcon ? 'withRightIcon' : ''}
21
22
  ${notificationIcon ? 'withNotification' : ''}
22
23
  `;
24
+ const Heading = `h${headingLevel}`;
23
25
  return /*#__PURE__*/React.createElement("header", {
24
26
  className: headerCssClass
25
- }, leftIcon && /*#__PURE__*/React.createElement(Icon, leftIcon), text && /*#__PURE__*/React.createElement("h2", null, text), children, buttons && /*#__PURE__*/React.createElement("div", {
27
+ }, leftIcon && /*#__PURE__*/React.createElement(Icon, leftIcon), text && /*#__PURE__*/React.createElement(Heading, null, text), children, buttons && /*#__PURE__*/React.createElement("div", {
26
28
  className: "headerButtons"
27
29
  }, buttons.map(button => {
28
30
  if (button.kind === 'notifications') {
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBar.js","names":["_extends","React","Icon","NotificationIcon","SimpleButton","NotificationsButton","HeaderBar","text","leftIcon","rightIcon","buttons","notificationIcon","children","headerCssClass","createElement","className","map","button","kind","key","id"],"sources":["../../../../../src/components/design/headerBar/HeaderBar.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { HeaderTextInterface } from '../../../interfaces/headerText.interface';\nimport { Icon } from '../icons/basicIcon/Icon';\nimport { NotificationIcon } from '../icons/notificationIcon/NotificationIcon';\nimport { SimpleButton } from '../../form/buttons/SimpleButton';\nimport { NotificationsButton } from '../../form/buttons/notificationsButton/NotificationsButton';\nimport { ButtonProps } from '../../form/buttons/button.interface';\n\nimport './headerBar.scss';\n\nexport const HeaderBar: React.FC<HeaderTextInterface> = (\n {\n text,\n leftIcon,\n rightIcon,\n buttons,\n notificationIcon,\n children\n }\n) => {\n const headerCssClass = `headerBar \n ${ leftIcon ? 'withLeftIcon' : '' }\n ${ rightIcon ? 'withRightIcon' : '' }\n ${ notificationIcon ? 'withNotification' : '' }\n `;\n\n return (\n <header className={ headerCssClass }>\n {\n leftIcon && <Icon { ...leftIcon } />\n }\n\n {\n text && <h2>{ text }</h2>\n }\n\n { children }\n\n {\n buttons\n && (\n <div className=\"headerButtons\">\n {\n buttons.map((button) => {\n if (button.kind === 'notifications') {\n return <NotificationsButton key={ button.id } { ...button } />;\n }\n return <SimpleButton key={ button.id } { ...(button as ButtonProps) } />;\n })\n }\n </div>\n )\n }\n\n {\n rightIcon && <Icon { ...rightIcon } />\n }\n\n {\n notificationIcon && <NotificationIcon { ...notificationIcon } />\n }\n </header>\n );\n};\n"],"mappings":"AAAA,YAAY;;AA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Aa,CAAC,EAItCE,gBAAgB,iBAAIV,KAAA,CAAAa,aAAA,CAACX,gBAAgB,EAAMQ,gBAAoB,CAE3D,CAAC;AAEb,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"HeaderBar.js","names":["_extends","React","Icon","NotificationIcon","SimpleButton","NotificationsButton","HeaderBar","text","leftIcon","rightIcon","buttons","notificationIcon","headingLevel","children","headerCssClass","Heading","createElement","className","map","button","kind","key","id"],"sources":["../../../../../src/components/design/headerBar/HeaderBar.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { HeaderTextInterface } from '../../../interfaces/headerText.interface';\nimport { Icon } from '../icons/basicIcon/Icon';\nimport { NotificationIcon } from '../icons/notificationIcon/NotificationIcon';\nimport { SimpleButton } from '../../form/buttons/SimpleButton';\nimport { NotificationsButton } from '../../form/buttons/notificationsButton/NotificationsButton';\nimport { ButtonProps } from '../../form/buttons/button.interface';\n\nimport './headerBar.scss';\n\ntype HeadingLevel = NonNullable<HeaderTextInterface['headingLevel']>;\ntype HeadingTag = `h${ HeadingLevel }`;\n\nexport const HeaderBar: React.FC<HeaderTextInterface> = (\n {\n text,\n leftIcon,\n rightIcon,\n buttons,\n notificationIcon,\n headingLevel = 2,\n children\n }\n) => {\n const headerCssClass = `headerBar \n ${ leftIcon ? 'withLeftIcon' : '' }\n ${ rightIcon ? 'withRightIcon' : '' }\n ${ notificationIcon ? 'withNotification' : '' }\n `;\n const Heading: HeadingTag = `h${ headingLevel }`;\n\n return (\n <header className={ headerCssClass }>\n {\n leftIcon && <Icon { ...leftIcon } />\n }\n\n {\n text && <Heading>{ text }</Heading>\n }\n\n { children }\n\n {\n buttons\n && (\n <div className=\"headerButtons\">\n {\n buttons.map((button) => {\n if (button.kind === 'notifications') {\n return <NotificationsButton key={ button.id } { ...button } />;\n }\n return <SimpleButton key={ button.id } { ...(button as ButtonProps) } />;\n })\n }\n </div>\n )\n }\n\n {\n rightIcon && <Icon { ...rightIcon } />\n }\n\n {\n notificationIcon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AACqB,GAAG,EAAGF,MAAM,CAACG;IAAI,GAAOH,MAAM,CAAoB,CAAC;EAC1E,CAAC,CAEA,CACN,EAIDV,SAAS,iBAAIR,KAAA,CAAAe,aAAA,CAACd,IAAI,EAAMO,SAAa,CAAC,EAItCE,gBAAgB,iBAAIV,KAAA,CAAAe,aAAA,CAACb,gBAAgB,EAAMQ,gBAAoB,CAE3D,CAAC;AAEb,CAAC","ignoreList":[]}
@@ -26,7 +26,12 @@
26
26
  right: 0;
27
27
  left: auto;
28
28
  }
29
- .headerBar h2 {
29
+ .headerBar h1,
30
+ .headerBar h2,
31
+ .headerBar h3,
32
+ .headerBar h4,
33
+ .headerBar h5,
34
+ .headerBar h6 {
30
35
  text-overflow: ellipsis;
31
36
  white-space: nowrap;
32
37
  overflow: hidden;
@@ -18,7 +18,8 @@ export const Tooltip = props => {
18
18
  containsBlockElements = false,
19
19
  children,
20
20
  label = 'Toggle tooltip open state',
21
- showPointer = true
21
+ showPointer = true,
22
+ hoverDelay
22
23
  // visualIndicators will be handled below
23
24
  } = props;
24
25
 
@@ -28,38 +29,89 @@ export const Tooltip = props => {
28
29
  colouredText: true
29
30
  } : undefined;
30
31
  const [isOpen, setIsOpen] = useState(false);
32
+ const [isHovered, setIsHovered] = useState(false);
31
33
  const tooltipElement = useRef(null);
32
34
  const triggerElement = useRef(null);
33
35
  const contentElement = useRef(null);
36
+ const hoverTimer = useRef(null);
34
37
  const iconIsElement = /*#__PURE__*/React.isValidElement(icon);
35
- useOnClickOutside(tooltipElement, () => setIsOpen(false));
38
+
39
+ // Hover is handled in css by default. It is only taken over by js when a delay is requested.
40
+ const hasHoverDelay = typeof hoverDelay === 'number' && hoverDelay > 0;
41
+ const isVisible = isOpen || isHovered;
42
+ const clearHoverTimer = useCallback(() => {
43
+ if (hoverTimer.current) {
44
+ clearTimeout(hoverTimer.current);
45
+ hoverTimer.current = null;
46
+ }
47
+ }, []);
48
+ const handleMouseEnter = useCallback(() => {
49
+ clearHoverTimer();
50
+ hoverTimer.current = setTimeout(() => setIsHovered(true), hoverDelay);
51
+ }, [clearHoverTimer, hoverDelay]);
52
+ const handleMouseLeave = useCallback(() => {
53
+ clearHoverTimer();
54
+ setIsHovered(false);
55
+ }, [clearHoverTimer]);
56
+
57
+ // Single dismissal path, so every close route clears both the click and hover state
58
+ const dismiss = useCallback(() => {
59
+ clearHoverTimer();
60
+ setIsHovered(false);
61
+ setIsOpen(false);
62
+ }, [clearHoverTimer]);
63
+ const handleTriggerClick = useCallback(() => {
64
+ if (isVisible) {
65
+ dismiss();
66
+ return;
67
+ }
68
+ clearHoverTimer();
69
+ setIsOpen(true);
70
+ }, [isVisible, dismiss, clearHoverTimer]);
71
+
72
+ // Releasing the delay detaches the mouse handlers, so reset any hover state they left behind
73
+ useEffect(() => {
74
+ if (!hasHoverDelay) {
75
+ clearHoverTimer();
76
+ setIsHovered(false);
77
+ }
78
+ }, [hasHoverDelay, clearHoverTimer]);
79
+ useEffect(() => clearHoverTimer, [clearHoverTimer]);
80
+ const hoverHandlers = hasHoverDelay ? {
81
+ onMouseEnter: handleMouseEnter,
82
+ onMouseLeave: handleMouseLeave
83
+ } : {};
84
+ useOnClickOutside(tooltipElement, dismiss);
36
85
  useOnEdgeProximityDetect({
37
86
  triggerRef: triggerElement,
38
87
  wrapperRef: tooltipElement,
39
88
  contentRef: contentElement,
40
- requiresRecalc: isOpen
89
+ requiresRecalc: isVisible
41
90
  });
42
91
 
43
92
  // Handle special key presses
44
93
  const handleSpecialKeyPresses = useCallback(event => {
45
94
  if (event.key === 'Escape' || event.keyCode === 27) {
46
- setIsOpen(false);
95
+ dismiss();
47
96
  }
48
- }, [setIsOpen]);
97
+ }, [dismiss]);
49
98
  useEffect(() => {
50
- if (tooltipElement.current) {
51
- tooltipElement.current.addEventListener('keydown', handleSpecialKeyPresses);
99
+ const wrapper = tooltipElement.current;
100
+ if (!wrapper) {
101
+ return undefined;
52
102
  }
103
+ wrapper.addEventListener('keydown', handleSpecialKeyPresses);
104
+ return () => wrapper.removeEventListener('keydown', handleSpecialKeyPresses);
53
105
  }, [handleSpecialKeyPresses]);
54
106
  if (containsBlockElements) {
55
- return /*#__PURE__*/React.createElement("div", {
107
+ return /*#__PURE__*/React.createElement("div", _extends({
56
108
  role: "tooltip",
57
109
  ref: tooltipElement,
58
- className: `tooltip tooltip_block ${isOpen ? 'isOpen' : ''} ${triggerStyle === 'text' && 'textDisplay'} ${customCssClass || ''}`
59
- }, /*#__PURE__*/React.createElement("button", _extends({
110
+ className: `tooltip tooltip_block ${isVisible ? 'isOpen' : ''} ${hasHoverDelay ? 'hoverDelayed' : ''} ${triggerStyle === 'text' ? 'textDisplay' : ''} ${customCssClass || ''}`
111
+ }, hoverHandlers), /*#__PURE__*/React.createElement("button", _extends({
60
112
  ref: triggerElement,
61
113
  type: "button",
62
- onClick: () => setIsOpen(!isOpen),
114
+ onClick: handleTriggerClick,
63
115
  className: `button ${triggerStyle === 'text' ? 'text_only' : 'icon_only'} ${triggerStyle === 'text' && !visualIndicators?.underline ? 'underline_off' : ''} ${triggerStyle === 'text' && !visualIndicators?.colouredText ? 'colouredText_off' : ''}`
64
116
  }, triggerId ? {
65
117
  'id': triggerId,
@@ -77,13 +129,13 @@ export const Tooltip = props => {
77
129
  id: `${triggerId}_content`
78
130
  } : {}), children));
79
131
  }
80
- return /*#__PURE__*/React.createElement("span", {
132
+ return /*#__PURE__*/React.createElement("span", _extends({
81
133
  ref: tooltipElement,
82
- className: `tooltip ${isOpen ? 'isOpen' : ''} ${triggerStyle === 'text' && 'textDisplay'} ${customCssClass || ''}`
83
- }, /*#__PURE__*/React.createElement("button", _extends({
134
+ className: `tooltip ${isVisible ? 'isOpen' : ''} ${hasHoverDelay ? 'hoverDelayed' : ''} ${triggerStyle === 'text' ? 'textDisplay' : ''} ${customCssClass || ''}`
135
+ }, hoverHandlers), /*#__PURE__*/React.createElement("button", _extends({
84
136
  ref: triggerElement,
85
137
  type: "button",
86
- onClick: () => setIsOpen(!isOpen),
138
+ onClick: handleTriggerClick,
87
139
  className: `button ${triggerStyle === 'text' ? 'text_only' : 'icon_only'} ${triggerStyle === 'text' && !visualIndicators?.underline ? 'underline_off' : ''} ${triggerStyle === 'text' && !visualIndicators?.colouredText ? 'colouredText_off' : ''}`
88
140
  }, triggerId ? {
89
141
  id: triggerId