@hitachivantara/uikit-react-core 5.82.2 → 5.82.4

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 (231) hide show
  1. package/dist/cjs/BaseDropdown/BaseDropdown.cjs +1 -1
  2. package/dist/cjs/BaseInput/BaseInput.cjs +11 -12
  3. package/dist/cjs/BaseInput/validations.cjs +3 -3
  4. package/dist/cjs/Calendar/Calendar.cjs +14 -15
  5. package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.cjs +8 -10
  6. package/dist/cjs/Card/Card.cjs +1 -1
  7. package/dist/cjs/CheckBox/CheckBox.cjs +10 -10
  8. package/dist/cjs/CheckBoxGroup/CheckBoxGroup.cjs +8 -8
  9. package/dist/cjs/ColorPicker/ColorPicker.cjs +6 -9
  10. package/dist/cjs/ColorPicker/Fields/Fields.cjs +4 -4
  11. package/dist/cjs/ColorPicker/Picker/Picker.cjs +11 -3
  12. package/dist/cjs/ColorPicker/Picker/Picker.styles.cjs +6 -1
  13. package/dist/cjs/Controls/context/ControlsContext.cjs +1 -3
  14. package/dist/cjs/DatePicker/DatePicker.cjs +15 -15
  15. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +1 -1
  16. package/dist/cjs/Dropdown/Dropdown.cjs +9 -9
  17. package/dist/cjs/FileUploader/DropZone/DropZone.cjs +2 -2
  18. package/dist/cjs/FilterGroup/FilterGroup.cjs +6 -6
  19. package/dist/cjs/{Forms → FormElement}/Adornment/Adornment.cjs +10 -11
  20. package/dist/cjs/{Forms → FormElement}/CharCounter/CharCounter.cjs +15 -15
  21. package/dist/cjs/FormElement/FormElement.cjs +35 -0
  22. package/dist/cjs/{Forms → FormElement}/InfoMessage/InfoMessage.cjs +8 -8
  23. package/dist/cjs/{Forms → FormElement}/Label/Label.cjs +13 -13
  24. package/dist/cjs/{Forms → FormElement}/Suggestions/Suggestions.cjs +7 -7
  25. package/dist/cjs/{Forms → FormElement}/WarningText/WarningText.cjs +5 -5
  26. package/dist/cjs/FormElement/context.cjs +11 -0
  27. package/dist/cjs/{Forms/FormElement/utils/FormUtils.cjs → FormElement/utils.cjs} +19 -11
  28. package/dist/cjs/Grid/Grid.cjs +1 -1
  29. package/dist/cjs/Input/Input.cjs +17 -17
  30. package/dist/cjs/Input/Input.styles.cjs +2 -2
  31. package/dist/cjs/ListContainer/ListContext/ListContext.cjs +1 -3
  32. package/dist/cjs/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.cjs +1 -1
  33. package/dist/cjs/Radio/Radio.cjs +10 -13
  34. package/dist/cjs/RadioGroup/RadioGroup.cjs +7 -7
  35. package/dist/cjs/Select/Select.cjs +5 -7
  36. package/dist/cjs/SelectionList/SelectionList.cjs +7 -7
  37. package/dist/cjs/Slider/Slider.cjs +12 -12
  38. package/dist/cjs/Slider/utils.cjs +7 -7
  39. package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.cjs +1 -1
  40. package/dist/cjs/SnackbarProvider/SnackbarProvider.cjs +1 -1
  41. package/dist/cjs/Switch/Switch.cjs +9 -12
  42. package/dist/cjs/Table/TableBody/TableBody.cjs +10 -8
  43. package/dist/cjs/Table/TableCell/TableCell.cjs +2 -2
  44. package/dist/cjs/Table/TableContainer/TableContainer.cjs +9 -2
  45. package/dist/cjs/Table/TableHead/TableHead.cjs +10 -2
  46. package/dist/cjs/Table/TableHeader/TableHeader.cjs +2 -2
  47. package/dist/cjs/Table/TableRow/TableRow.cjs +2 -2
  48. package/dist/cjs/TableSection/TableSection.styles.cjs +6 -2
  49. package/dist/cjs/TagsInput/TagsInput.cjs +17 -17
  50. package/dist/cjs/TagsInput/TagsInput.styles.cjs +1 -1
  51. package/dist/cjs/TextArea/TextArea.cjs +17 -17
  52. package/dist/cjs/TimePicker/TimePicker.cjs +7 -7
  53. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +1 -1
  54. package/dist/cjs/hocs/withTooltip.cjs +40 -37
  55. package/dist/cjs/hooks/useIsMounted.cjs +2 -4
  56. package/dist/cjs/index.cjs +15 -36
  57. package/dist/esm/BaseDropdown/BaseDropdown.js +1 -1
  58. package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
  59. package/dist/esm/BaseInput/BaseInput.js +5 -6
  60. package/dist/esm/BaseInput/BaseInput.js.map +1 -1
  61. package/dist/esm/BaseInput/validations.js +3 -3
  62. package/dist/esm/BaseInput/validations.js.map +1 -1
  63. package/dist/esm/Calendar/Calendar.js +13 -14
  64. package/dist/esm/Calendar/Calendar.js.map +1 -1
  65. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js +6 -8
  66. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
  67. package/dist/esm/Card/Card.js +1 -1
  68. package/dist/esm/Card/Card.js.map +1 -1
  69. package/dist/esm/CheckBox/CheckBox.js +9 -9
  70. package/dist/esm/CheckBox/CheckBox.js.map +1 -1
  71. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js +8 -8
  72. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
  73. package/dist/esm/ColorPicker/ColorPicker.js +6 -9
  74. package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
  75. package/dist/esm/ColorPicker/Fields/Fields.js +4 -4
  76. package/dist/esm/ColorPicker/Fields/Fields.js.map +1 -1
  77. package/dist/esm/ColorPicker/Picker/Picker.js +11 -3
  78. package/dist/esm/ColorPicker/Picker/Picker.js.map +1 -1
  79. package/dist/esm/ColorPicker/Picker/Picker.styles.js +6 -1
  80. package/dist/esm/ColorPicker/Picker/Picker.styles.js.map +1 -1
  81. package/dist/esm/Controls/context/ControlsContext.js +2 -2
  82. package/dist/esm/Controls/context/ControlsContext.js.map +1 -1
  83. package/dist/esm/DatePicker/DatePicker.js +9 -9
  84. package/dist/esm/DatePicker/DatePicker.js.map +1 -1
  85. package/dist/esm/Dialog/Dialog.js.map +1 -1
  86. package/dist/esm/DropDownMenu/DropDownMenu.js +1 -1
  87. package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
  88. package/dist/esm/Dropdown/Dropdown.js +8 -8
  89. package/dist/esm/Dropdown/Dropdown.js.map +1 -1
  90. package/dist/esm/EmptyState/EmptyState.js.map +1 -1
  91. package/dist/esm/FileUploader/DropZone/DropZone.js +2 -2
  92. package/dist/esm/FileUploader/DropZone/DropZone.js.map +1 -1
  93. package/dist/esm/FilterGroup/FilterContent/FilterContent.js.map +1 -1
  94. package/dist/esm/FilterGroup/FilterGroup.js +6 -6
  95. package/dist/esm/FilterGroup/FilterGroup.js.map +1 -1
  96. package/dist/esm/{Forms → FormElement}/Adornment/Adornment.js +9 -10
  97. package/dist/esm/FormElement/Adornment/Adornment.js.map +1 -0
  98. package/dist/esm/FormElement/Adornment/Adornment.styles.js.map +1 -0
  99. package/dist/esm/{Forms → FormElement}/CharCounter/CharCounter.js +15 -15
  100. package/dist/esm/FormElement/CharCounter/CharCounter.js.map +1 -0
  101. package/dist/esm/FormElement/CharCounter/CharCounter.styles.js.map +1 -0
  102. package/dist/esm/FormElement/FormElement.js +36 -0
  103. package/dist/esm/FormElement/FormElement.js.map +1 -0
  104. package/dist/esm/FormElement/FormElement.styles.js.map +1 -0
  105. package/dist/esm/{Forms → FormElement}/InfoMessage/InfoMessage.js +8 -8
  106. package/dist/esm/FormElement/InfoMessage/InfoMessage.js.map +1 -0
  107. package/dist/esm/FormElement/InfoMessage/InfoMessage.styles.js.map +1 -0
  108. package/dist/esm/{Forms → FormElement}/Label/Label.js +12 -12
  109. package/dist/esm/FormElement/Label/Label.js.map +1 -0
  110. package/dist/esm/FormElement/Label/Label.styles.js.map +1 -0
  111. package/dist/esm/{Forms → FormElement}/Suggestions/Suggestions.js +7 -7
  112. package/dist/esm/FormElement/Suggestions/Suggestions.js.map +1 -0
  113. package/dist/esm/FormElement/Suggestions/Suggestions.styles.js.map +1 -0
  114. package/dist/esm/{Forms → FormElement}/WarningText/WarningText.js +5 -5
  115. package/dist/esm/FormElement/WarningText/WarningText.js.map +1 -0
  116. package/dist/esm/FormElement/WarningText/WarningText.styles.js.map +1 -0
  117. package/dist/esm/FormElement/context.js +11 -0
  118. package/dist/esm/FormElement/context.js.map +1 -0
  119. package/dist/esm/{Forms/FormElement/utils/FormUtils.js → FormElement/utils.js} +21 -11
  120. package/dist/esm/FormElement/utils.js.map +1 -0
  121. package/dist/esm/GlobalActions/GlobalActions.js.map +1 -1
  122. package/dist/esm/Grid/Grid.js +1 -1
  123. package/dist/esm/Grid/Grid.js.map +1 -1
  124. package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
  125. package/dist/esm/Input/Input.js +21 -21
  126. package/dist/esm/Input/Input.js.map +1 -1
  127. package/dist/esm/Input/Input.styles.js +2 -2
  128. package/dist/esm/Input/Input.styles.js.map +1 -1
  129. package/dist/esm/List/List.js.map +1 -1
  130. package/dist/esm/ListContainer/ListContext/ListContext.js +2 -2
  131. package/dist/esm/ListContainer/ListContext/ListContext.js.map +1 -1
  132. package/dist/esm/Pagination/Pagination.js.map +1 -1
  133. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js +1 -1
  134. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js.map +1 -1
  135. package/dist/esm/QueryBuilder/Rule/Value/TextValue/TextValue.js.map +1 -1
  136. package/dist/esm/Radio/Radio.js +9 -12
  137. package/dist/esm/Radio/Radio.js.map +1 -1
  138. package/dist/esm/RadioGroup/RadioGroup.js +7 -7
  139. package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
  140. package/dist/esm/Select/Select.js +5 -5
  141. package/dist/esm/Select/Select.js.map +1 -1
  142. package/dist/esm/SelectionList/SelectionList.js +7 -7
  143. package/dist/esm/SelectionList/SelectionList.js.map +1 -1
  144. package/dist/esm/Slider/Slider.js +12 -12
  145. package/dist/esm/Slider/Slider.js.map +1 -1
  146. package/dist/esm/Slider/SliderInput/SliderInput.js.map +1 -1
  147. package/dist/esm/Slider/utils.js +7 -7
  148. package/dist/esm/Slider/utils.js.map +1 -1
  149. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js +1 -1
  150. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
  151. package/dist/esm/SnackbarProvider/SnackbarProvider.js +1 -1
  152. package/dist/esm/SnackbarProvider/SnackbarProvider.js.map +1 -1
  153. package/dist/esm/Switch/Switch.js +8 -11
  154. package/dist/esm/Switch/Switch.js.map +1 -1
  155. package/dist/esm/Table/TableBody/TableBody.js +10 -8
  156. package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
  157. package/dist/esm/Table/TableCell/TableCell.js +2 -2
  158. package/dist/esm/Table/TableCell/TableCell.js.map +1 -1
  159. package/dist/esm/Table/TableContainer/TableContainer.js +9 -2
  160. package/dist/esm/Table/TableContainer/TableContainer.js.map +1 -1
  161. package/dist/esm/Table/TableHead/TableHead.js +10 -2
  162. package/dist/esm/Table/TableHead/TableHead.js.map +1 -1
  163. package/dist/esm/Table/TableHeader/TableHeader.js +2 -2
  164. package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
  165. package/dist/esm/Table/TableRow/TableRow.js +2 -2
  166. package/dist/esm/Table/TableRow/TableRow.js.map +1 -1
  167. package/dist/esm/TableSection/TableSection.styles.js +6 -2
  168. package/dist/esm/TableSection/TableSection.styles.js.map +1 -1
  169. package/dist/esm/TagsInput/TagsInput.js +19 -19
  170. package/dist/esm/TagsInput/TagsInput.js.map +1 -1
  171. package/dist/esm/TagsInput/TagsInput.styles.js +1 -1
  172. package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
  173. package/dist/esm/TextArea/TextArea.js +19 -19
  174. package/dist/esm/TextArea/TextArea.js.map +1 -1
  175. package/dist/esm/TimePicker/TimePicker.js +7 -7
  176. package/dist/esm/TimePicker/TimePicker.js.map +1 -1
  177. package/dist/esm/TreeView/internals/utils/EventManager.js.map +1 -1
  178. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +1 -1
  179. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
  180. package/dist/esm/hocs/withTooltip.js +40 -37
  181. package/dist/esm/hocs/withTooltip.js.map +1 -1
  182. package/dist/esm/hooks/useIsMounted.js +3 -3
  183. package/dist/esm/hooks/useIsMounted.js.map +1 -1
  184. package/dist/esm/index.js +14 -35
  185. package/dist/esm/index.js.map +1 -1
  186. package/dist/esm/utils/deepMerge.js.map +1 -1
  187. package/dist/types/index.d.ts +66 -143
  188. package/package.json +6 -6
  189. package/dist/cjs/Forms/FormElement/FormElement.cjs +0 -44
  190. package/dist/cjs/Forms/FormElement/context/FormElementContext.cjs +0 -12
  191. package/dist/cjs/Forms/FormElement/context/FormElementDescriptorsContext.cjs +0 -12
  192. package/dist/cjs/Forms/FormElement/context/FormElementValueContext.cjs +0 -12
  193. package/dist/cjs/Forms/FormElement/validationStates.cjs +0 -12
  194. package/dist/esm/Forms/Adornment/Adornment.js.map +0 -1
  195. package/dist/esm/Forms/Adornment/Adornment.styles.js.map +0 -1
  196. package/dist/esm/Forms/CharCounter/CharCounter.js.map +0 -1
  197. package/dist/esm/Forms/CharCounter/CharCounter.styles.js.map +0 -1
  198. package/dist/esm/Forms/FormElement/FormElement.js +0 -45
  199. package/dist/esm/Forms/FormElement/FormElement.js.map +0 -1
  200. package/dist/esm/Forms/FormElement/FormElement.styles.js.map +0 -1
  201. package/dist/esm/Forms/FormElement/context/FormElementContext.js +0 -10
  202. package/dist/esm/Forms/FormElement/context/FormElementContext.js.map +0 -1
  203. package/dist/esm/Forms/FormElement/context/FormElementDescriptorsContext.js +0 -10
  204. package/dist/esm/Forms/FormElement/context/FormElementDescriptorsContext.js.map +0 -1
  205. package/dist/esm/Forms/FormElement/context/FormElementValueContext.js +0 -10
  206. package/dist/esm/Forms/FormElement/context/FormElementValueContext.js.map +0 -1
  207. package/dist/esm/Forms/FormElement/utils/FormUtils.js.map +0 -1
  208. package/dist/esm/Forms/FormElement/validationStates.js +0 -12
  209. package/dist/esm/Forms/FormElement/validationStates.js.map +0 -1
  210. package/dist/esm/Forms/InfoMessage/InfoMessage.js.map +0 -1
  211. package/dist/esm/Forms/InfoMessage/InfoMessage.styles.js.map +0 -1
  212. package/dist/esm/Forms/Label/Label.js.map +0 -1
  213. package/dist/esm/Forms/Label/Label.styles.js.map +0 -1
  214. package/dist/esm/Forms/Suggestions/Suggestions.js.map +0 -1
  215. package/dist/esm/Forms/Suggestions/Suggestions.styles.js.map +0 -1
  216. package/dist/esm/Forms/WarningText/WarningText.js.map +0 -1
  217. package/dist/esm/Forms/WarningText/WarningText.styles.js.map +0 -1
  218. /package/dist/cjs/{Forms → FormElement}/Adornment/Adornment.styles.cjs +0 -0
  219. /package/dist/cjs/{Forms → FormElement}/CharCounter/CharCounter.styles.cjs +0 -0
  220. /package/dist/cjs/{Forms/FormElement → FormElement}/FormElement.styles.cjs +0 -0
  221. /package/dist/cjs/{Forms → FormElement}/InfoMessage/InfoMessage.styles.cjs +0 -0
  222. /package/dist/cjs/{Forms → FormElement}/Label/Label.styles.cjs +0 -0
  223. /package/dist/cjs/{Forms → FormElement}/Suggestions/Suggestions.styles.cjs +0 -0
  224. /package/dist/cjs/{Forms → FormElement}/WarningText/WarningText.styles.cjs +0 -0
  225. /package/dist/esm/{Forms → FormElement}/Adornment/Adornment.styles.js +0 -0
  226. /package/dist/esm/{Forms → FormElement}/CharCounter/CharCounter.styles.js +0 -0
  227. /package/dist/esm/{Forms/FormElement → FormElement}/FormElement.styles.js +0 -0
  228. /package/dist/esm/{Forms → FormElement}/InfoMessage/InfoMessage.styles.js +0 -0
  229. /package/dist/esm/{Forms → FormElement}/Label/Label.styles.js +0 -0
  230. /package/dist/esm/{Forms → FormElement}/Suggestions/Suggestions.styles.js +0 -0
  231. /package/dist/esm/{Forms → FormElement}/WarningText/WarningText.styles.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../src/Switch/Switch.tsx"],"sourcesContent":["import { forwardRef, useCallback } from \"react\";\nimport { SwitchProps as MuiSwitchProps } from \"@mui/material/Switch\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseSwitch } from \"../BaseSwitch\";\nimport {\n HvFormElement,\n HvFormStatus,\n HvLabel,\n HvLabelProps,\n HvWarningText,\n} from \"../Forms\";\nimport { isInvalid } from \"../Forms/FormElement/validationStates\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Switch.styles\";\n\nexport { staticClasses as switchClasses };\n\nexport type HvSwitchClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvSwitchProps\n extends Omit<MuiSwitchProps, \"color\" | \"onChange\" | \"classes\"> {\n /**\n * A Jss Object used to override or extend the styles applied to the switch.\n */\n classes?: HvSwitchClasses;\n /**\n * The form element name.\n */\n name?: string;\n /**\n * The value of the form element.\n *\n * Is up to the application's logic when to consider the submission of this value.\n * Generally it should be used only when the switch is neither unchecked nor indeterminate.\n *\n * The default value is \"on\".\n */\n value?: any;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be inputted via inputProps.\n */\n label?: React.ReactNode;\n /**\n * Properties passed on to the label element.\n */\n labelProps?: HvLabelProps;\n /**\n * Indicates that the form element is disabled.\n */\n disabled?: boolean;\n /**\n * Indicates that the form element is not editable.\n */\n readOnly?: boolean;\n /**\n * Indicates that user input is required on the form element.\n */\n required?: boolean;\n /**\n * If `true` the switch is selected, if set to `false` the switch is not selected.\n *\n * When defined the switch state becomes controlled.\n */\n checked?: boolean;\n /**\n * When uncontrolled, defines the initial checked state.\n */\n defaultChecked?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to `checked`, depending of the values of both `required` and `checked`.\n */\n status?: HvFormStatus;\n /**\n * The error message to show when the validation status is \"invalid\".\n *\n * Defaults to \"Required\" when the status is uncontrolled and no `aria-errormessage` is provided.\n */\n statusMessage?: string;\n /**\n * Identifies the element that provides an error message for the switch.\n *\n * Will only be used when the validation status is invalid.\n */\n \"aria-errormessage\"?: string;\n /**\n * The callback fired when the switch is pressed.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement>,\n checked: boolean,\n value: any,\n ) => void;\n /**\n * Properties passed on to the input element.\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** @ignore */\n ref?: MuiSwitchProps[\"ref\"];\n /** @ignore */\n component?: MuiSwitchProps[\"component\"];\n /** Color applied to the switch. */\n color?: HvColorAny;\n}\n\nconst isSemantical = (color: HvColorAny) =>\n [\"positive\", \"negative\", \"warning\"].includes(color);\n\n/**\n * A Switch is <b>binary</b> and work as a digital on/off button.\n *\n * Use when two states are <b>opposite</b> and to trigger immediate\n * changes in the system.\n */\nexport const HvSwitch = forwardRef<HTMLButtonElement, HvSwitchProps>(\n function HvSwitch(props, ref) {\n const {\n classes: classesProp,\n className,\n\n id,\n name,\n value = \"on\",\n required = false,\n readOnly = false,\n disabled = false,\n\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n labelProps,\n\n checked,\n defaultChecked = false,\n\n onChange,\n\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n\n inputProps,\n\n color,\n\n ...others\n } = useDefaultProps(\"HvSwitch\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const elementId = useUniqueId(id);\n\n const [isChecked, setIsChecked] = useControlled(\n checked,\n Boolean(defaultChecked),\n );\n\n const [validationState, setValidationState] = useControlled<HvFormStatus>(\n status,\n \"standBy\",\n );\n\n const [validationMessage] = useControlled(statusMessage, \"Required\");\n\n const onLocalChange = useCallback(\n (evt: React.ChangeEvent<HTMLInputElement>, newChecked: boolean) => {\n setIsChecked(() => {\n // this will only run if uncontrolled\n if (required && !newChecked) {\n setValidationState(\"invalid\");\n } else {\n setValidationState(\"valid\");\n }\n\n return newChecked;\n });\n\n onChange?.(evt, newChecked, value);\n },\n [onChange, required, setIsChecked, setValidationState, value],\n );\n\n // the error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and required is true\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined && required));\n\n const isStateInvalid = isInvalid(validationState);\n\n let errorMessageId: string | undefined;\n if (isStateInvalid) {\n errorMessageId = canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage;\n }\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={cx(classes.root, className)}\n >\n {label && (\n <HvLabel\n id={setId(elementId, \"label\")}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n className={classes.label}\n {...labelProps}\n />\n )}\n <div\n className={cx(classes.switchContainer, {\n [classes.invalidSwitch]: isStateInvalid,\n })}\n >\n <HvBaseSwitch\n ref={ref}\n id={label ? setId(elementId, \"input\") : setId(id, \"input\")}\n name={name}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n onChange={onLocalChange}\n value={value}\n checked={isChecked}\n inputProps={{\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...inputProps,\n }}\n {...(color && {\n classes: {\n switchBase: css({\n \"&&&+.HvBaseSwitch-track,&&&.HvBaseSwitch-checked+.HvBaseSwitch-track\":\n {\n backgroundColor: getColor(color),\n borderColor: isSemantical(color)\n ? getColor(`${color}_120`)\n : \"#00000032\",\n },\n }),\n },\n })}\n {...others}\n />\n </div>\n {canShowError && (\n <HvWarningText\n id={setId(elementId, \"error\")}\n className={classes.error}\n disableBorder\n disableAdornment\n hideText\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n },\n);\n"],"names":["HvSwitch"],"mappings":";;;;;;;;;;;;;;AAuHA,MAAM,eAAe,CAAC,UACpB,CAAC,YAAY,YAAY,SAAS,EAAE,SAAS,KAAK;AAQ7C,MAAM,WAAW;AAAA,EACtB,SAASA,UAAS,OAAO,KAAK;AACtB,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MAEA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MAEX;AAAA,MACA,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB;AAAA,MAEA;AAAA,MACA,iBAAiB;AAAA,MAEjB;AAAA,MAEA;AAAA,MACA;AAAA,MACA,qBAAqB;AAAA,MAErB;AAAA,MAEA;AAAA,MAEA,GAAG;AAAA,IAAA,IACD,gBAAgB,YAAY,KAAK;AAErC,UAAM,EAAE,SAAS,IAAI,IAAI,IAAI,WAAW,WAAW;AAE7C,UAAA,YAAY,YAAY,EAAE;AAE1B,UAAA,CAAC,WAAW,YAAY,IAAI;AAAA,MAChC;AAAA,MACA,QAAQ,cAAc;AAAA,IACxB;AAEM,UAAA,CAAC,iBAAiB,kBAAkB,IAAI;AAAA,MAC5C;AAAA,MACA;AAAA,IACF;AAEA,UAAM,CAAC,iBAAiB,IAAI,cAAc,eAAe,UAAU;AAEnE,UAAM,gBAAgB;AAAA,MACpB,CAAC,KAA0C,eAAwB;AACjE,qBAAa,MAAM;AAEb,cAAA,YAAY,CAAC,YAAY;AAC3B,+BAAmB,SAAS;AAAA,UAAA,OACvB;AACL,+BAAmB,OAAO;AAAA,UAAA;AAGrB,iBAAA;AAAA,QAAA,CACR;AAEU,mBAAA,KAAK,YAAY,KAAK;AAA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AAA,0BACE,iBAAiB,SAAS,KAAK;AAAA,0BAC/B,aAAa,aAAa,KAAK,IAC3B,SAAS,GAAG,KAAK,MAAM,IACvB;AAAA,wBAAA;AAAA,sBAET,CAAA;AAAA,oBAAA;AAAA,kBAEL;AAAA,kBACC,GAAG;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UACF;AAAA,UACC,gBACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI,MAAM,WAAW,OAAO;AAAA,cAC5B,WAAW,QAAQ;AAAA,cACnB,eAAa;AAAA,cACb,kBAAgB;AAAA,cAChB,UAAQ;AAAA,cAEP,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../src/Switch/Switch.tsx"],"sourcesContent":["import { forwardRef, useCallback } from \"react\";\nimport { SwitchProps as MuiSwitchProps } from \"@mui/material/Switch\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseSwitch } from \"../BaseSwitch\";\nimport {\n HvFormElement,\n HvFormStatus,\n HvLabel,\n HvLabelProps,\n HvWarningText,\n isInvalid,\n} from \"../FormElement\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Switch.styles\";\n\nexport { staticClasses as switchClasses };\n\nexport type HvSwitchClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvSwitchProps\n extends Omit<MuiSwitchProps, \"color\" | \"onChange\" | \"classes\"> {\n /**\n * A Jss Object used to override or extend the styles applied to the switch.\n */\n classes?: HvSwitchClasses;\n /**\n * The form element name.\n */\n name?: string;\n /**\n * The value of the form element.\n *\n * Is up to the application's logic when to consider the submission of this value.\n * Generally it should be used only when the switch is neither unchecked nor indeterminate.\n *\n * The default value is \"on\".\n */\n value?: any;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be inputted via inputProps.\n */\n label?: React.ReactNode;\n /**\n * Properties passed on to the label element.\n */\n labelProps?: HvLabelProps;\n /**\n * Indicates that the form element is disabled.\n */\n disabled?: boolean;\n /**\n * Indicates that the form element is not editable.\n */\n readOnly?: boolean;\n /**\n * Indicates that user input is required on the form element.\n */\n required?: boolean;\n /**\n * If `true` the switch is selected, if set to `false` the switch is not selected.\n *\n * When defined the switch state becomes controlled.\n */\n checked?: boolean;\n /**\n * When uncontrolled, defines the initial checked state.\n */\n defaultChecked?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to `checked`, depending of the values of both `required` and `checked`.\n */\n status?: HvFormStatus;\n /**\n * The error message to show when the validation status is \"invalid\".\n *\n * Defaults to \"Required\" when the status is uncontrolled and no `aria-errormessage` is provided.\n */\n statusMessage?: string;\n /**\n * Identifies the element that provides an error message for the switch.\n *\n * Will only be used when the validation status is invalid.\n */\n \"aria-errormessage\"?: string;\n /**\n * The callback fired when the switch is pressed.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement>,\n checked: boolean,\n value: any,\n ) => void;\n /**\n * Properties passed on to the input element.\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** @ignore */\n ref?: MuiSwitchProps[\"ref\"];\n /** @ignore */\n component?: MuiSwitchProps[\"component\"];\n /** Color applied to the switch. */\n color?: HvColorAny;\n}\n\nconst isSemantical = (color: HvColorAny) =>\n [\"positive\", \"negative\", \"warning\"].includes(color);\n\n/**\n * A Switch is <b>binary</b> and work as a digital on/off button.\n *\n * Use when two states are <b>opposite</b> and to trigger immediate\n * changes in the system.\n */\nexport const HvSwitch = forwardRef<HTMLButtonElement, HvSwitchProps>(\n function HvSwitch(props, ref) {\n const {\n classes: classesProp,\n className,\n\n id,\n name,\n value = \"on\",\n required,\n readOnly,\n disabled,\n\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n labelProps,\n\n checked,\n defaultChecked = false,\n\n onChange,\n\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n\n inputProps,\n\n color,\n\n ...others\n } = useDefaultProps(\"HvSwitch\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const elementId = useUniqueId(id);\n\n const [isChecked, setIsChecked] = useControlled(checked, defaultChecked);\n\n const [validationState, setValidationState] = useControlled<HvFormStatus>(\n status,\n \"standBy\",\n );\n\n const [validationMessage] = useControlled(statusMessage, \"Required\");\n\n const onLocalChange = useCallback(\n (evt: React.ChangeEvent<HTMLInputElement>, newChecked: boolean) => {\n setIsChecked(() => {\n // this will only run if uncontrolled\n if (required && !newChecked) {\n setValidationState(\"invalid\");\n } else {\n setValidationState(\"valid\");\n }\n\n return newChecked;\n });\n\n onChange?.(evt, newChecked, value);\n },\n [onChange, required, setIsChecked, setValidationState, value],\n );\n\n // the error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and required is true\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined && required));\n\n const isStateInvalid = isInvalid(validationState);\n\n let errorMessageId: string | undefined;\n if (isStateInvalid) {\n errorMessageId = canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage;\n }\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={cx(classes.root, className)}\n >\n {label && (\n <HvLabel\n id={setId(elementId, \"label\")}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n className={classes.label}\n {...labelProps}\n />\n )}\n <div\n className={cx(classes.switchContainer, {\n [classes.invalidSwitch]: isStateInvalid,\n })}\n >\n <HvBaseSwitch\n ref={ref}\n id={label ? setId(elementId, \"input\") : setId(id, \"input\")}\n name={name}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n onChange={onLocalChange}\n value={value}\n checked={isChecked}\n inputProps={{\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...inputProps,\n }}\n {...(color && {\n classes: {\n switchBase: css({\n \"&&&+.HvBaseSwitch-track,&&&.HvBaseSwitch-checked+.HvBaseSwitch-track\":\n {\n backgroundColor: getColor(color),\n borderColor: isSemantical(color)\n ? getColor(`${color}_120`)\n : \"#00000032\",\n },\n }),\n },\n })}\n {...others}\n />\n </div>\n {canShowError && (\n <HvWarningText\n id={setId(elementId, \"error\")}\n className={classes.error}\n disableBorder\n disableAdornment\n hideText\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n },\n);\n"],"names":["HvSwitch"],"mappings":";;;;;;;;;;;;;;AAuHA,MAAM,eAAe,CAAC,UACpB,CAAC,YAAY,YAAY,SAAS,EAAE,SAAS,KAAK;AAQ7C,MAAM,WAAW;AAAA,EACtB,SAASA,UAAS,OAAO,KAAK;AACtB,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MAEA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB;AAAA,MAEA;AAAA,MACA,iBAAiB;AAAA,MAEjB;AAAA,MAEA;AAAA,MACA;AAAA,MACA,qBAAqB;AAAA,MAErB;AAAA,MAEA;AAAA,MAEA,GAAG;AAAA,IAAA,IACD,gBAAgB,YAAY,KAAK;AAErC,UAAM,EAAE,SAAS,IA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,CAC1B;AAAA,cAED,UAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC;AAAA,kBACA,IAAI,QAAQ,MAAM,WAAW,OAAO,IAAI,MAAM,IAAI,OAAO;AAAA,kBACzD;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA,UAAU;AAAA,kBACV;AAAA,kBACA,SAAS;AAAA,kBACT,YAAY;AAAA,oBACV,gBAAgB,iBAAiB,OAAO;AAAA,oBACxC,qBAAqB;AAAA,oBACrB,cAAc;AAAA,oBACd,mBAAmB;AAAA,oBACnB,oBAAoB;AAAA,oBACpB,GAAG;AAAA,kBACL;AAAA,kBACC,GAAI,SAAS;AAAA,oBACZ,SAAS;AAAA,sBACP,YAAY,IAAI;AAAA,wBACd,wEACE;AAAA,0BACE,iBAAiB,SAAS,KAAK;AAAA,0BAC/B,aAAa,aAAa,KAAK,IAC3B,SAAS,GAAG,KAAK,MAAM,IACvB;AAAA,wBAAA;AAAA,sBAET,CAAA;AAAA,oBAAA;AAAA,kBAEL;AAAA,kBACC,GAAG;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UACF;AAAA,UACC,gBACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI,MAAM,WAAW,OAAO;AAAA,cAC5B,WAAW,QAAQ;AAAA,cACnB,eAAa;AAAA,cACb,kBAAgB;AAAA,cAChB,UAAQ;AAAA,cAEP,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
@@ -1,5 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useContext, useRef, Children, isValidElement } from "react";
3
+ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
3
4
  import { useForkRef } from "../../hooks/useForkRef.js";
4
5
  import TableContext from "../TableContext.js";
5
6
  import { TableSectionContext } from "../TableSectionContext.js";
@@ -12,14 +13,15 @@ const tableSectionContext = {
12
13
  };
13
14
  const defaultComponent = "tbody";
14
15
  const HvTableBody = forwardRef(
15
- ({
16
- classes: classesProp,
17
- className,
18
- component,
19
- children,
20
- withNavigation = false,
21
- ...others
22
- }, externalRef) => {
16
+ function HvTableBody2(props, externalRef) {
17
+ const {
18
+ classes: classesProp,
19
+ className,
20
+ component,
21
+ children,
22
+ withNavigation = false,
23
+ ...others
24
+ } = useDefaultProps("HvTableBody", props);
23
25
  const { classes, cx } = useClasses(classesProp);
24
26
  const tableContext = useContext(TableContext);
25
27
  const bodyRef = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.js","sources":["../../../../src/Table/TableBody/TableBody.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useContext,\n useRef,\n} from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvFocus } from \"../../Focus\";\nimport { useForkRef } from \"../../hooks/useForkRef\";\nimport { HvBaseProps } from \"../../types/generic\";\nimport TableContext from \"../TableContext\";\nimport {\n TableSectionContext,\n TableSectionContextValue,\n} from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableBody.styles\";\n\nexport { staticClasses as tableBodyClasses };\n\nexport type HvTableBodyClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableBodyProps\n extends HvBaseProps<HTMLTableSectionElement, \"children\"> {\n /**\n * Content to be rendered\n */\n children: React.ReactNode;\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to tbody.\n */\n component?: React.ElementType;\n /** Sets whether or not there should be arrow navigation between the table rows */\n withNavigation?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableBodyClasses;\n}\n\nconst tableSectionContext = {\n type: \"body\",\n filterClassName: \"_grid\",\n} satisfies TableSectionContextValue;\n\nconst defaultComponent = \"tbody\";\n\n/**\n * HvTableBody acts as a `tbody` element.\n * `HvTableCell` and `HvTableRow` elements in it inherit body-specific styles\n */\nexport const HvTableBody = forwardRef<HTMLElement, HvTableBodyProps>(\n (\n {\n classes: classesProp,\n className,\n component,\n children,\n withNavigation = false,\n ...others\n },\n externalRef,\n ) => {\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n\n const bodyRef = useRef(null);\n\n const handleRef = useForkRef(externalRef, bodyRef);\n\n const Component =\n component || tableContext?.components?.TBody || defaultComponent;\n\n return (\n <TableSectionContext.Provider value={tableSectionContext}>\n <Component\n className={cx(classes.root, className)}\n ref={handleRef}\n role={Component === defaultComponent ? null : \"rowgroup\"}\n {...others}\n >\n {withNavigation\n ? Children.map(children, (element) => {\n if (isValidElement(element)) {\n return (\n <HvFocus\n id={`my-id-${element.key}`}\n rootRef={bodyRef}\n key={`row-${element.key}`}\n strategy=\"grid\"\n filterClass={tableSectionContext.filterClassName}\n navigationJump={1}\n focusDisabled={false}\n selected={element.props.selected}\n >\n {element}\n </HvFocus>\n );\n }\n })\n : children}\n </Component>\n </TableSectionContext.Provider>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;AAwCA,MAAM,sBAAsB;AAAA,EAC1B,MAAM;AAAA,EACN,iBAAiB;AACnB;AAEA,MAAM,mBAAmB;AAMlB,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB;AAAA,IACjB,GAAG;AAAA,KAEL,gBACG;AACH,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AAEtC,UAAA,UAAU,OAAO,IAAI;AAErB,UAAA,YAAY,WAAW,aAAa,OAAO;AAEjD,UAAM,YACJ,aAAa,cAAc,YAAY,SAAS;AAElD,WACG,oBAAA,oBAAoB,UAApB,EAA6B,OAAO,qBACnC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,GAAG,QAAQ,MAAM,SAAS;AAAA,QACrC,KAAK;AAAA,QACL,MAAM,cAAc,mBAAmB,OAAO;AAAA,QAC7C,GAAG;AAAA,QAEH,UACG,iBAAA,SAAS,IAAI,UAAU,CAAC,YAAY;AAC9B,cAAA,eAAe,OAAO,GAAG;AAEzB,mBAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAI,SAAS,QAAQ,GAAG;AAAA,gBACxB,SAAS;AAAA,gBAET,UAAS;AAAA,gBACT,aAAa,oBAAoB;AAAA,gBACjC,gBAAgB;AAAA,gBAChB,eAAe;AAAA,gBACf,UAAU,QAAQ,MAAM;AAAA,gBAEvB,UAAA;AAAA,cAAA;AAAA,cAPI,OAAO,QAAQ,GAAG;AAAA,YAQzB;AAAA,UAAA;AAAA,QAEJ,CACD,IACD;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"TableBody.js","sources":["../../../../src/Table/TableBody/TableBody.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useContext,\n useRef,\n} from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvFocus } from \"../../Focus\";\nimport { useForkRef } from \"../../hooks/useForkRef\";\nimport { HvBaseProps } from \"../../types/generic\";\nimport TableContext from \"../TableContext\";\nimport {\n TableSectionContext,\n TableSectionContextValue,\n} from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableBody.styles\";\n\nexport { staticClasses as tableBodyClasses };\n\nexport type HvTableBodyClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableBodyProps\n extends HvBaseProps<HTMLTableSectionElement, \"children\"> {\n /**\n * Content to be rendered\n */\n children: React.ReactNode;\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to tbody.\n */\n component?: React.ElementType;\n /** Sets whether or not there should be arrow navigation between the table rows */\n withNavigation?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableBodyClasses;\n}\n\nconst tableSectionContext = {\n type: \"body\",\n filterClassName: \"_grid\",\n} satisfies TableSectionContextValue;\n\nconst defaultComponent = \"tbody\";\n\n/**\n * HvTableBody acts as a `tbody` element.\n * `HvTableCell` and `HvTableRow` elements in it inherit body-specific styles\n */\nexport const HvTableBody = forwardRef<HTMLElement, HvTableBodyProps>(\n function HvTableBody(props, externalRef) {\n const {\n classes: classesProp,\n className,\n component,\n children,\n withNavigation = false,\n ...others\n } = useDefaultProps(\"HvTableBody\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n\n const bodyRef = useRef(null);\n\n const handleRef = useForkRef(externalRef, bodyRef);\n\n const Component =\n component || tableContext?.components?.TBody || defaultComponent;\n\n return (\n <TableSectionContext.Provider value={tableSectionContext}>\n <Component\n className={cx(classes.root, className)}\n ref={handleRef}\n role={Component === defaultComponent ? null : \"rowgroup\"}\n {...others}\n >\n {withNavigation\n ? Children.map(children, (element) => {\n if (isValidElement(element)) {\n return (\n <HvFocus\n id={`my-id-${element.key}`}\n rootRef={bodyRef}\n key={`row-${element.key}`}\n strategy=\"grid\"\n filterClass={tableSectionContext.filterClassName}\n navigationJump={1}\n focusDisabled={false}\n selected={element.props.selected}\n >\n {element}\n </HvFocus>\n );\n }\n })\n : children}\n </Component>\n </TableSectionContext.Provider>\n );\n },\n);\n"],"names":["HvTableBody"],"mappings":";;;;;;;;;AA2CA,MAAM,sBAAsB;AAAA,EAC1B,MAAM;AAAA,EACN,iBAAiB;AACnB;AAEA,MAAM,mBAAmB;AAMlB,MAAM,cAAc;AAAA,EACzB,SAASA,aAAY,OAAO,aAAa;AACjC,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjB,GAAG;AAAA,IAAA,IACD,gBAAgB,eAAe,KAAK;AACxC,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AAEtC,UAAA,UAAU,OAAO,IAAI;AAErB,UAAA,YAAY,WAAW,aAAa,OAAO;AAEjD,UAAM,YACJ,aAAa,cAAc,YAAY,SAAS;AAElD,WACG,oBAAA,oBAAoB,UAApB,EAA6B,OAAO,qBACnC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,GAAG,QAAQ,MAAM,SAAS;AAAA,QACrC,KAAK;AAAA,QACL,MAAM,cAAc,mBAAmB,OAAO;AAAA,QAC7C,GAAG;AAAA,QAEH,UACG,iBAAA,SAAS,IAAI,UAAU,CAAC,YAAY;AAC9B,cAAA,eAAe,OAAO,GAAG;AAEzB,mBAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAI,SAAS,QAAQ,GAAG;AAAA,gBACxB,SAAS;AAAA,gBAET,UAAS;AAAA,gBACT,aAAa,oBAAoB;AAAA,gBACjC,gBAAgB;AAAA,gBAChB,eAAe;AAAA,gBACf,UAAU,QAAQ,MAAM;AAAA,gBAEvB,UAAA;AAAA,cAAA;AAAA,cAPI,OAAO,QAAQ,GAAG;AAAA,YAQzB;AAAA,UAAA;AAAA,QAEJ,CACD,IACD;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAAA;AAGN;"}
@@ -8,7 +8,7 @@ import { useClasses } from "./TableCell.styles.js";
8
8
  import { staticClasses } from "./TableCell.styles.js";
9
9
  const defaultComponent = "td";
10
10
  const HvTableCell = forwardRef(
11
- (props, externalRef) => {
11
+ function HvTableCell2(props, ref) {
12
12
  const {
13
13
  children,
14
14
  component,
@@ -36,7 +36,7 @@ const HvTableCell = forwardRef(
36
36
  return /* @__PURE__ */ jsx(
37
37
  Component,
38
38
  {
39
- ref: externalRef,
39
+ ref,
40
40
  role: Component === defaultComponent ? null : "cell",
41
41
  style,
42
42
  className: cx(
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","sources":["../../../../src/Table/TableCell/TableCell.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { capitalize } from \"../../utils/helpers\";\nimport {\n HvTableCellAlign,\n HvTableCellType,\n HvTableCellVariant,\n} from \"../Table\";\nimport TableContext from \"../TableContext\";\nimport { TableSectionContext } from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableCell.styles\";\n\nexport { staticClasses as tableCellClasses };\n\nexport type HvTableCellClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableCellProps\n extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to td. */\n component?: React.ElementType;\n /** Content to be rendered */\n children?: React.ReactNode;\n /** Inline styles to be applied to the root element. */\n style?: React.CSSProperties;\n /** Set the text-align on the table cell content. */\n align?: HvTableCellAlign;\n /** Sets the cell's variant. */\n variant?: HvTableCellVariant | \"listcheckbox\" | \"listactions\";\n /** Specify the cell's type. The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components. */\n type?: HvTableCellType;\n /** Whether or not the cell is part of a sorted column. */\n sorted?: boolean;\n /** The cell is part of a sticky column. */\n stickyColumn?: boolean;\n /** The cell is part of the last sticky to the left column. */\n stickyColumnMostLeft?: boolean;\n /** The cell is part of the first sticky to the right column. */\n stickyColumnLeastRight?: boolean;\n /** The cell is part of the first column in the group. */\n groupColumnMostLeft?: boolean;\n /** The cell is part of the last column in the group. */\n groupColumnMostRight?: boolean;\n /** Whether or not the cell is resizable */\n resizable?: boolean;\n /** Whether or not the cell is being resized */\n resizing?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableCellClasses;\n}\n\nconst defaultComponent = \"td\";\n\n/**\n * `HvTableCell` acts as a `td` element and inherits styles from its context\n */\nexport const HvTableCell = forwardRef<HTMLElement, HvTableCellProps>(\n (props, externalRef) => {\n const {\n children,\n component,\n className,\n style,\n classes: classesProp,\n align = \"inherit\",\n variant = \"default\",\n type: typeProp,\n stickyColumn = false,\n stickyColumnMostLeft = false,\n stickyColumnLeastRight = false,\n groupColumnMostLeft = false,\n groupColumnMostRight = false,\n sorted = false,\n resizable = false,\n resizing = false,\n ...others\n } = useDefaultProps(\"HvTableCell\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n\n const Component =\n component || tableContext?.components?.Td || defaultComponent;\n\n return (\n <Component\n ref={externalRef}\n role={Component === defaultComponent ? null : \"cell\"}\n style={style}\n className={cx(\n classes.root,\n classes[type],\n align !== \"inherit\" && classes[`align${capitalize(align)}`],\n variant !== \"default\" && classes[`variant${capitalize(variant)}`],\n {\n [classes.variantList]: tableContext.variant === \"listrow\",\n [classes.variantListHead]:\n tableContext.variant === \"listrow\" && type !== \"body\",\n [classes.sorted]: sorted,\n [classes.stickyColumn]: stickyColumn,\n [classes.stickyColumnMostLeft]: stickyColumnMostLeft,\n [classes.stickyColumnLeastRight]: stickyColumnLeastRight,\n [classes.groupColumnMostLeft]: groupColumnMostLeft,\n [classes.groupColumnMostRight]: groupColumnMostRight,\n [classes.resizable]: resizable,\n [classes.resizing]: resizing,\n },\n className,\n )}\n {...others}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;AAsDA,MAAM,mBAAmB;AAKlB,MAAM,cAAc;AAAA,EACzB,CAAC,OAAO,gBAAgB;AAChB,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,eAAe;AAAA,MACf,uBAAuB;AAAA,MACvB,yBAAyB;AAAA,MACzB,sBAAsB;AAAA,MACtB,uBAAuB;AAAA,MACvB,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,GAAG;AAAA,IAAA,IACD,gBAAgB,eAAe,KAAK;AAExC,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AACtC,UAAA,sBAAsB,WAAW,mBAAmB;AAEpD,UAAA,OAAO,YAAY,qBAAqB,QAAQ;AAEtD,UAAM,YACJ,aAAa,cAAc,YAAY,MAAM;AAG7C,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL,MAAM,cAAc,mBAAmB,OAAO;AAAA,QAC9C;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ,IAAI;AAAA,UACZ,UAAU,aAAa,QAAQ,QAAQ,WAAW,KAAK,CAAC,EAAE;AAAA,UAC1D,YAAY,aAAa,QAAQ,UAAU,WAAW,OAAO,CAAC,EAAE;AAAA,UAChE;AAAA,YACE,CAAC,QAAQ,WAAW,GAAG,aAAa,YAAY;AAAA,YAChD,CAAC,QAAQ,eAAe,GACtB,aAAa,YAAY,aAAa,SAAS;AAAA,YACjD,CAAC,QAAQ,MAAM,GAAG;AAAA,YAClB,CAAC,QAAQ,YAAY,GAAG;AAAA,YACxB,CAAC,QAAQ,oBAAoB,GAAG;AAAA,YAChC,CAAC,QAAQ,sBAAsB,GAAG;AAAA,YAClC,CAAC,QAAQ,mBAAmB,GAAG;AAAA,YAC/B,CAAC,QAAQ,oBAAoB,GAAG;AAAA,YAChC,CAAC,QAAQ,SAAS,GAAG;AAAA,YACrB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"TableCell.js","sources":["../../../../src/Table/TableCell/TableCell.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { capitalize } from \"../../utils/helpers\";\nimport {\n HvTableCellAlign,\n HvTableCellType,\n HvTableCellVariant,\n} from \"../Table\";\nimport TableContext from \"../TableContext\";\nimport { TableSectionContext } from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableCell.styles\";\n\nexport { staticClasses as tableCellClasses };\n\nexport type HvTableCellClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableCellProps\n extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to td. */\n component?: React.ElementType;\n /** Content to be rendered */\n children?: React.ReactNode;\n /** Inline styles to be applied to the root element. */\n style?: React.CSSProperties;\n /** Set the text-align on the table cell content. */\n align?: HvTableCellAlign;\n /** Sets the cell's variant. */\n variant?: HvTableCellVariant | \"listcheckbox\" | \"listactions\";\n /** Specify the cell's type. The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components. */\n type?: HvTableCellType;\n /** Whether or not the cell is part of a sorted column. */\n sorted?: boolean;\n /** The cell is part of a sticky column. */\n stickyColumn?: boolean;\n /** The cell is part of the last sticky to the left column. */\n stickyColumnMostLeft?: boolean;\n /** The cell is part of the first sticky to the right column. */\n stickyColumnLeastRight?: boolean;\n /** The cell is part of the first column in the group. */\n groupColumnMostLeft?: boolean;\n /** The cell is part of the last column in the group. */\n groupColumnMostRight?: boolean;\n /** Whether or not the cell is resizable */\n resizable?: boolean;\n /** Whether or not the cell is being resized */\n resizing?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableCellClasses;\n}\n\nconst defaultComponent = \"td\";\n\n/**\n * `HvTableCell` acts as a `td` element and inherits styles from its context\n */\nexport const HvTableCell = forwardRef<HTMLElement, HvTableCellProps>(\n function HvTableCell(props, ref) {\n const {\n children,\n component,\n className,\n style,\n classes: classesProp,\n align = \"inherit\",\n variant = \"default\",\n type: typeProp,\n stickyColumn = false,\n stickyColumnMostLeft = false,\n stickyColumnLeastRight = false,\n groupColumnMostLeft = false,\n groupColumnMostRight = false,\n sorted = false,\n resizable = false,\n resizing = false,\n ...others\n } = useDefaultProps(\"HvTableCell\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n\n const Component =\n component || tableContext?.components?.Td || defaultComponent;\n\n return (\n <Component\n ref={ref}\n role={Component === defaultComponent ? null : \"cell\"}\n style={style}\n className={cx(\n classes.root,\n classes[type],\n align !== \"inherit\" && classes[`align${capitalize(align)}`],\n variant !== \"default\" && classes[`variant${capitalize(variant)}`],\n {\n [classes.variantList]: tableContext.variant === \"listrow\",\n [classes.variantListHead]:\n tableContext.variant === \"listrow\" && type !== \"body\",\n [classes.sorted]: sorted,\n [classes.stickyColumn]: stickyColumn,\n [classes.stickyColumnMostLeft]: stickyColumnMostLeft,\n [classes.stickyColumnLeastRight]: stickyColumnLeastRight,\n [classes.groupColumnMostLeft]: groupColumnMostLeft,\n [classes.groupColumnMostRight]: groupColumnMostRight,\n [classes.resizable]: resizable,\n [classes.resizing]: resizing,\n },\n className,\n )}\n {...others}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":["HvTableCell"],"mappings":";;;;;;;;AAsDA,MAAM,mBAAmB;AAKlB,MAAM,cAAc;AAAA,EACzB,SAASA,aAAY,OAAO,KAAK;AACzB,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,eAAe;AAAA,MACf,uBAAuB;AAAA,MACvB,yBAAyB;AAAA,MACzB,sBAAsB;AAAA,MACtB,uBAAuB;AAAA,MACvB,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,GAAG;AAAA,IAAA,IACD,gBAAgB,eAAe,KAAK;AAExC,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AACtC,UAAA,sBAAsB,WAAW,mBAAmB;AAEpD,UAAA,OAAO,YAAY,qBAAqB,QAAQ;AAEtD,UAAM,YACJ,aAAa,cAAc,YAAY,MAAM;AAG7C,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,MAAM,cAAc,mBAAmB,OAAO;AAAA,QAC9C;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ,IAAI;AAAA,UACZ,UAAU,aAAa,QAAQ,QAAQ,WAAW,KAAK,CAAC,EAAE;AAAA,UAC1D,YAAY,aAAa,QAAQ,UAAU,WAAW,OAAO,CAAC,EAAE;AAAA,UAChE;AAAA,YACE,CAAC,QAAQ,WAAW,GAAG,aAAa,YAAY;AAAA,YAChD,CAAC,QAAQ,eAAe,GACtB,aAAa,YAAY,aAAa,SAAS;AAAA,YACjD,CAAC,QAAQ,MAAM,GAAG;AAAA,YAClB,CAAC,QAAQ,YAAY,GAAG;AAAA,YACxB,CAAC,QAAQ,oBAAoB,GAAG;AAAA,YAChC,CAAC,QAAQ,sBAAsB,GAAG;AAAA,YAClC,CAAC,QAAQ,mBAAmB,GAAG;AAAA,YAC/B,CAAC,QAAQ,oBAAoB,GAAG;AAAA,YAChC,CAAC,QAAQ,SAAS,GAAG;AAAA,YACrB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
@@ -1,15 +1,22 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
+ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
3
4
  import { useClasses } from "./TableContainer.styles.js";
4
5
  import { staticClasses } from "./TableContainer.styles.js";
5
6
  const HvTableContainer = forwardRef(
6
- ({ classes: classesProp, className, component, ...others }, externalRef) => {
7
+ function HvTableContainer2(props, ref) {
8
+ const {
9
+ classes: classesProp,
10
+ className,
11
+ component,
12
+ ...others
13
+ } = useDefaultProps("HvTableContainer", props);
7
14
  const { classes, cx } = useClasses(classesProp);
8
15
  const Component = component || "div";
9
16
  return /* @__PURE__ */ jsx(
10
17
  Component,
11
18
  {
12
- ref: externalRef,
19
+ ref,
13
20
  className: cx(classes.root, className),
14
21
  ...others
15
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TableContainer.js","sources":["../../../../src/Table/TableContainer/TableContainer.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { staticClasses, useClasses } from \"./TableContainer.styles\";\n\nexport { staticClasses as tableContainerClasses };\n\nexport type HvTableContainerClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableContainerProps\n extends HvBaseProps<HTMLDivElement, \"children\"> {\n /**\n * Content to be rendered\n */\n children: React.ReactNode;\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to tbody.\n */\n component?: React.ElementType;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableContainerClasses;\n}\n\n/**\n * HvTableContainer is a container for the HvTable\n */\nexport const HvTableContainer = forwardRef<HTMLElement, HvTableContainerProps>(\n ({ classes: classesProp, className, component, ...others }, externalRef) => {\n const { classes, cx } = useClasses(classesProp);\n\n const Component = component || \"div\";\n\n return (\n <Component\n ref={externalRef}\n className={cx(classes.root, className)}\n {...others}\n />\n );\n },\n);\n"],"names":[],"mappings":";;;;AA4BO,MAAM,mBAAmB;AAAA,EAC9B,CAAC,EAAE,SAAS,aAAa,WAAW,WAAW,GAAG,OAAO,GAAG,gBAAgB;AAC1E,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,UAAM,YAAY,aAAa;AAG7B,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAW,GAAG,QAAQ,MAAM,SAAS;AAAA,QACpC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"TableContainer.js","sources":["../../../../src/Table/TableContainer/TableContainer.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { staticClasses, useClasses } from \"./TableContainer.styles\";\n\nexport { staticClasses as tableContainerClasses };\n\nexport type HvTableContainerClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableContainerProps\n extends HvBaseProps<HTMLDivElement, \"children\"> {\n /**\n * Content to be rendered\n */\n children: React.ReactNode;\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to tbody.\n */\n component?: React.ElementType;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableContainerClasses;\n}\n\n/**\n * HvTableContainer is a container for the HvTable\n */\nexport const HvTableContainer = forwardRef<HTMLElement, HvTableContainerProps>(\n function HvTableContainer(props, ref) {\n const {\n classes: classesProp,\n className,\n component,\n ...others\n } = useDefaultProps(\"HvTableContainer\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const Component = component || \"div\";\n\n return (\n <Component\n ref={ref}\n className={cx(classes.root, className)}\n {...others}\n />\n );\n },\n);\n"],"names":["HvTableContainer"],"mappings":";;;;;AA+BO,MAAM,mBAAmB;AAAA,EAC9B,SAASA,kBAAiB,OAAO,KAAK;AAC9B,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD,gBAAgB,oBAAoB,KAAK;AAC7C,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,UAAM,YAAY,aAAa;AAG7B,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,QAAQ,MAAM,SAAS;AAAA,QACpC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
@@ -1,5 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useContext } from "react";
3
+ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
3
4
  import TableContext from "../TableContext.js";
4
5
  import { TableSectionContext } from "../TableSectionContext.js";
5
6
  import { useClasses } from "./TableHead.styles.js";
@@ -9,7 +10,14 @@ const tableSectionContext = {
9
10
  };
10
11
  const defaultComponent = "thead";
11
12
  const HvTableHead = forwardRef(
12
- ({ classes: classesProp, className, component, stickyHeader, ...others }, externalRef) => {
13
+ function HvTableHead2(props, ref) {
14
+ const {
15
+ classes: classesProp,
16
+ className,
17
+ component,
18
+ stickyHeader,
19
+ ...others
20
+ } = useDefaultProps("HvTableHead", props);
13
21
  const { classes, cx } = useClasses(classesProp);
14
22
  const tableContext = useContext(TableContext);
15
23
  const Component = component || tableContext?.components?.THead || defaultComponent;
@@ -21,7 +29,7 @@ const HvTableHead = forwardRef(
21
29
  { [classes.stickyHeader]: stickyHeader },
22
30
  className
23
31
  ),
24
- ref: externalRef,
32
+ ref,
25
33
  role: Component === defaultComponent ? null : "rowgroup",
26
34
  ...others
27
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TableHead.js","sources":["../../../../src/Table/TableHead/TableHead.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport TableContext from \"../TableContext\";\nimport {\n TableSectionContext,\n TableSectionContextValue,\n} from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableHead.styles\";\n\nexport { staticClasses as tableHeadClasses };\n\nexport type HvTableHeadClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableHeadProps\n extends HvBaseProps<HTMLTableSectionElement, \"children\"> {\n /**\n * Content to be rendered\n */\n children: React.ReactNode;\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to thead.\n */\n component?: React.ElementType;\n /**\n * The table has sticky headers.\n */\n stickyHeader?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableHeadClasses;\n}\n\nconst tableSectionContext = {\n type: \"head\",\n} satisfies TableSectionContextValue;\n\nconst defaultComponent = \"thead\";\n\n/**\n * HvTableHead acts as a `thead` element.\n * `HvTableCell` and `HvTableRow` elements in it inherit header-specific styles\n */\nexport const HvTableHead = forwardRef<HTMLElement, HvTableHeadProps>(\n (\n { classes: classesProp, className, component, stickyHeader, ...others },\n externalRef,\n ) => {\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n\n const Component =\n component || tableContext?.components?.THead || defaultComponent;\n\n return (\n <TableSectionContext.Provider value={tableSectionContext}>\n <Component\n className={cx(\n classes.root,\n { [classes.stickyHeader]: stickyHeader },\n className,\n )}\n ref={externalRef}\n role={Component === defaultComponent ? null : \"rowgroup\"}\n {...others}\n />\n </TableSectionContext.Provider>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;AAkCA,MAAM,sBAAsB;AAAA,EAC1B,MAAM;AACR;AAEA,MAAM,mBAAmB;AAMlB,MAAM,cAAc;AAAA,EACzB,CACE,EAAE,SAAS,aAAa,WAAW,WAAW,cAAc,GAAG,OAAO,GACtE,gBACG;AACH,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AAE5C,UAAM,YACJ,aAAa,cAAc,YAAY,SAAS;AAElD,WACG,oBAAA,oBAAoB,UAApB,EAA6B,OAAO,qBACnC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,EAAE,CAAC,QAAQ,YAAY,GAAG,aAAa;AAAA,UACvC;AAAA,QACF;AAAA,QACA,KAAK;AAAA,QACL,MAAM,cAAc,mBAAmB,OAAO;AAAA,QAC7C,GAAG;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"TableHead.js","sources":["../../../../src/Table/TableHead/TableHead.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport TableContext from \"../TableContext\";\nimport {\n TableSectionContext,\n TableSectionContextValue,\n} from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableHead.styles\";\n\nexport { staticClasses as tableHeadClasses };\n\nexport type HvTableHeadClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableHeadProps\n extends HvBaseProps<HTMLTableSectionElement, \"children\"> {\n /**\n * Content to be rendered\n */\n children: React.ReactNode;\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to thead.\n */\n component?: React.ElementType;\n /**\n * The table has sticky headers.\n */\n stickyHeader?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableHeadClasses;\n}\n\nconst tableSectionContext = {\n type: \"head\",\n} satisfies TableSectionContextValue;\n\nconst defaultComponent = \"thead\";\n\n/**\n * HvTableHead acts as a `thead` element.\n * `HvTableCell` and `HvTableRow` elements in it inherit header-specific styles\n */\nexport const HvTableHead = forwardRef<HTMLElement, HvTableHeadProps>(\n function HvTableHead(props, ref) {\n const {\n classes: classesProp,\n className,\n component,\n stickyHeader,\n ...others\n } = useDefaultProps(\"HvTableHead\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n\n const Component =\n component || tableContext?.components?.THead || defaultComponent;\n\n return (\n <TableSectionContext.Provider value={tableSectionContext}>\n <Component\n className={cx(\n classes.root,\n { [classes.stickyHeader]: stickyHeader },\n className,\n )}\n ref={ref}\n role={Component === defaultComponent ? null : \"rowgroup\"}\n {...others}\n />\n </TableSectionContext.Provider>\n );\n },\n);\n"],"names":["HvTableHead"],"mappings":";;;;;;;AAqCA,MAAM,sBAAsB;AAAA,EAC1B,MAAM;AACR;AAEA,MAAM,mBAAmB;AAMlB,MAAM,cAAc;AAAA,EACzB,SAASA,aAAY,OAAO,KAAK;AACzB,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD,gBAAgB,eAAe,KAAK;AACxC,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AAE5C,UAAM,YACJ,aAAa,cAAc,YAAY,SAAS;AAElD,WACG,oBAAA,oBAAoB,UAApB,EAA6B,OAAO,qBACnC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,EAAE,CAAC,QAAQ,YAAY,GAAG,aAAa;AAAA,UACvC;AAAA,QACF;AAAA,QACA;AAAA,QACA,MAAM,cAAc,mBAAmB,OAAO;AAAA,QAC7C,GAAG;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAAA;AAGN;"}
@@ -11,7 +11,7 @@ import { HvButton } from "../../Button/Button.js";
11
11
  import { HvTypography } from "../../Typography/Typography.js";
12
12
  const defaultComponent = "th";
13
13
  const HvTableHeader = forwardRef(
14
- (props, externalRef) => {
14
+ function HvTableHeader2(props, ref) {
15
15
  const {
16
16
  children,
17
17
  component,
@@ -54,7 +54,7 @@ const HvTableHeader = forwardRef(
54
54
  return /* @__PURE__ */ jsxs(
55
55
  Component,
56
56
  {
57
- ref: externalRef,
57
+ ref,
58
58
  role,
59
59
  scope,
60
60
  style,
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader.js","sources":["../../../../src/Table/TableHeader/TableHeader.tsx"],"sourcesContent":["import { forwardRef, useContext, useMemo } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps } from \"../../Button\";\nimport { HvTypography, HvTypographyProps } from \"../../Typography\";\nimport { capitalize } from \"../../utils/helpers\";\nimport {\n HvTableCellAlign,\n HvTableCellType,\n HvTableCellVariant,\n} from \"../Table\";\nimport TableContext from \"../TableContext\";\nimport { TableSectionContext } from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableHeader.styles\";\nimport { getSortIcon, isParagraph } from \"./utils\";\n\nexport { staticClasses as tableHeaderClasses };\n\nexport type HvTableHeaderClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableHeaderProps\n extends Omit<React.ThHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to th. */\n component?: React.ElementType;\n /** Content to be rendered */\n children?: React.ReactNode;\n /** The scope of cells that the header element relates to. */\n scope?: \"col\" | \"row\" | \"colgroup\" | \"rowgroup\";\n /** Set the text-align on the table cell content. */\n align?: HvTableCellAlign;\n /** Sets the cell's variant. */\n variant?: HvTableCellVariant;\n /** Specify the cell type. The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components. */\n type?: HvTableCellType;\n /** The cell is part of a sticky column. */\n stickyColumn?: boolean;\n /** The cell is part of the last sticky to the left column. */\n stickyColumnMostLeft?: boolean;\n /** The cell is part of the first sticky to the right column. */\n stickyColumnLeastRight?: boolean;\n /** The cell is part of the first column in the group. */\n groupColumnMostLeft?: boolean;\n /** The cell is part of the last column in the group. */\n groupColumnMostRight?: boolean;\n /** Whether or not the cell is sorted */\n sorted?: boolean;\n /** Whether or not the cell is sortable */\n sortable?: boolean;\n /** Set sort direction icon and aria-sort. */\n sortDirection?: \"ascending\" | \"descending\" | false;\n /** Extra props to be passed onto the text in the header. */\n headerTextProps?: HvTypographyProps;\n /** Whether or not the cell is resizable */\n resizable?: boolean;\n /** Whether or not the cell is being resized */\n resizing?: boolean;\n /** The resize props injected in the resize handler */\n resizerProps?: React.HTMLAttributes<HTMLDivElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableHeaderClasses;\n /** Extra props to be passed onto the sort button in the header. */\n sortButtonProps?: HvButtonProps;\n}\n\nconst defaultComponent = \"th\";\n\n/**\n * `HvTableHeader` acts as a `th` element and inherits styles from its context\n */\nexport const HvTableHeader = forwardRef<HTMLElement, HvTableHeaderProps>(\n (props, externalRef) => {\n const {\n children,\n component,\n className,\n style: styleProp,\n classes: classesProp,\n scope: scopeProp,\n align = \"inherit\",\n variant = \"default\",\n type: typeProp,\n stickyColumn = false,\n stickyColumnMostLeft = false,\n stickyColumnLeastRight = false,\n groupColumnMostLeft = false,\n groupColumnMostRight = false,\n sortDirection = \"none\",\n sorted,\n sortable,\n headerTextProps,\n resizerProps = {},\n resizable = false,\n resizing = false,\n sortButtonProps,\n ...others\n } = useDefaultProps(\"HvTableHeader\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n const isHeadCell = type === \"head\";\n\n const scope = scopeProp ?? (isHeadCell ? \"col\" : \"row\");\n\n const Sort = useMemo(\n () => getSortIcon(sorted && sortDirection),\n [sorted, sortDirection],\n );\n\n const Component =\n component || tableContext?.components?.Th || defaultComponent;\n\n const role =\n Component === defaultComponent\n ? null\n : isHeadCell\n ? \"columnheader\"\n : \"rowheader\";\n const paragraph = isParagraph(children);\n\n // Keep the header sticky\n const style = stickyColumn\n ? { ...styleProp, position: \"sticky\" }\n : styleProp;\n\n return (\n <Component\n ref={externalRef}\n role={role}\n scope={scope}\n style={style}\n className={cx(\n classes.root,\n classes[type],\n align !== \"inherit\" && classes[`align${capitalize(align)}`],\n variant !== \"default\" && classes[`variant${capitalize(variant)}`],\n {\n [classes.groupColumnMostLeft]: groupColumnMostLeft,\n [classes.groupColumnMostRight]: groupColumnMostRight,\n [classes.sortable]: sortable,\n [classes.sorted]: sorted,\n [classes.resizable]: resizable,\n [classes.resizing]: resizing,\n [classes.stickyColumn]: stickyColumn,\n [classes.stickyColumnMostLeft]: stickyColumnMostLeft,\n [classes.stickyColumnLeastRight]: stickyColumnLeastRight,\n [classes.variantList]: tableContext.variant === \"listrow\",\n },\n className,\n )}\n aria-sort={sortable ? sortDirection : undefined}\n {...others}\n >\n <div\n className={cx(\n classes.headerContent,\n align !== \"inherit\" && classes[`alignFlex${capitalize(align)}`],\n )}\n >\n {isHeadCell && sortable && (\n <HvButton\n className={classes.sortButton}\n icon\n overrideIconColors={false}\n aria-label=\"Sort\"\n {...sortButtonProps}\n >\n <Sort className={classes.sortIcon} />\n </HvButton>\n )}\n <HvTypography\n component=\"div\"\n className={cx({\n [classes.headerText]: !paragraph,\n [classes.headerParagraph]: paragraph,\n [classes.sortableHeaderText]: sortable,\n })}\n variant=\"label\"\n {...headerTextProps}\n >\n {children}\n </HvTypography>\n </div>\n {resizable && <div {...resizerProps} className={classes.resizer} />}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;;AAmEA,MAAM,mBAAmB;AAKlB,MAAM,gBAAgB;AAAA,EAC3B,CAAC,OAAO,gBAAgB;AAChB,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,eAAe;AAAA,MACf,uBAAuB;AAAA,MACvB,yBAAyB;AAAA,MACzB,sBAAsB;AAAA,MACtB,uBAAuB;AAAA,MACvB,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAe,CAAC;AAAA,MAChB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX;AAAA,MACA,GAAG;AAAA,IAAA,IACD,gBAAgB,iBAAiB,KAAK;AAC1C,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AACtC,UAAA,sBAAsB,WAAW,mBAAmB;AAEpD,UAAA,OAAO,YAAY,qBAAqB,QAAQ;AACtD,UAAM,aAAa,SAAS;AAEtB,UAAA,QAAQ,cAAc,aAAa,QAAQ;AAEjD,UAAM,OAAO;AAAA,MACX,MAAM,YAAY,UAAU,aAAa;AAAA,MACzC,CAAC,QAAQ,aA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AAA,oBACJ,oBAAoB;AAAA,oBACpB,cAAW;AAAA,oBACV,GAAG;AAAA,oBAEJ,UAAC,oBAAA,MAAA,EAAK,WAAW,QAAQ,SAAU,CAAA;AAAA,kBAAA;AAAA,gBACrC;AAAA,gBAEF;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,WAAW,GAAG;AAAA,sBACZ,CAAC,QAAQ,UAAU,GAAG,CAAC;AAAA,sBACvB,CAAC,QAAQ,eAAe,GAAG;AAAA,sBAC3B,CAAC,QAAQ,kBAAkB,GAAG;AAAA,oBAAA,CAC/B;AAAA,oBACD,SAAQ;AAAA,oBACP,GAAG;AAAA,oBAEH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA;AAAA,UACF;AAAA,UACC,aAAc,oBAAA,OAAA,EAAK,GAAG,cAAc,WAAW,QAAQ,QAAS,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACnE;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"TableHeader.js","sources":["../../../../src/Table/TableHeader/TableHeader.tsx"],"sourcesContent":["import { forwardRef, useContext, useMemo } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps } from \"../../Button\";\nimport { HvTypography, HvTypographyProps } from \"../../Typography\";\nimport { capitalize } from \"../../utils/helpers\";\nimport {\n HvTableCellAlign,\n HvTableCellType,\n HvTableCellVariant,\n} from \"../Table\";\nimport TableContext from \"../TableContext\";\nimport { TableSectionContext } from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableHeader.styles\";\nimport { getSortIcon, isParagraph } from \"./utils\";\n\nexport { staticClasses as tableHeaderClasses };\n\nexport type HvTableHeaderClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableHeaderProps\n extends Omit<React.ThHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to th. */\n component?: React.ElementType;\n /** Content to be rendered */\n children?: React.ReactNode;\n /** The scope of cells that the header element relates to. */\n scope?: \"col\" | \"row\" | \"colgroup\" | \"rowgroup\";\n /** Set the text-align on the table cell content. */\n align?: HvTableCellAlign;\n /** Sets the cell's variant. */\n variant?: HvTableCellVariant;\n /** Specify the cell type. The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components. */\n type?: HvTableCellType;\n /** The cell is part of a sticky column. */\n stickyColumn?: boolean;\n /** The cell is part of the last sticky to the left column. */\n stickyColumnMostLeft?: boolean;\n /** The cell is part of the first sticky to the right column. */\n stickyColumnLeastRight?: boolean;\n /** The cell is part of the first column in the group. */\n groupColumnMostLeft?: boolean;\n /** The cell is part of the last column in the group. */\n groupColumnMostRight?: boolean;\n /** Whether or not the cell is sorted */\n sorted?: boolean;\n /** Whether or not the cell is sortable */\n sortable?: boolean;\n /** Set sort direction icon and aria-sort. */\n sortDirection?: \"ascending\" | \"descending\" | false;\n /** Extra props to be passed onto the text in the header. */\n headerTextProps?: HvTypographyProps;\n /** Whether or not the cell is resizable */\n resizable?: boolean;\n /** Whether or not the cell is being resized */\n resizing?: boolean;\n /** The resize props injected in the resize handler */\n resizerProps?: React.HTMLAttributes<HTMLDivElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableHeaderClasses;\n /** Extra props to be passed onto the sort button in the header. */\n sortButtonProps?: HvButtonProps;\n}\n\nconst defaultComponent = \"th\";\n\n/**\n * `HvTableHeader` acts as a `th` element and inherits styles from its context\n */\nexport const HvTableHeader = forwardRef<HTMLElement, HvTableHeaderProps>(\n function HvTableHeader(props, ref) {\n const {\n children,\n component,\n className,\n style: styleProp,\n classes: classesProp,\n scope: scopeProp,\n align = \"inherit\",\n variant = \"default\",\n type: typeProp,\n stickyColumn = false,\n stickyColumnMostLeft = false,\n stickyColumnLeastRight = false,\n groupColumnMostLeft = false,\n groupColumnMostRight = false,\n sortDirection = \"none\",\n sorted,\n sortable,\n headerTextProps,\n resizerProps = {},\n resizable = false,\n resizing = false,\n sortButtonProps,\n ...others\n } = useDefaultProps(\"HvTableHeader\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n const isHeadCell = type === \"head\";\n\n const scope = scopeProp ?? (isHeadCell ? \"col\" : \"row\");\n\n const Sort = useMemo(\n () => getSortIcon(sorted && sortDirection),\n [sorted, sortDirection],\n );\n\n const Component =\n component || tableContext?.components?.Th || defaultComponent;\n\n const role =\n Component === defaultComponent\n ? null\n : isHeadCell\n ? \"columnheader\"\n : \"rowheader\";\n const paragraph = isParagraph(children);\n\n // Keep the header sticky\n const style = stickyColumn\n ? { ...styleProp, position: \"sticky\" }\n : styleProp;\n\n return (\n <Component\n ref={ref}\n role={role}\n scope={scope}\n style={style}\n className={cx(\n classes.root,\n classes[type],\n align !== \"inherit\" && classes[`align${capitalize(align)}`],\n variant !== \"default\" && classes[`variant${capitalize(variant)}`],\n {\n [classes.groupColumnMostLeft]: groupColumnMostLeft,\n [classes.groupColumnMostRight]: groupColumnMostRight,\n [classes.sortable]: sortable,\n [classes.sorted]: sorted,\n [classes.resizable]: resizable,\n [classes.resizing]: resizing,\n [classes.stickyColumn]: stickyColumn,\n [classes.stickyColumnMostLeft]: stickyColumnMostLeft,\n [classes.stickyColumnLeastRight]: stickyColumnLeastRight,\n [classes.variantList]: tableContext.variant === \"listrow\",\n },\n className,\n )}\n aria-sort={sortable ? sortDirection : undefined}\n {...others}\n >\n <div\n className={cx(\n classes.headerContent,\n align !== \"inherit\" && classes[`alignFlex${capitalize(align)}`],\n )}\n >\n {isHeadCell && sortable && (\n <HvButton\n className={classes.sortButton}\n icon\n overrideIconColors={false}\n aria-label=\"Sort\"\n {...sortButtonProps}\n >\n <Sort className={classes.sortIcon} />\n </HvButton>\n )}\n <HvTypography\n component=\"div\"\n className={cx({\n [classes.headerText]: !paragraph,\n [classes.headerParagraph]: paragraph,\n [classes.sortableHeaderText]: sortable,\n })}\n variant=\"label\"\n {...headerTextProps}\n >\n {children}\n </HvTypography>\n </div>\n {resizable && <div {...resizerProps} className={classes.resizer} />}\n </Component>\n );\n },\n);\n"],"names":["HvTableHeader"],"mappings":";;;;;;;;;;;AAmEA,MAAM,mBAAmB;AAKlB,MAAM,gBAAgB;AAAA,EAC3B,SAASA,eAAc,OAAO,KAAK;AAC3B,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,eAAe;AAAA,MACf,uBAAuB;AAAA,MACvB,yBAAyB;AAAA,MACzB,sBAAsB;AAAA,MACtB,uBAAuB;AAAA,MACvB,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAe,CAAC;AAAA,MAChB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX;AAAA,MACA,GAAG;AAAA,IAAA,IACD,gBAAgB,iBAAiB,KAAK;AAC1C,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AACtC,UAAA,sBAAsB,WAAW,mBAAmB;AAEpD,UAAA,OAAO,YAAY,qBAAqB,QAAQ;AACtD,UAAM,aAAa,SAAS;AAEtB,UAAA,QAAQ,cAAc,aAAa,QAAQ;AAEjD,UAAM,OAAO;AAAA,MACX,MAAM,YAAY,UAAU,aAAa;AAAA,MACzC,CAAC,QAAQ,aAAa;AAAA,IACxB;AAEA,UAAM,YACJ,aAAa,cAAc,YAAY,MAAM;AAE/C,UAAM,OACJ,cAAc,mBACV,OACA,aACE,iBACA;AACF,UAAA,YAAY,YAAY,QAAQ;AAGtC,UAAM,QAAQ,eACV,EAAE,GAAG,WAAW,UAAU,aAC1B;AAGF,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,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ACZ,CAAC,QAAQ,UAAU,GAAG,CAAC;AAAA,sBACvB,CAAC,QAAQ,eAAe,GAAG;AAAA,sBAC3B,CAAC,QAAQ,kBAAkB,GAAG;AAAA,oBAAA,CAC/B;AAAA,oBACD,SAAQ;AAAA,oBACP,GAAG;AAAA,oBAEH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA;AAAA,UACF;AAAA,UACC,aAAc,oBAAA,OAAA,EAAK,GAAG,cAAc,WAAW,QAAQ,QAAS,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACnE;AAAA,EAAA;AAGN;"}
@@ -7,7 +7,7 @@ import { useClasses } from "./TableRow.styles.js";
7
7
  import { staticClasses } from "./TableRow.styles.js";
8
8
  const defaultComponent = "tr";
9
9
  const HvTableRow = forwardRef(
10
- (props, externalRef) => {
10
+ function HvTableRow2(props, ref) {
11
11
  const {
12
12
  classes: classesProp,
13
13
  className,
@@ -27,7 +27,7 @@ const HvTableRow = forwardRef(
27
27
  return /* @__PURE__ */ jsx(
28
28
  Component,
29
29
  {
30
- ref: externalRef,
30
+ ref,
31
31
  className: cx(
32
32
  tableSectionContext.filterClassName,
33
33
  classes.root,
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.js","sources":["../../../../src/Table/TableRow/TableRow.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport TableContext from \"../TableContext\";\nimport { TableSectionContext } from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableRow.styles\";\n\nexport { staticClasses as tableRowClasses };\n\nexport type HvTableRowClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableRowProps\n extends HvBaseProps<HTMLTableRowElement, \"children\"> {\n /** Content to be rendered */\n children: React.ReactNode;\n /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to tbody. */\n component?: React.ElementType;\n /** Whether the table row will shade on hover. */\n hover?: boolean;\n /** Whether the table row will have the selected shading. */\n selected?: boolean;\n /** Whether the table row is expanded. */\n expanded?: boolean;\n /** Whether the table row background is striped. */\n striped?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableRowClasses;\n}\n\nconst defaultComponent = \"tr\";\n\n/**\n * `HvTableRow` acts as a `tr` element and inherits styles from its context\n */\nexport const HvTableRow = forwardRef<HTMLElement, HvTableRowProps>(\n (props, externalRef) => {\n const {\n classes: classesProp,\n className,\n component,\n hover = false,\n selected = false,\n expanded = false,\n striped = false,\n ...others\n } = useDefaultProps(\"HvTableRow\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = tableSectionContext?.type || \"body\";\n\n const isList = tableContext.variant === \"listrow\";\n\n const Component =\n component || tableContext?.components?.Tr || defaultComponent;\n\n return (\n <Component\n ref={externalRef}\n className={cx(\n tableSectionContext.filterClassName,\n classes.root,\n classes[type],\n {\n [classes.hover]: hover,\n [classes.selected]: selected,\n [classes.expanded]: expanded,\n [classes.striped]: striped,\n [classes.variantList]: isList && type === \"body\",\n [classes.variantListHead]: isList && type === \"head\",\n },\n className,\n )}\n role={Component === defaultComponent ? null : \"row\"}\n {...others}\n />\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;AAiCA,MAAM,mBAAmB;AAKlB,MAAM,aAAa;AAAA,EACxB,CAAC,OAAO,gBAAgB;AAChB,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,WAAW;AAAA,MACX,UAAU;AAAA,MACV,GAAG;AAAA,IAAA,IACD,gBAAgB,cAAc,KAAK;AAEvC,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AACtC,UAAA,sBAAsB,WAAW,mBAAmB;AAEpD,UAAA,OAAO,qBAAqB,QAAQ;AAEpC,UAAA,SAAS,aAAa,YAAY;AAExC,UAAM,YACJ,aAAa,cAAc,YAAY,MAAM;AAG7C,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAW;AAAA,UACT,oBAAoB;AAAA,UACpB,QAAQ;AAAA,UACR,QAAQ,IAAI;AAAA,UACZ;AAAA,YACE,CAAC,QAAQ,KAAK,GAAG;AAAA,YACjB,CAAC,QAAQ,QAAQ,GAAG;AAAA,YACpB,CAAC,QAAQ,QAAQ,GAAG;AAAA,YACpB,CAAC,QAAQ,OAAO,GAAG;AAAA,YACnB,CAAC,QAAQ,WAAW,GAAG,UAAU,SAAS;AAAA,YAC1C,CAAC,QAAQ,eAAe,GAAG,UAAU,SAAS;AAAA,UAChD;AAAA,UACA;AAAA,QACF;AAAA,QACA,MAAM,cAAc,mBAAmB,OAAO;AAAA,QAC7C,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"TableRow.js","sources":["../../../../src/Table/TableRow/TableRow.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport TableContext from \"../TableContext\";\nimport { TableSectionContext } from \"../TableSectionContext\";\nimport { staticClasses, useClasses } from \"./TableRow.styles\";\n\nexport { staticClasses as tableRowClasses };\n\nexport type HvTableRowClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableRowProps\n extends HvBaseProps<HTMLTableRowElement, \"children\"> {\n /** Content to be rendered */\n children: React.ReactNode;\n /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to tbody. */\n component?: React.ElementType;\n /** Whether the table row will shade on hover. */\n hover?: boolean;\n /** Whether the table row will have the selected shading. */\n selected?: boolean;\n /** Whether the table row is expanded. */\n expanded?: boolean;\n /** Whether the table row background is striped. */\n striped?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableRowClasses;\n}\n\nconst defaultComponent = \"tr\";\n\n/**\n * `HvTableRow` acts as a `tr` element and inherits styles from its context\n */\nexport const HvTableRow = forwardRef<HTMLElement, HvTableRowProps>(\n function HvTableRow(props, ref) {\n const {\n classes: classesProp,\n className,\n component,\n hover = false,\n selected = false,\n expanded = false,\n striped = false,\n ...others\n } = useDefaultProps(\"HvTableRow\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = tableSectionContext?.type || \"body\";\n\n const isList = tableContext.variant === \"listrow\";\n\n const Component =\n component || tableContext?.components?.Tr || defaultComponent;\n\n return (\n <Component\n ref={ref}\n className={cx(\n tableSectionContext.filterClassName,\n classes.root,\n classes[type],\n {\n [classes.hover]: hover,\n [classes.selected]: selected,\n [classes.expanded]: expanded,\n [classes.striped]: striped,\n [classes.variantList]: isList && type === \"body\",\n [classes.variantListHead]: isList && type === \"head\",\n },\n className,\n )}\n role={Component === defaultComponent ? null : \"row\"}\n {...others}\n />\n );\n },\n);\n"],"names":["HvTableRow"],"mappings":";;;;;;;AAiCA,MAAM,mBAAmB;AAKlB,MAAM,aAAa;AAAA,EACxB,SAASA,YAAW,OAAO,KAAK;AACxB,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,WAAW;AAAA,MACX,UAAU;AAAA,MACV,GAAG;AAAA,IAAA,IACD,gBAAgB,cAAc,KAAK;AAEvC,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,UAAA,eAAe,WAAW,YAAY;AACtC,UAAA,sBAAsB,WAAW,mBAAmB;AAEpD,UAAA,OAAO,qBAAqB,QAAQ;AAEpC,UAAA,SAAS,aAAa,YAAY;AAExC,UAAM,YACJ,aAAa,cAAc,YAAY,MAAM;AAG7C,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,oBAAoB;AAAA,UACpB,QAAQ;AAAA,UACR,QAAQ,IAAI;AAAA,UACZ;AAAA,YACE,CAAC,QAAQ,KAAK,GAAG;AAAA,YACjB,CAAC,QAAQ,QAAQ,GAAG;AAAA,YACpB,CAAC,QAAQ,QAAQ,GAAG;AAAA,YACpB,CAAC,QAAQ,OAAO,GAAG;AAAA,YACnB,CAAC,QAAQ,WAAW,GAAG,UAAU,SAAS;AAAA,YAC1C,CAAC,QAAQ,eAAe,GAAG,UAAU,SAAS;AAAA,UAChD;AAAA,UACA;AAAA,QACF;AAAA,QACA,MAAM,cAAc,mBAAmB,OAAO;AAAA,QAC7C,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
@@ -38,7 +38,9 @@ const { staticClasses, useClasses } = createClasses("HvTableSection", {
38
38
  borderBottomRightRadius: "inherit"
39
39
  },
40
40
  [`& .${staticClasses$1.root}`]: {
41
- paddingBottom: 0
41
+ paddingBottom: 0,
42
+ borderTopLeftRadius: "inherit",
43
+ borderTopRightRadius: "inherit"
42
44
  },
43
45
  [`& .${staticClasses$2.head}`]: {
44
46
  backgroundColor: theme.colors.atmo2,
@@ -75,7 +77,9 @@ const { staticClasses, useClasses } = createClasses("HvTableSection", {
75
77
  margin: 0,
76
78
  backgroundColor: theme.colors.atmo2,
77
79
  padding: theme.space.xs,
78
- borderTop: `1px solid ${theme.colors.atmo3}`
80
+ borderTop: `1px solid ${theme.colors.atmo3}`,
81
+ borderBottomLeftRadius: "inherit",
82
+ borderBottomRightRadius: "inherit"
79
83
  },
80
84
  [`& .${staticClasses$6.pageSizeOptions}`]: {
81
85
  left: theme.space.sm
@@ -1 +1 @@
1
- {"version":3,"file":"TableSection.styles.js","sources":["../../../src/TableSection/TableSection.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { bulkActionsClasses } from \"../BulkActions\";\nimport { paginationClasses } from \"../Pagination\";\nimport { tableCellClasses } from \"../Table/TableCell\";\nimport { tableContainerClasses } from \"../Table/TableContainer\";\nimport { tableHeaderClasses } from \"../Table/TableHeader\";\nimport { tableRowClasses } from \"../Table/TableRow\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableSection\", {\n root: {},\n header: {\n // Only apply the border to divide the header and content when both are displayed\n \"+ div\": {\n borderTop: `1px solid ${theme.colors.atmo3}`,\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n },\n },\n actions: {},\n content: {\n marginTop: 0,\n padding: 0,\n\n // Apply border radius to the first child if there's not an header\n \"&:first-of-type\": {\n \"& > :first-of-type\": {\n borderTopLeftRadius: \"inherit\",\n borderTopRightRadius: \"inherit\",\n },\n },\n\n \"& > :last-child\": {\n borderBottomLeftRadius: \"inherit\",\n borderBottomRightRadius: \"inherit\",\n },\n\n [`& .${tableContainerClasses.root}`]: {\n paddingBottom: 0,\n },\n\n [`& .${tableHeaderClasses.head}`]: {\n backgroundColor: theme.colors.atmo2,\n borderBottomColor: theme.colors.atmo3,\n [`&.${tableHeaderClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n [`&.${tableHeaderClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n },\n\n // Remove border for the last table row\n [`& .${tableRowClasses.root}`]: {\n \"&:last-child\": {\n [`& .${tableCellClasses.root}`]: { borderBottom: \"none\" },\n },\n },\n\n [`& .${tableCellClasses.root}`]: {\n borderBottomColor: theme.colors.atmo3,\n },\n\n [`& .${tableCellClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n\n [`& .${tableCellClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n\n [`& .${bulkActionsClasses.root}`]: {\n marginBottom: 0,\n border: \"none\",\n borderBottom: `1px solid ${theme.colors.atmo3}`,\n padding: theme.spacing(\"xs\", \"sm\"),\n },\n\n [`& .${paginationClasses.root}`]: {\n margin: 0,\n backgroundColor: theme.colors.atmo2,\n padding: theme.space.xs,\n borderTop: `1px solid ${theme.colors.atmo3}`,\n },\n\n [`& .${paginationClasses.pageSizeOptions}`]: {\n left: theme.space.sm,\n },\n [`& .${paginationClasses.pageSizeHeader}`]: {\n border: \"none\",\n \"&:hover\": {\n border: \"none\",\n },\n },\n },\n hidden: {},\n raisedHeader: {\n \"& $content\": {\n paddingTop: 0,\n },\n },\n hasHeader: {},\n /** @deprecated use `hasHeader` instead */\n spaceTop: {},\n});\n"],"names":["tableContainerClasses","tableHeaderClasses","tableRowClasses","tableCellClasses","bulkActionsClasses","paginationClasses"],"mappings":";;;;;;;;;;;;;;AAUO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,MAAM,CAAC;AAAA,EACP,QAAQ;AAAA;AAAA,IAEN,SAAS;AAAA,MACP,WAAW,aAAa,MAAM,OAAO,KAAK;AAAA,MAC1C,qBAAqB;AAAA,MACrB,sBAAsB;AAAA,IAAA;AAAA,EAE1B;AAAA,EACA,SAAS,CAAC;AAAA,EACV,SAAS;AAAA,IACP,WAAW;AAAA,IACX,SAAS;AAAA;AAAA,IAGT,mBAAmB;AAAA,MACjB,sBAAsB;AAAA,QACpB,qBAAqB;AAAA,QACrB,sBAAsB;AAAA,MAAA;AAAA,IAE1B;AAAA,IAEA,mBAAmB;AAAA,MACjB,wBAAwB;AAAA,MACxB,yBAAyB;AAAA,IAC3B;AAAA,IAEA,CAAC,MAAMA,gBAAsB,IAAI,EAAE,GAAG;AAAA,MACpC,eAAe;AAAA,IACjB;AAAA,IAEA,CAAC,MAAMC,gBAAmB,IAAI,EAAE,GAAG;AAAA,MACjC,iBAAiB,MAAM,OAAO;AAAA,MAC9B,mBAAmB,MAAM,OAAO;AAAA,MAChC,CAAC,KAAKA,gBAAmB,eAAe,EAAE,GAAG;AAAA,QAC3C,aAAa;AAAA,MACf;AAAA,MACA,CAAC,KAAKA,gBAAmB,cAAc,EAAE,GAAG;AAAA,QAC1C,YAAY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,CAAC;"}
1
+ {"version":3,"file":"TableSection.styles.js","sources":["../../../src/TableSection/TableSection.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { bulkActionsClasses } from \"../BulkActions\";\nimport { paginationClasses } from \"../Pagination\";\nimport { tableCellClasses } from \"../Table/TableCell\";\nimport { tableContainerClasses } from \"../Table/TableContainer\";\nimport { tableHeaderClasses } from \"../Table/TableHeader\";\nimport { tableRowClasses } from \"../Table/TableRow\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableSection\", {\n root: {},\n header: {\n // Only apply the border to divide the header and content when both are displayed\n \"+ div\": {\n borderTop: `1px solid ${theme.colors.atmo3}`,\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n },\n },\n actions: {},\n content: {\n marginTop: 0,\n padding: 0,\n\n // Apply border radius to the first child if there's not an header\n \"&:first-of-type\": {\n \"& > :first-of-type\": {\n borderTopLeftRadius: \"inherit\",\n borderTopRightRadius: \"inherit\",\n },\n },\n\n \"& > :last-child\": {\n borderBottomLeftRadius: \"inherit\",\n borderBottomRightRadius: \"inherit\",\n },\n\n [`& .${tableContainerClasses.root}`]: {\n paddingBottom: 0,\n borderTopLeftRadius: \"inherit\",\n borderTopRightRadius: \"inherit\",\n },\n\n [`& .${tableHeaderClasses.head}`]: {\n backgroundColor: theme.colors.atmo2,\n borderBottomColor: theme.colors.atmo3,\n [`&.${tableHeaderClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n [`&.${tableHeaderClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n },\n\n // Remove border for the last table row\n [`& .${tableRowClasses.root}`]: {\n \"&:last-child\": {\n [`& .${tableCellClasses.root}`]: { borderBottom: \"none\" },\n },\n },\n\n [`& .${tableCellClasses.root}`]: {\n borderBottomColor: theme.colors.atmo3,\n },\n\n [`& .${tableCellClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n\n [`& .${tableCellClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n\n [`& .${bulkActionsClasses.root}`]: {\n marginBottom: 0,\n border: \"none\",\n borderBottom: `1px solid ${theme.colors.atmo3}`,\n padding: theme.spacing(\"xs\", \"sm\"),\n },\n\n [`& .${paginationClasses.root}`]: {\n margin: 0,\n backgroundColor: theme.colors.atmo2,\n padding: theme.space.xs,\n borderTop: `1px solid ${theme.colors.atmo3}`,\n borderBottomLeftRadius: \"inherit\",\n borderBottomRightRadius: \"inherit\",\n },\n\n [`& .${paginationClasses.pageSizeOptions}`]: {\n left: theme.space.sm,\n },\n [`& .${paginationClasses.pageSizeHeader}`]: {\n border: \"none\",\n \"&:hover\": {\n border: \"none\",\n },\n },\n },\n hidden: {},\n raisedHeader: {\n \"& $content\": {\n paddingTop: 0,\n },\n },\n hasHeader: {},\n /** @deprecated use `hasHeader` instead */\n spaceTop: {},\n});\n"],"names":["tableContainerClasses","tableHeaderClasses","tableRowClasses","tableCellClasses","bulkActionsClasses","paginationClasses"],"mappings":";;;;;;;;;;;;;;AAUO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,MAAM,CAAC;AAAA,EACP,QAAQ;AAAA;AAAA,IAEN,SAAS;AAAA,MACP,WAAW,aAAa,MAAM,OAAO,KAAK;AAAA,MAC1C,qBAAqB;AAAA,MACrB,sBAAsB;AAAA,IAAA;AAAA,EAE1B;AAAA,EACA,SAAS,CAAC;AAAA,EACV,SAAS;AAAA,IACP,WAAW;AAAA,IACX,SAAS;AAAA;AAAA,IAGT,mBAAmB;AAAA,MACjB,sBAAsB;AAAA,QACpB,qBAAqB;AAAA,QACrB,sBAAsB;AAAA,MAAA;AAAA,IAE1B;AAAA,IAEA,mBAAmB;AAAA,MACjB,wBAAwB;AAAA,MACxB,yBAAyB;AAAA,IAC3B;AAAA,IAEA,CAAC,MAAMA,gBAAsB,IAAI,EAAE,GAAG;AAAA,MACpC,eAAe;AAAA,MACf,qBAAqB;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A,MAC3C,MAAM,MAAM,MAAM;AAAA,IACpB;AAAA,IACA,CAAC,MAAMA,gBAAkB,cAAc,EAAE,GAAG;AAAA,MAC1C,QAAQ;AAAA,MACR,WAAW;AAAA,QACT,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EAEJ;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,cAAc;AAAA,IACZ,cAAc;AAAA,MACZ,YAAY;AAAA,IAAA;AAAA,EAEhB;AAAA,EACA,WAAW,CAAC;AAAA;AAAA,EAEZ,UAAU,CAAA;AACZ,CAAC;"}
@@ -4,7 +4,7 @@ import { useForkRef } from "@mui/material/utils";
4
4
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
5
5
  import { theme } from "@hitachivantara/uikit-styles";
6
6
  import { DEFAULT_ERROR_MESSAGES } from "../BaseInput/validations.js";
7
- import validationState from "../Forms/FormElement/validationStates.js";
7
+ import { HvSuggestions } from "../FormElement/Suggestions/Suggestions.js";
8
8
  import { useControlled } from "../hooks/useControlled.js";
9
9
  import { useIsMounted } from "../hooks/useIsMounted.js";
10
10
  import { useUniqueId } from "../hooks/useUniqueId.js";
@@ -12,17 +12,17 @@ import { isKey } from "../utils/keyboardUtils.js";
12
12
  import { setId } from "../utils/setId.js";
13
13
  import { useClasses } from "./TagsInput.styles.js";
14
14
  import { staticClasses } from "./TagsInput.styles.js";
15
- import { HvCharCounter } from "../Forms/CharCounter/CharCounter.js";
16
- import { HvFormElement } from "../Forms/FormElement/FormElement.js";
17
- import { HvLabel } from "../Forms/Label/Label.js";
18
- import { HvInfoMessage } from "../Forms/InfoMessage/InfoMessage.js";
15
+ import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
16
+ import { validationStates } from "../FormElement/utils.js";
17
+ import { HvFormElement } from "../FormElement/FormElement.js";
18
+ import { HvLabel } from "../FormElement/Label/Label.js";
19
+ import { HvInfoMessage } from "../FormElement/InfoMessage/InfoMessage.js";
19
20
  import { HvListContainer } from "../ListContainer/ListContainer.js";
20
21
  import { HvListItem } from "../ListContainer/ListItem/ListItem.js";
21
22
  import { HvTag } from "../Tag/Tag.js";
22
23
  import { staticClasses as staticClasses2 } from "../BaseInput/BaseInput.styles.js";
23
24
  import { HvInput } from "../Input/Input.js";
24
- import { HvSuggestions } from "../Forms/Suggestions/Suggestions.js";
25
- import { HvWarningText } from "../Forms/WarningText/WarningText.js";
25
+ import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
26
26
  const HvTagsInput = forwardRef(
27
27
  function HvTagsInput2(props, ref) {
28
28
  const {
@@ -32,9 +32,9 @@ const HvTagsInput = forwardRef(
32
32
  name,
33
33
  value: valueProp,
34
34
  defaultValue = [],
35
- readOnly = false,
36
- disabled = false,
37
- required = false,
35
+ readOnly,
36
+ disabled,
37
+ required,
38
38
  label: textAreaLabel,
39
39
  "aria-label": ariaLabel,
40
40
  "aria-labelledby": ariaLabelledBy,
@@ -46,21 +46,21 @@ const HvTagsInput = forwardRef(
46
46
  onBlur,
47
47
  onFocus,
48
48
  placeholder,
49
- hideCounter = false,
49
+ hideCounter,
50
50
  middleCountLabel = "/",
51
51
  maxTagsQuantity,
52
52
  resizable = true,
53
53
  inputProps,
54
54
  countCharProps,
55
- multiline = false,
55
+ multiline,
56
56
  status,
57
57
  statusMessage,
58
58
  validationMessages,
59
59
  commitTagOn = ["Enter"],
60
- commitOnBlur = false,
60
+ commitOnBlur,
61
61
  suggestionListCallback,
62
62
  suggestionValidation,
63
- suggestionsLoose = false,
63
+ suggestionsLoose,
64
64
  ...others
65
65
  } = useDefaultProps("HvTagsInput", props);
66
66
  const { classes, cx, css } = useClasses(classesProp);
@@ -68,7 +68,7 @@ const HvTagsInput = forwardRef(
68
68
  const hasLabel = textAreaLabel != null;
69
69
  const hasDescription = description != null;
70
70
  const [value, setValue] = useControlled(valueProp, defaultValue);
71
- const [validationState$1, setValidationState] = useControlled(
71
+ const [validationState, setValidationState] = useControlled(
72
72
  status,
73
73
  "standBy"
74
74
  );
@@ -100,11 +100,11 @@ const HvTagsInput = forwardRef(
100
100
  const performValidation = useCallback(
101
101
  (currValue) => {
102
102
  if (maxTagsQuantity !== null && maxTagsQuantity !== void 0 && currValue.length > maxTagsQuantity) {
103
- setValidationState(validationState.invalid);
103
+ setValidationState(validationStates.invalid);
104
104
  setValidationMessage(errorMessages.maxCharError);
105
105
  setStateValid(false);
106
106
  } else {
107
- setValidationState(validationState.valid);
107
+ setValidationState(validationStates.valid);
108
108
  setValidationMessage("");
109
109
  setStateValid(true);
110
110
  }
@@ -285,7 +285,7 @@ const HvTagsInput = forwardRef(
285
285
  const onDeleteTagHandler = useCallback(
286
286
  (event, i) => {
287
287
  deleteTag(i, event, true);
288
- setValidationState(validationState.standBy);
288
+ setValidationState(validationStates.standBy);
289
289
  },
290
290
  [deleteTag, setValidationState]
291
291
  );
@@ -313,7 +313,7 @@ const HvTagsInput = forwardRef(
313
313
  name,
314
314
  disabled,
315
315
  readOnly,
316
- status: validationState$1,
316
+ status: validationState,
317
317
  required,
318
318
  onBlur: onBlurHandler,
319
319
  onFocus: onFocusHandler,