@hitachivantara/uikit-react-core 5.26.6 → 5.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs +2 -4
  2. package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs.map +1 -1
  3. package/dist/cjs/components/AppSwitcher/AppSwitcher.styles.cjs +1 -1
  4. package/dist/cjs/components/AppSwitcher/AppSwitcher.styles.cjs.map +1 -1
  5. package/dist/cjs/components/Banner/BannerContent/BannerContent.styles.cjs +1 -1
  6. package/dist/cjs/components/Banner/BannerContent/BannerContent.styles.cjs.map +1 -1
  7. package/dist/cjs/components/BaseInput/BaseInput.styles.cjs +5 -3
  8. package/dist/cjs/components/BaseInput/BaseInput.styles.cjs.map +1 -1
  9. package/dist/cjs/components/BulkActions/BulkActions.cjs +2 -3
  10. package/dist/cjs/components/BulkActions/BulkActions.cjs.map +1 -1
  11. package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.cjs +1 -1
  12. package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.cjs.map +1 -1
  13. package/dist/cjs/components/Carousel/Carousel.styles.cjs +4 -4
  14. package/dist/cjs/components/Carousel/Carousel.styles.cjs.map +1 -1
  15. package/dist/cjs/components/Dialog/Dialog.cjs +2 -4
  16. package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
  17. package/dist/cjs/components/Drawer/Drawer.cjs +2 -1
  18. package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
  19. package/dist/cjs/components/FileUploader/File/File.cjs +9 -10
  20. package/dist/cjs/components/FileUploader/File/File.cjs.map +1 -1
  21. package/dist/cjs/components/FileUploader/File/File.styles.cjs +4 -12
  22. package/dist/cjs/components/FileUploader/File/File.styles.cjs.map +1 -1
  23. package/dist/cjs/components/FilterGroup/FilterContent/FilterContent.styles.cjs +3 -3
  24. package/dist/cjs/components/FilterGroup/FilterContent/FilterContent.styles.cjs.map +1 -1
  25. package/dist/cjs/components/GlobalActions/GlobalActions.cjs +4 -9
  26. package/dist/cjs/components/GlobalActions/GlobalActions.cjs.map +1 -1
  27. package/dist/cjs/components/GlobalActions/GlobalActions.styles.cjs +2 -7
  28. package/dist/cjs/components/GlobalActions/GlobalActions.styles.cjs.map +1 -1
  29. package/dist/cjs/components/InlineEditor/InlineEditor.styles.cjs +2 -2
  30. package/dist/cjs/components/InlineEditor/InlineEditor.styles.cjs.map +1 -1
  31. package/dist/cjs/components/Pagination/Select.styles.cjs +1 -1
  32. package/dist/cjs/components/Pagination/Select.styles.cjs.map +1 -1
  33. package/dist/cjs/components/ProgressBar/ProgressBar.cjs +2 -1
  34. package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
  35. package/dist/cjs/components/ProgressBar/ProgressBar.styles.cjs +1 -2
  36. package/dist/cjs/components/ProgressBar/ProgressBar.styles.cjs.map +1 -1
  37. package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs +2 -2
  38. package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs.map +1 -1
  39. package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs +2 -2
  40. package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs.map +1 -1
  41. package/dist/cjs/components/Table/TableCell/TableCell.cjs +2 -2
  42. package/dist/cjs/components/Table/TableCell/TableCell.cjs.map +1 -1
  43. package/dist/cjs/components/Table/TableHeader/TableHeader.cjs +6 -4
  44. package/dist/cjs/components/Table/TableHeader/TableHeader.cjs.map +1 -1
  45. package/dist/cjs/components/Table/TableHeader/TableHeader.styles.cjs +1 -1
  46. package/dist/cjs/components/Table/TableHeader/TableHeader.styles.cjs.map +1 -1
  47. package/dist/cjs/components/Table/TableRow/TableRow.cjs +3 -4
  48. package/dist/cjs/components/Table/TableRow/TableRow.cjs.map +1 -1
  49. package/dist/cjs/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.cjs +4 -2
  50. package/dist/cjs/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.cjs.map +1 -1
  51. package/dist/cjs/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.cjs +5 -2
  52. package/dist/cjs/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.cjs.map +1 -1
  53. package/dist/cjs/components/Table/renderers/renderers.cjs +6 -3
  54. package/dist/cjs/components/Table/renderers/renderers.cjs.map +1 -1
  55. package/dist/cjs/components/Tag/Tag.cjs +2 -4
  56. package/dist/cjs/components/Tag/Tag.cjs.map +1 -1
  57. package/dist/cjs/components/TimePicker/TimePicker.styles.cjs +1 -1
  58. package/dist/cjs/components/TimePicker/TimePicker.styles.cjs.map +1 -1
  59. package/dist/cjs/components/VerticalNavigation/VerticalNavigation.styles.cjs +4 -4
  60. package/dist/cjs/components/VerticalNavigation/VerticalNavigation.styles.cjs.map +1 -1
  61. package/dist/cjs/hooks/useTheme.cjs +12 -1
  62. package/dist/cjs/hooks/useTheme.cjs.map +1 -1
  63. package/dist/esm/components/ActionsGeneric/ActionsGeneric.js +2 -4
  64. package/dist/esm/components/ActionsGeneric/ActionsGeneric.js.map +1 -1
  65. package/dist/esm/components/AppSwitcher/AppSwitcher.styles.js +1 -1
  66. package/dist/esm/components/AppSwitcher/AppSwitcher.styles.js.map +1 -1
  67. package/dist/esm/components/Banner/BannerContent/BannerContent.styles.js +1 -1
  68. package/dist/esm/components/Banner/BannerContent/BannerContent.styles.js.map +1 -1
  69. package/dist/esm/components/BaseInput/BaseInput.styles.js +5 -3
  70. package/dist/esm/components/BaseInput/BaseInput.styles.js.map +1 -1
  71. package/dist/esm/components/BulkActions/BulkActions.js +2 -3
  72. package/dist/esm/components/BulkActions/BulkActions.js.map +1 -1
  73. package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js +1 -1
  74. package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js.map +1 -1
  75. package/dist/esm/components/Carousel/Carousel.styles.js +4 -4
  76. package/dist/esm/components/Carousel/Carousel.styles.js.map +1 -1
  77. package/dist/esm/components/Dialog/Dialog.js +2 -4
  78. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  79. package/dist/esm/components/Drawer/Drawer.js +2 -1
  80. package/dist/esm/components/Drawer/Drawer.js.map +1 -1
  81. package/dist/esm/components/FileUploader/File/File.js +9 -10
  82. package/dist/esm/components/FileUploader/File/File.js.map +1 -1
  83. package/dist/esm/components/FileUploader/File/File.styles.js +4 -12
  84. package/dist/esm/components/FileUploader/File/File.styles.js.map +1 -1
  85. package/dist/esm/components/FilterGroup/FilterContent/FilterContent.styles.js +3 -3
  86. package/dist/esm/components/FilterGroup/FilterContent/FilterContent.styles.js.map +1 -1
  87. package/dist/esm/components/GlobalActions/GlobalActions.js +4 -9
  88. package/dist/esm/components/GlobalActions/GlobalActions.js.map +1 -1
  89. package/dist/esm/components/GlobalActions/GlobalActions.styles.js +2 -7
  90. package/dist/esm/components/GlobalActions/GlobalActions.styles.js.map +1 -1
  91. package/dist/esm/components/InlineEditor/InlineEditor.styles.js +2 -2
  92. package/dist/esm/components/InlineEditor/InlineEditor.styles.js.map +1 -1
  93. package/dist/esm/components/Pagination/Select.styles.js +1 -1
  94. package/dist/esm/components/Pagination/Select.styles.js.map +1 -1
  95. package/dist/esm/components/ProgressBar/ProgressBar.js +2 -1
  96. package/dist/esm/components/ProgressBar/ProgressBar.js.map +1 -1
  97. package/dist/esm/components/ProgressBar/ProgressBar.styles.js +1 -2
  98. package/dist/esm/components/ProgressBar/ProgressBar.styles.js.map +1 -1
  99. package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js +2 -2
  100. package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js.map +1 -1
  101. package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js +2 -2
  102. package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js.map +1 -1
  103. package/dist/esm/components/Table/TableCell/TableCell.js +2 -2
  104. package/dist/esm/components/Table/TableCell/TableCell.js.map +1 -1
  105. package/dist/esm/components/Table/TableHeader/TableHeader.js +6 -4
  106. package/dist/esm/components/Table/TableHeader/TableHeader.js.map +1 -1
  107. package/dist/esm/components/Table/TableHeader/TableHeader.styles.js +1 -1
  108. package/dist/esm/components/Table/TableHeader/TableHeader.styles.js.map +1 -1
  109. package/dist/esm/components/Table/TableRow/TableRow.js +3 -4
  110. package/dist/esm/components/Table/TableRow/TableRow.js.map +1 -1
  111. package/dist/esm/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.js +4 -2
  112. package/dist/esm/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.js.map +1 -1
  113. package/dist/esm/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.js +5 -2
  114. package/dist/esm/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.js.map +1 -1
  115. package/dist/esm/components/Table/renderers/renderers.js +6 -3
  116. package/dist/esm/components/Table/renderers/renderers.js.map +1 -1
  117. package/dist/esm/components/Tag/Tag.js +2 -4
  118. package/dist/esm/components/Tag/Tag.js.map +1 -1
  119. package/dist/esm/components/TimePicker/TimePicker.styles.js +1 -1
  120. package/dist/esm/components/TimePicker/TimePicker.styles.js.map +1 -1
  121. package/dist/esm/components/VerticalNavigation/VerticalNavigation.styles.js +4 -4
  122. package/dist/esm/components/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
  123. package/dist/esm/hooks/useTheme.js +13 -2
  124. package/dist/esm/hooks/useTheme.js.map +1 -1
  125. package/dist/types/index.d.ts +16 -4
  126. package/package.json +5 -5
@@ -40,7 +40,7 @@ const HvTableCell = forwardRef((props, externalRef) => {
40
40
  css
41
41
  } = useClasses(classesProp);
42
42
  const {
43
- activeTheme,
43
+ colors,
44
44
  rootId
45
45
  } = useTheme();
46
46
  const tableContext = useContext(TableContext);
@@ -54,7 +54,7 @@ const HvTableCell = forwardRef((props, externalRef) => {
54
54
  setSortedColorValue(getVarValue(theme.table.rowSortedColor, rootId));
55
55
  setSortedColorAlpha(getVarValue(theme.table.rowSortedColorAlpha, rootId));
56
56
  setSortedColor(getSortedColor(sortedColorValue, sortedColorAlpha));
57
- }, [activeTheme == null ? void 0 : activeTheme.colors.modes.selectedMode, sortedColorValue, sortedColorAlpha, rootId]);
57
+ }, [colors, sortedColorValue, sortedColorAlpha, rootId]);
58
58
  return /* @__PURE__ */ jsx(Component, {
59
59
  ref: externalRef,
60
60
  role: Component === defaultComponent ? null : "cell",
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","sources":["../../../../../src/components/Table/TableCell/TableCell.tsx"],"sourcesContent":["import capitalize from \"lodash/capitalize\";\n\nimport {\n CSSProperties,\n forwardRef,\n TdHTMLAttributes,\n useContext,\n useEffect,\n useState,\n} from \"react\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { checkValidHexColorValue } from \"@core/utils/checkValidHexColorValue\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { getVarValue } from \"@core/utils/theme\";\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\nimport { useTheme } from \"@core/hooks/useTheme\";\n\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<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?: 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\nconst getSortedColor = (color?: string, alpha?: string) => {\n return checkValidHexColorValue(color) && alpha\n ? hexToRgbA(color, parseFloat(alpha))\n : color;\n};\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 } = props;\n const { classes, cx, css } = useClasses(classesProp);\n const { activeTheme, rootId } = useTheme();\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const [sortedColorValue, setSortedColorValue] = useState<\n string | undefined\n >();\n const [sortedColorAlpha, setSortedColorAlpha] = useState<\n string | undefined\n >();\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n\n const Component =\n component || tableContext?.components?.Td || defaultComponent;\n\n const [sortedColor, setSortedColor] = useState(\n getSortedColor(sortedColorValue, sortedColorAlpha)\n );\n\n useEffect(() => {\n setSortedColorValue(getVarValue(theme.table.rowSortedColor, rootId));\n setSortedColorAlpha(getVarValue(theme.table.rowSortedColorAlpha, rootId));\n\n setSortedColor(getSortedColor(sortedColorValue, sortedColorAlpha));\n }, [\n activeTheme?.colors.modes.selectedMode,\n sortedColorValue,\n sortedColorAlpha,\n rootId,\n ]);\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 type === \"body\" &&\n css({\n [`&.${staticClasses.sorted}`]: {\n backgroundColor: sortedColor,\n },\n }),\n stickyColumn &&\n css({\n [`&.${staticClasses.sorted}`]: {\n backgroundImage: `linear-gradient(to right, ${sortedColor}, ${sortedColor})`,\n },\n }),\n {\n [classes[`align${capitalize(align)}`]]: align !== \"inherit\",\n [classes.variantList]: tableContext.variant === \"listrow\",\n [classes.variantListHead]:\n tableContext.variant === \"listrow\" && type !== \"body\",\n [classes[`variant${capitalize(variant)}`]]: variant !== \"default\",\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":["defaultComponent","getSortedColor","color","alpha","checkValidHexColorValue","hexToRgbA","parseFloat","HvTableCell","forwardRef","props","externalRef","children","component","className","style","classes","classesProp","align","variant","type","typeProp","stickyColumn","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sorted","resizable","resizing","others","cx","css","useClasses","activeTheme","rootId","useTheme","tableContext","useContext","TableContext","tableSectionContext","TableSectionContext","sortedColorValue","setSortedColorValue","useState","sortedColorAlpha","setSortedColorAlpha","Component","components","Td","sortedColor","setSortedColor","useEffect","getVarValue","theme","table","rowSortedColor","rowSortedColorAlpha","colors","modes","selectedMode","ref","role","root","staticClasses","backgroundColor","backgroundImage","capitalize","variantList","variantListHead"],"mappings":";;;;;;;;;;;AAkEA,MAAMA,mBAAmB;AAEzB,MAAMC,iBAAiBA,CAACC,OAAgBC,UAAmB;AAClDC,SAAAA,wBAAwBF,KAAK,KAAKC,QACrCE,UAAUH,OAAOI,WAAWH,KAAK,CAAC,IAClCD;AACN;AAKO,MAAMK,cAAcC,WACzB,CAACC,OAAOC,gBAAgB;;AAChB,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,IACTC,QAAQ;AAAA,IACRC,UAAU;AAAA,IACVC,MAAMC;AAAAA,IACNC,eAAe;AAAA,IACfC,uBAAuB;AAAA,IACvBC,yBAAyB;AAAA,IACzBC,sBAAsB;AAAA,IACtBC,uBAAuB;AAAA,IACvBC,SAAS;AAAA,IACTC,YAAY;AAAA,IACZC,WAAW;AAAA,IACX,GAAGC;AAAAA,EACDpB,IAAAA;AACE,QAAA;AAAA,IAAEM;AAAAA,IAASe;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,WAAWhB,WAAW;AAC7C,QAAA;AAAA,IAAEiB;AAAAA,IAAaC;AAAAA,MAAWC,SAAS;AACnCC,QAAAA,eAAeC,WAAWC,YAAY;AACtCC,QAAAA,sBAAsBF,WAAWG,mBAAmB;AAE1D,QAAM,CAACC,kBAAkBC,mBAAmB,IAAIC,SAE9C;AACF,QAAM,CAACC,kBAAkBC,mBAAmB,IAAIF,SAE9C;AAEIxB,QAAAA,OAAOC,aAAYmB,2DAAqBpB,SAAQ;AAEtD,QAAM2B,YACJlC,eAAawB,kDAAcW,eAAdX,mBAA0BY,OAAMhD;AAEzC,QAAA,CAACiD,aAAaC,cAAc,IAAIP,SACpC1C,eAAewC,kBAAkBG,gBAAgB,CACnD;AAEAO,YAAU,MAAM;AACdT,wBAAoBU,YAAY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Z,QAAQa,QAAQ,GAAGA;AAAAA,OAEtBf,SACF;AAAA,IAAE,GACEgB;AAAAA,IAAMlB;AAAAA,EAAAA,CAGD;AAEf,CACF;"}
1
+ {"version":3,"file":"TableCell.js","sources":["../../../../../src/components/Table/TableCell/TableCell.tsx"],"sourcesContent":["import capitalize from \"lodash/capitalize\";\n\nimport {\n CSSProperties,\n forwardRef,\n TdHTMLAttributes,\n useContext,\n useEffect,\n useState,\n} from \"react\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { checkValidHexColorValue } from \"@core/utils/checkValidHexColorValue\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { getVarValue } from \"@core/utils/theme\";\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\nimport { useTheme } from \"@core/hooks/useTheme\";\n\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<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?: 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\nconst getSortedColor = (color?: string, alpha?: string) => {\n return checkValidHexColorValue(color) && alpha\n ? hexToRgbA(color, parseFloat(alpha))\n : color;\n};\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 } = props;\n const { classes, cx, css } = useClasses(classesProp);\n const { colors, rootId } = useTheme();\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const [sortedColorValue, setSortedColorValue] = useState<string>();\n const [sortedColorAlpha, setSortedColorAlpha] = useState<string>();\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n\n const Component =\n component || tableContext?.components?.Td || defaultComponent;\n\n const [sortedColor, setSortedColor] = useState(\n getSortedColor(sortedColorValue, sortedColorAlpha)\n );\n\n useEffect(() => {\n setSortedColorValue(getVarValue(theme.table.rowSortedColor, rootId));\n setSortedColorAlpha(getVarValue(theme.table.rowSortedColorAlpha, rootId));\n\n setSortedColor(getSortedColor(sortedColorValue, sortedColorAlpha));\n }, [colors, sortedColorValue, sortedColorAlpha, rootId]);\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 type === \"body\" &&\n css({\n [`&.${staticClasses.sorted}`]: {\n backgroundColor: sortedColor,\n },\n }),\n stickyColumn &&\n css({\n [`&.${staticClasses.sorted}`]: {\n backgroundImage: `linear-gradient(to right, ${sortedColor}, ${sortedColor})`,\n },\n }),\n {\n [classes[`align${capitalize(align)}`]]: align !== \"inherit\",\n [classes.variantList]: tableContext.variant === \"listrow\",\n [classes.variantListHead]:\n tableContext.variant === \"listrow\" && type !== \"body\",\n [classes[`variant${capitalize(variant)}`]]: variant !== \"default\",\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":["defaultComponent","getSortedColor","color","alpha","checkValidHexColorValue","hexToRgbA","parseFloat","HvTableCell","forwardRef","props","externalRef","children","component","className","style","classes","classesProp","align","variant","type","typeProp","stickyColumn","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sorted","resizable","resizing","others","cx","css","useClasses","colors","rootId","useTheme","tableContext","useContext","TableContext","tableSectionContext","TableSectionContext","sortedColorValue","setSortedColorValue","useState","sortedColorAlpha","setSortedColorAlpha","Component","components","Td","sortedColor","setSortedColor","useEffect","getVarValue","theme","table","rowSortedColor","rowSortedColorAlpha","ref","role","root","staticClasses","backgroundColor","backgroundImage","capitalize","variantList","variantListHead"],"mappings":";;;;;;;;;;;AAkEA,MAAMA,mBAAmB;AAEzB,MAAMC,iBAAiBA,CAACC,OAAgBC,UAAmB;AAClDC,SAAAA,wBAAwBF,KAAK,KAAKC,QACrCE,UAAUH,OAAOI,WAAWH,KAAK,CAAC,IAClCD;AACN;AAKO,MAAMK,cAAcC,WACzB,CAACC,OAAOC,gBAA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AAWiB,GACTf,QAAQ4C,MACR5C,QAAQI,IAAI,GACZA,SAAS,UACPY,IAAI;AAAA,MACF,CAAE,KAAI6B,cAAclC,QAAQ,GAAG;AAAA,QAC7BmC,iBAAiBZ;AAAAA,MACnB;AAAA,IAAA,CACD,GACH5B,gBACEU,IAAI;AAAA,MACF,CAAE,KAAI6B,cAAclC,QAAQ,GAAG;AAAA,QAC7BoC,iBAAkB,6BAA4Bb,gBAAgBA;AAAAA,MAChE;AAAA,IAAA,CACD,GACH;AAAA,MACE,CAAClC,QAAS,QAAOgD,WAAW9C,KAAK,GAAG,CAAC,GAAGA,UAAU;AAAA,MAClD,CAACF,QAAQiD,WAAW,GAAG5B,aAAalB,YAAY;AAAA,MAChD,CAACH,QAAQkD,eAAe,GACtB7B,aAAalB,YAAY,aAAaC,SAAS;AAAA,MACjD,CAACJ,QAAS,UAASgD,WAAW7C,OAAO,GAAG,CAAC,GAAGA,YAAY;AAAA,MACxD,CAACH,QAAQW,MAAM,GAAGA;AAAAA,MAClB,CAACX,QAAQM,YAAY,GAAGA;AAAAA,MACxB,CAACN,QAAQO,oBAAoB,GAAGA;AAAAA,MAChC,CAACP,QAAQQ,sBAAsB,GAAGA;AAAAA,MAClC,CAACR,QAAQS,mBAAmB,GAAGA;AAAAA,MAC/B,CAACT,QAAQU,oBAAoB,GAAGA;AAAAA,MAChC,CAACV,QAAQY,SAAS,GAAGA;AAAAA,MACrB,CAACZ,QAAQa,QAAQ,GAAGA;AAAAA,OAEtBf,SACF;AAAA,IAAE,GACEgB;AAAAA,IAAMlB;AAAAA,EAAAA,CAGD;AAEf,CACF;"}
@@ -33,17 +33,17 @@ const HvTableHeader = forwardRef(({
33
33
  resizerProps = {},
34
34
  resizable = false,
35
35
  resizing = false,
36
+ sortButtonProps,
36
37
  ...others
37
38
  }, externalRef) => {
38
- var _a, _b;
39
+ var _a;
39
40
  const {
40
41
  classes,
41
42
  cx,
42
43
  css
43
44
  } = useClasses(classesProp);
44
45
  const {
45
- activeTheme,
46
- selectedMode
46
+ colors
47
47
  } = useTheme();
48
48
  const tableContext = useContext(TableContext);
49
49
  const tableSectionContext = useContext(TableSectionContext);
@@ -61,7 +61,7 @@ const HvTableHeader = forwardRef(({
61
61
  style,
62
62
  className: cx(classes.root, classes[type], type === "body" && css({
63
63
  [`&.${staticClasses.sorted}`]: {
64
- backgroundColor: alpha(hexToRgb(((_b = activeTheme == null ? void 0 : activeTheme.colors) == null ? void 0 : _b.modes[selectedMode].atmo1) || theme.colors.atmo1), 0.4)
64
+ backgroundColor: alpha(hexToRgb((colors == null ? void 0 : colors.atmo1) || theme.colors.atmo1), 0.4)
65
65
  }
66
66
  }), {
67
67
  [classes.groupColumnMostLeft]: groupColumnMostLeft,
@@ -87,6 +87,8 @@ const HvTableHeader = forwardRef(({
87
87
  className: classes.sortButton,
88
88
  icon: true,
89
89
  overrideIconColors: false,
90
+ "aria-label": "Sort",
91
+ ...sortButtonProps,
90
92
  children: /* @__PURE__ */ jsx(Sort, {
91
93
  className: classes.sortIcon
92
94
  })
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader.js","sources":["../../../../../src/components/Table/TableHeader/TableHeader.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n ThHTMLAttributes,\n useContext,\n useMemo,\n} from \"react\";\n\nimport capitalize from \"lodash/capitalize\";\n\nimport { hexToRgb, alpha } from \"@mui/material\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvTypography, HvTypographyProps } from \"@core/components/Typography\";\nimport { useTheme } from \"@core/hooks/useTheme\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { HvButton } from \"@core/components/Button\";\n\nimport TableContext from \"../TableContext\";\nimport TableSectionContext from \"../TableSectionContext\";\nimport { getSortIcon, isParagraph } from \"./utils\";\nimport { useClasses, staticClasses } from \"./TableHeader.styles\";\nimport {\n HvTableCellAlign,\n HvTableCellType,\n HvTableCellVariant,\n} from \"../Table\";\n\nexport { staticClasses as tableHeaderClasses };\n\nexport type HvTableHeaderClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableHeaderProps\n extends Omit<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?: HTMLAttributes<HTMLDivElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTableHeaderClasses;\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 (\n {\n children,\n component,\n className,\n style,\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 ...others\n },\n externalRef\n ) => {\n const { classes, cx, css } = useClasses(classesProp);\n\n const { activeTheme, selectedMode } = useTheme();\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 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 type === \"body\" &&\n css({\n [`&.${staticClasses.sorted}`]: {\n backgroundColor: alpha(\n hexToRgb(\n activeTheme?.colors?.modes[selectedMode].atmo1 ||\n theme.colors.atmo1\n ),\n 0.4\n ),\n },\n }),\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 [classes[`align${capitalize(align)}`]]: align !== \"inherit\",\n [classes[`variant${capitalize(variant)}`]]: variant !== \"default\",\n },\n className\n )}\n aria-sort={sortable ? sortDirection : undefined}\n {...others}\n >\n <div\n className={cx(classes.headerContent, {\n [classes[`alignFlex${capitalize(align)}`]]: align !== \"inherit\",\n })}\n >\n {isHeadCell && sortable && (\n <HvButton\n className={classes.sortButton}\n icon\n overrideIconColors={false}\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 {resizable && <div {...resizerProps} className={classes.resizer} />}\n </div>\n </Component>\n );\n }\n);\n"],"names":["defaultComponent","HvTableHeader","forwardRef","children","component","className","style","classes","classesProp","scope","scopeProp","align","variant","type","typeProp","stickyColumn","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sortDirection","sorted","sortable","headerTextProps","resizerProps","resizable","resizing","others","externalRef","cx","css","useClasses","activeTheme","selectedMode","useTheme","tableContext","useContext","TableContext","tableSectionContext","TableSectionContext","isHeadCell","Sort","useMemo","getSortIcon","Component","components","Th","role","paragraph","isParagraph","ref","root","staticClasses","backgroundColor","alpha","hexToRgb","colors","modes","atmo1","theme","variantList","capitalize","undefined","headerContent","HvButton","sortButton","icon","overrideIconColors","sortIcon","_jsx","HvTypography","headerText","headerParagraph","sortableHeaderText","resizer"],"mappings":";;;;;;;;;;;;AA2EA,MAAMA,mBAAmB;AAKZC,MAAAA,gBAAgBC,WAC3B,CACE;AAAA,EACEC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,SAASC;AAAAA,EACTC,OAAOC;AAAAA,EACPC,QAAQ;AAAA,EACRC,UAAU;AAAA,EACVC,MAAMC;AAAAA,EACNC,eAAe;AAAA,EACfC,uBAAuB;AAAA,EACvBC,yBAAyB;AAAA,EACzBC,sBAAsB;AAAA,EACtBC,uBAAuB;AAAA,EACvBC,gBAAgB;AAAA,EAChBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,eAAe,CAAC;AAAA,EAChBC,YAAY;AAAA,EACZC,WAAW;AAAA,EACX,GAAGC;AACL,G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1
+ {"version":3,"file":"TableHeader.js","sources":["../../../../../src/components/Table/TableHeader/TableHeader.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n ThHTMLAttributes,\n useContext,\n useMemo,\n} from \"react\";\n\nimport capitalize from \"lodash/capitalize\";\n\nimport { hexToRgb, alpha } from \"@mui/material\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvTypography, HvTypographyProps } from \"@core/components/Typography\";\nimport { useTheme } from \"@core/hooks/useTheme\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { HvButton, HvButtonProps } from \"@core/components/Button\";\n\nimport TableContext from \"../TableContext\";\nimport TableSectionContext from \"../TableSectionContext\";\nimport { getSortIcon, isParagraph } from \"./utils\";\nimport { useClasses, staticClasses } from \"./TableHeader.styles\";\nimport {\n HvTableCellAlign,\n HvTableCellType,\n HvTableCellVariant,\n} from \"../Table\";\n\nexport { staticClasses as tableHeaderClasses };\n\nexport type HvTableHeaderClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableHeaderProps\n extends Omit<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?: 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 (\n {\n children,\n component,\n className,\n style,\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 },\n externalRef\n ) => {\n const { classes, cx, css } = useClasses(classesProp);\n\n const { colors } = useTheme();\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 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 type === \"body\" &&\n css({\n [`&.${staticClasses.sorted}`]: {\n backgroundColor: alpha(\n hexToRgb(colors?.atmo1 || theme.colors.atmo1),\n 0.4\n ),\n },\n }),\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 [classes[`align${capitalize(align)}`]]: align !== \"inherit\",\n [classes[`variant${capitalize(variant)}`]]: variant !== \"default\",\n },\n className\n )}\n aria-sort={sortable ? sortDirection : undefined}\n {...others}\n >\n <div\n className={cx(classes.headerContent, {\n [classes[`alignFlex${capitalize(align)}`]]: align !== \"inherit\",\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 {resizable && <div {...resizerProps} className={classes.resizer} />}\n </div>\n </Component>\n );\n }\n);\n"],"names":["defaultComponent","HvTableHeader","forwardRef","children","component","className","style","classes","classesProp","scope","scopeProp","align","variant","type","typeProp","stickyColumn","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sortDirection","sorted","sortable","headerTextProps","resizerProps","resizable","resizing","sortButtonProps","others","externalRef","cx","css","useClasses","colors","useTheme","tableContext","useContext","TableContext","tableSectionContext","TableSectionContext","isHeadCell","Sort","useMemo","getSortIcon","Component","components","Th","role","paragraph","isParagraph","ref","root","staticClasses","backgroundColor","alpha","hexToRgb","atmo1","theme","variantList","capitalize","undefined","headerContent","HvButton","sortButton","icon","overrideIconColors","sortIcon","_jsx","HvTypography","headerText","headerParagraph","sortableHeaderText","resizer"],"mappings":";;;;;;;;;;;;AA6EA,MAAMA,mBAAmB;AAKZC,MAAAA,gBAAgBC,WAC3B,CACE;AAAA,EACEC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,SAASC;AAAAA,EACTC,OAAOC;AAAAA,EACPC,QAAQ;AAAA,EACRC,UAAU;AAAA,EACVC,MAAMC;AAAAA,EACNC,eAAe;AAAA,EACfC,uBAAuB;AAAA,EACvBC,yBAAyB;AAAA,EACzBC,sBAAsB;AAAA,EACtBC,uBAAuB;AAAA,EACvBC,gBAAgB;AAAA,EAChBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,eAAe,CAAC;AAAA,EAChBC,YAAY;AAAA,EACZC,WAAW;AAAA,EACXC;AAAAA,EACA,GAAGC;AACL,GACAC,gBACG;;AACG,QAAA;AAAA,IAAEtB;AAAAA,IAASuB;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,WAAWxB,WAAW;AAE7C,QAAA;AAAA,IAAEyB;AAAAA,MAAWC,SAAS;AACtBC,QAAAA,eAAeC,WAAWC,YAAY;AACtCC,QAAAA,sBAAsBF,WAAWG,mBAAmB;AAEpD1B,QAAAA,OAAOC,aAAYwB,2DAAqBzB,SAAQ;AACtD,QAAM2B,aAAa3B,SAAS;AAEtBJ,QAAAA,QAAQC,aAAa8B,aAAa,QAAQ;AAE1CC,QAAAA,OAAOC,QACX,MAAMC,YAAYtB,UAAUD,aAAa,GACzC,CAACC,QAAQD,aAAa,CACxB;AAEA,QAAMwB,YACJxC,eAAa+B,kDAAcU,eAAdV,mBAA0BW,OAAM9C;AAE/C,QAAM+C,OACJH,cAAc5C,mBACV,OACAwC,aACA,iBACA;AACAQ,QAAAA,YAAYC,YAAY9C,QAA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AAAAA,QACnBC,MAAI;AAAA,QACJC,oBAAoB;AAAA,QACpB,cAAW;AAAA,QAAM,GACbtC;AAAAA,QAAexB,8BAElBsC,MAAI;AAAA,UAACpC,WAAWE,QAAQ2D;AAAAA,QAAAA,CAAW;AAAA,MAAA,CAC5B,GAEZC,oBAACC,cAAY;AAAA,QACXhE,WAAU;AAAA,QACVC,WAAWyB,GAAG;AAAA,UACZ,CAACvB,QAAQ8D,UAAU,GAAG,CAACrB;AAAAA,UACvB,CAACzC,QAAQ+D,eAAe,GAAGtB;AAAAA,UAC3B,CAACzC,QAAQgE,kBAAkB,GAAGjD;AAAAA,QAAAA,CAC/B;AAAA,QACDV,SAAQ;AAAA,QAAO,GACXW;AAAAA,QAAepB;AAAAA,MAAAA,CAGP,GACbsB,aAAa0C,oBAAA,OAAA;AAAA,QAAA,GAAS3C;AAAAA,QAAcnB,WAAWE,QAAQiE;AAAAA,MAAAA,CAAU,CAAC;AAAA,IAAA,CAChE;AAAA,EAAA,CACI;AAEf,CACF;"}
@@ -10,7 +10,7 @@ const {
10
10
  height: "var(--cell-height)",
11
11
  verticalAlign: "inherit",
12
12
  textAlign: "left",
13
- padding: theme.spacing([0, "xs", 0, 32]),
13
+ padding: theme.spacing(0, 1, 0, 4),
14
14
  borderBottom: `1px solid ${theme.colors.atmo4}`
15
15
  },
16
16
  head: {
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader.styles.js","sources":["../../../../../src/components/Table/TableHeader/TableHeader.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableHeader\", {\n root: {\n \"--first-row-cell-height\": \"52px\",\n \"--cell-height\": \"32px\",\n height: \"var(--cell-height)\",\n verticalAlign: \"inherit\",\n textAlign: \"left\",\n padding: theme.spacing([0, \"xs\", 0, 32]),\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n },\n head: {\n paddingTop: 8,\n verticalAlign: \"top\",\n ...theme.typography.label,\n transition: \"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n backgroundColor: theme.colors.atmo1,\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n\n \"*:first-of-type > &\": {\n height: \"var(--first-row-cell-height)\",\n borderTop: `1px solid ${theme.table.headerBorderTopColor}`,\n },\n\n \"&$variantList\": {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n \"*:first-of-type > &\": {\n borderTop: 0,\n },\n },\n\n \"&$sortable\": {\n verticalAlign: \"initial\",\n paddingTop: 0,\n paddingLeft: 0,\n cursor: \"pointer\",\n\n \"&:hover\": {\n backgroundColor: theme.table.headerHoverColor,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n \"&:focus-within\": {\n backgroundColor: theme.table.headerHoverColor,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n },\n },\n body: {\n backgroundColor: \"inherit\",\n ...theme.typography.body,\n \"&$sortable:not($variantNone)\": {\n paddingLeft: 32,\n },\n },\n footer: {},\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n },\n stickyColumnMostLeft: { borderRight: `solid 1px ${theme.colors.atmo4}` },\n stickyColumnLeastRight: { borderLeft: `solid 1px ${theme.colors.atmo4}` },\n groupColumnMostLeft: { borderLeft: `solid 1px ${theme.colors.atmo4}` },\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n headerContent: { display: \"flex\", alignItems: \"flex-start\", width: \"100%\" },\n headerText: { overflow: \"hidden\", textOverflow: \"ellipsis\" },\n headerParagraph: { overflow: \"hidden\", display: \"-webkit-box\" },\n sortableHeaderText: { paddingTop: \"8px\" },\n sorted: {\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n sortable: {},\n sortButton: {\n \"$root$sortable &\": {\n boxShadow: \"none\",\n backgroundColor: \"transparent\",\n \"&:hover\": {\n backgroundColor: theme.table.sortButtonHoverColor,\n },\n },\n },\n sortIcon: { display: \"inline-flex\", visibility: \"hidden\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\", flexDirection: \"row-reverse\" },\n alignCenter: { textAlign: \"center\" },\n alignJustify: { textAlign: \"justify\" },\n alignFlexLeft: { justifyContent: \"flex-start\" },\n alignFlexRight: { justifyContent: \"flex-end\" },\n alignFlexCenter: { justifyContent: \"center\" },\n alignFlexJustify: { textAlign: \"justify\" },\n variantCheckbox: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n variantExpand: {},\n variantActions: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n variantNone: { padding: 0 },\n variantList: {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n height: 16,\n \":first-of-type > &\": {\n borderTop: 0,\n height: 16,\n },\n },\n resizable: { borderRight: `solid 1px ${theme.colors.atmo4}` },\n resizing: { borderRight: `solid 2px ${theme.colors.secondary}` },\n resizer: {\n display: \"inline-block\",\n width: 10,\n height: \"100%\",\n position: \"absolute\",\n right: 0,\n top: 0,\n transform: \"translateX(50%)\",\n zIndex: 1,\n touchAction: \"none\",\n },\n});\n"],"names":["staticClasses","useClasses","createClasses","root","height","verticalAlign","textAlign","padding","theme","spacing","borderBottom","colors","atmo4","head","paddingTop","typography","label","transition","backgroundColor","atmo1","borderTop","table","headerBorderTopColor","paddingLeft","cursor","headerHoverColor","visibility","body","footer","stickyColumn","position","zIndex","borderLeft","stickyColumnMostLeft","borderRight","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","headerContent","display","alignItems","width","headerText","overflow","textOverflow","headerParagraph","sortableHeaderText","sorted","sortable","sortButton","boxShadow","sortButtonHoverColor","sortIcon","alignLeft","alignRight","flexDirection","alignCenter","alignJustify","alignFlexLeft","justifyContent","alignFlexRight","alignFlexCenter","alignFlexJustify","variantCheckbox","maxWidth","variantExpand","variantActions","variantNone","variantList","resizable","resizing","secondary","resizer","right","top","transform","touchAction"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAeC;AAAW,IAAIC,cAAc,iBAAiB;AAAA,EAC1EC,MAAM;AAAA,IACJ,2BAA2B;AAAA,IAC3B,iBAAiB;AAAA,IACjBC,QAAQ;AAAA,IACRC,eAAe;AAAA,IACfC,WAAW;AAAA,IACXC,SAASC,MAAMC,QAAQ,CAAC,GAAG,MAAM,GAAG,EAAE,CAAC;AAAA,IACvCC,cAAe,aAAYF,MAAMG,OAAOC;AAAAA,EAC1C;AAAA,EACAC,MAAM;AAAA,IACJC,YAAY;AAAA,IACZT,eAAe;AAAA,IACf,GAAGG,MAAMO,WAAWC;AAAAA,IACpBC,YAAY;AAAA,IACZC,iBAAiBV,MAAMG,OAAOQ;AAAAA,IAC9BT,cAAe,aAAYF,MAAMG,OAAOC;AAAAA,IAExC,uBAAuB;AAAA,MACrBR,QAAQ;AAAA,MACRgB,WAAY,aAAYZ,MAAMa,MAAMC;AAAAA,IACtC;AAAA,IAEA,iBAAiB;AAAA,MACfJ,iBAAiB;AAAA,MACjBR,cAAc;AAAA,MACd,uBAAuB;AAAA,QACrBU,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IAEA,cAAc;AAAA,MACZf,eAAe;AAAA,MACfS,YAAY;AAAA,MACZS,aAAa;AAAA,MACbC,QAAQ;AAAA,MAER,WAAW;AAAA,QACTN,iBAAiBV,MAAMa,MAAMI;AAAAA,QAE7B,eAAe;AAAA,UACbC,YAAY;AAAA,QACd;AAAA,MACF;AAAA,MACA,kBAAkB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AEnC,aAAc,aAAY1B,MAAMG,OAAOC;AAAAA,EAAQ;AAAA,EAC5D0D,UAAU;AAAA,IAAEpC,aAAc,aAAY1B,MAAMG,OAAO4D;AAAAA,EAAY;AAAA,EAC/DC,SAAS;AAAA,IACPjC,SAAS;AAAA,IACTE,OAAO;AAAA,IACPrC,QAAQ;AAAA,IACR0B,UAAU;AAAA,IACV2C,OAAO;AAAA,IACPC,KAAK;AAAA,IACLC,WAAW;AAAA,IACX5C,QAAQ;AAAA,IACR6C,aAAa;AAAA,EACf;AACF,CAAC;"}
1
+ {"version":3,"file":"TableHeader.styles.js","sources":["../../../../../src/components/Table/TableHeader/TableHeader.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableHeader\", {\n root: {\n \"--first-row-cell-height\": \"52px\",\n \"--cell-height\": \"32px\",\n height: \"var(--cell-height)\",\n verticalAlign: \"inherit\",\n textAlign: \"left\",\n padding: theme.spacing(0, 1, 0, 4),\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n },\n head: {\n paddingTop: 8,\n verticalAlign: \"top\",\n ...theme.typography.label,\n transition: \"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n backgroundColor: theme.colors.atmo1,\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n\n \"*:first-of-type > &\": {\n height: \"var(--first-row-cell-height)\",\n borderTop: `1px solid ${theme.table.headerBorderTopColor}`,\n },\n\n \"&$variantList\": {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n \"*:first-of-type > &\": {\n borderTop: 0,\n },\n },\n\n \"&$sortable\": {\n verticalAlign: \"initial\",\n paddingTop: 0,\n paddingLeft: 0,\n cursor: \"pointer\",\n\n \"&:hover\": {\n backgroundColor: theme.table.headerHoverColor,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n \"&:focus-within\": {\n backgroundColor: theme.table.headerHoverColor,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n },\n },\n body: {\n backgroundColor: \"inherit\",\n ...theme.typography.body,\n \"&$sortable:not($variantNone)\": {\n paddingLeft: 32,\n },\n },\n footer: {},\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n },\n stickyColumnMostLeft: { borderRight: `solid 1px ${theme.colors.atmo4}` },\n stickyColumnLeastRight: { borderLeft: `solid 1px ${theme.colors.atmo4}` },\n groupColumnMostLeft: { borderLeft: `solid 1px ${theme.colors.atmo4}` },\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n headerContent: { display: \"flex\", alignItems: \"flex-start\", width: \"100%\" },\n headerText: { overflow: \"hidden\", textOverflow: \"ellipsis\" },\n headerParagraph: { overflow: \"hidden\", display: \"-webkit-box\" },\n sortableHeaderText: { paddingTop: \"8px\" },\n sorted: {\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n sortable: {},\n sortButton: {\n \"$root$sortable &\": {\n boxShadow: \"none\",\n backgroundColor: \"transparent\",\n \"&:hover\": {\n backgroundColor: theme.table.sortButtonHoverColor,\n },\n },\n },\n sortIcon: { display: \"inline-flex\", visibility: \"hidden\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\", flexDirection: \"row-reverse\" },\n alignCenter: { textAlign: \"center\" },\n alignJustify: { textAlign: \"justify\" },\n alignFlexLeft: { justifyContent: \"flex-start\" },\n alignFlexRight: { justifyContent: \"flex-end\" },\n alignFlexCenter: { justifyContent: \"center\" },\n alignFlexJustify: { textAlign: \"justify\" },\n variantCheckbox: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n variantExpand: {},\n variantActions: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n variantNone: { padding: 0 },\n variantList: {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n height: 16,\n \":first-of-type > &\": {\n borderTop: 0,\n height: 16,\n },\n },\n resizable: { borderRight: `solid 1px ${theme.colors.atmo4}` },\n resizing: { borderRight: `solid 2px ${theme.colors.secondary}` },\n resizer: {\n display: \"inline-block\",\n width: 10,\n height: \"100%\",\n position: \"absolute\",\n right: 0,\n top: 0,\n transform: \"translateX(50%)\",\n zIndex: 1,\n touchAction: \"none\",\n },\n});\n"],"names":["staticClasses","useClasses","createClasses","root","height","verticalAlign","textAlign","padding","theme","spacing","borderBottom","colors","atmo4","head","paddingTop","typography","label","transition","backgroundColor","atmo1","borderTop","table","headerBorderTopColor","paddingLeft","cursor","headerHoverColor","visibility","body","footer","stickyColumn","position","zIndex","borderLeft","stickyColumnMostLeft","borderRight","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","headerContent","display","alignItems","width","headerText","overflow","textOverflow","headerParagraph","sortableHeaderText","sorted","sortable","sortButton","boxShadow","sortButtonHoverColor","sortIcon","alignLeft","alignRight","flexDirection","alignCenter","alignJustify","alignFlexLeft","justifyContent","alignFlexRight","alignFlexCenter","alignFlexJustify","variantCheckbox","maxWidth","variantExpand","variantActions","variantNone","variantList","resizable","resizing","secondary","resizer","right","top","transform","touchAction"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAeC;AAAW,IAAIC,cAAc,iBAAiB;AAAA,EAC1EC,MAAM;AAAA,IACJ,2BAA2B;AAAA,IAC3B,iBAAiB;AAAA,IACjBC,QAAQ;AAAA,IACRC,eAAe;AAAA,IACfC,WAAW;AAAA,IACXC,SAASC,MAAMC,QAAQ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EAAa;AAAA,EAC9CC,gBAAgB;AAAA,IAAED,gBAAgB;AAAA,EAAW;AAAA,EAC7CE,iBAAiB;AAAA,IAAEF,gBAAgB;AAAA,EAAS;AAAA,EAC5CG,kBAAkB;AAAA,IAAExD,WAAW;AAAA,EAAU;AAAA,EACzCyD,iBAAiB;AAAA,IACfxD,SAAS;AAAA,IACTkC,OAAO;AAAA,IACPuB,UAAU;AAAA,IACV9B,aAAc,aAAY1B,MAAMG,OAAOC;AAAAA,EACzC;AAAA,EACAqD,eAAe,CAAC;AAAA,EAChBC,gBAAgB;AAAA,IACd3D,SAAS;AAAA,IACTkC,OAAO;AAAA,IACPuB,UAAU;AAAA,IACVhC,YAAa,aAAYxB,MAAMG,OAAOC;AAAAA,EACxC;AAAA,EACAuD,aAAa;AAAA,IAAE5D,SAAS;AAAA,EAAE;AAAA,EAC1B6D,aAAa;AAAA,IACXlD,iBAAiB;AAAA,IACjBR,cAAc;AAAA,IACdN,QAAQ;AAAA,IACR,sBAAsB;AAAA,MACpBgB,WAAW;AAAA,MACXhB,QAAQ;AAAA,IACV;AAAA,EACF;AAAA,EACAiE,WAAW;AAAA,IAAEnC,aAAc,aAAY1B,MAAMG,OAAOC;AAAAA,EAAQ;AAAA,EAC5D0D,UAAU;AAAA,IAAEpC,aAAc,aAAY1B,MAAMG,OAAO4D;AAAAA,EAAY;AAAA,EAC/DC,SAAS;AAAA,IACPjC,SAAS;AAAA,IACTE,OAAO;AAAA,IACPrC,QAAQ;AAAA,IACR0B,UAAU;AAAA,IACV2C,OAAO;AAAA,IACPC,KAAK;AAAA,IACLC,WAAW;AAAA,IACX5C,QAAQ;AAAA,IACR6C,aAAa;AAAA,EACf;AACF,CAAC;"}
@@ -14,7 +14,7 @@ const getStripedColor = (color, opacity = 0.6) => {
14
14
  return checkValidHexColorValue(color) ? hexToRgbA(color, opacity) : color;
15
15
  };
16
16
  const HvTableRow = forwardRef((props, externalRef) => {
17
- var _a, _b;
17
+ var _a;
18
18
  const {
19
19
  classes: classesProp,
20
20
  className,
@@ -31,8 +31,7 @@ const HvTableRow = forwardRef((props, externalRef) => {
31
31
  css
32
32
  } = useClasses(classesProp);
33
33
  const {
34
- activeTheme,
35
- selectedMode,
34
+ colors,
36
35
  rootId
37
36
  } = useTheme();
38
37
  const tableContext = useContext(TableContext);
@@ -49,7 +48,7 @@ const HvTableRow = forwardRef((props, externalRef) => {
49
48
  setOdd(getVarValue(theme.table.rowStripedBackgroundColorOdd, rootId));
50
49
  setStripedColorEven(getStripedColor(even));
51
50
  setStripedColorOdd(getStripedColor(odd));
52
- }, [(_b = activeTheme == null ? void 0 : activeTheme.colors) == null ? void 0 : _b.modes[selectedMode], even, odd, rootId]);
51
+ }, [colors, even, odd, rootId]);
53
52
  return /* @__PURE__ */ jsx(Component, {
54
53
  ref: externalRef,
55
54
  className: cx(tableSectionContext.filterClassName, classes.root, classes[type], striped && css({
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.js","sources":["../../../../../src/components/Table/TableRow/TableRow.tsx"],"sourcesContent":["import { forwardRef, useContext, useEffect, useState } from \"react\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { checkValidHexColorValue } from \"@core/utils/checkValidHexColorValue\";\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\nimport { getVarValue } from \"@core/utils/theme\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useTheme } from \"@core/hooks/useTheme\";\n\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\nconst getStripedColor = (color?: string, opacity: number = 0.6) => {\n return checkValidHexColorValue(color) ? hexToRgbA(color, opacity) : color;\n};\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 } = props;\n const { classes, cx, css } = useClasses(classesProp);\n const { activeTheme, selectedMode, rootId } = useTheme();\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const [even, setEven] = useState<string | undefined>();\n const [odd, setOdd] = useState<string | undefined>();\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 const [stripedColorEven, setStripedColorEven] = useState(\n getStripedColor(even)\n );\n const [stripedColorOdd, setStripedColorOdd] = useState(\n getStripedColor(odd)\n );\n\n useEffect(() => {\n setEven(getVarValue(theme.table.rowStripedBackgroundColorEven, rootId));\n setOdd(getVarValue(theme.table.rowStripedBackgroundColorOdd, rootId));\n\n setStripedColorEven(getStripedColor(even));\n setStripedColorOdd(getStripedColor(odd));\n }, [activeTheme?.colors?.modes[selectedMode], even, odd, rootId]);\n\n return (\n <Component\n ref={externalRef}\n className={cx(\n tableSectionContext.filterClassName,\n classes.root,\n classes[type],\n striped &&\n css({\n \"&:nth-of-type(even)\": {\n backgroundColor: stripedColorEven,\n \"&:hover\": {\n backgroundColor: theme.table.rowHoverColor,\n },\n },\n \"&:nth-of-type(odd)\": {\n backgroundColor: stripedColorOdd,\n \"&:hover\": {\n backgroundColor: theme.table.rowHoverColor,\n },\n },\n }),\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":["defaultComponent","getStripedColor","color","opacity","checkValidHexColorValue","hexToRgbA","HvTableRow","forwardRef","props","externalRef","classes","classesProp","className","component","hover","selected","expanded","striped","others","cx","css","useClasses","activeTheme","selectedMode","rootId","useTheme","tableContext","useContext","TableContext","tableSectionContext","TableSectionContext","even","setEven","useState","odd","setOdd","type","isList","variant","Component","components","Tr","stripedColorEven","setStripedColorEven","stripedColorOdd","setStripedColorOdd","useEffect","getVarValue","theme","table","rowStripedBackgroundColorEven","rowStripedBackgroundColorOdd","colors","modes","ref","filterClassName","root","backgroundColor","rowHoverColor","variantList","variantListHead","role"],"mappings":";;;;;;;;;;;AAqCA,MAAMA,mBAAmB;AAEzB,MAAMC,kBAAkBA,CAACC,OAAgBC,UAAkB,QAAQ;AACjE,SAAOC,wBAAwBF,KAAK,IAAIG,UAAUH,OAAOC,OAAO,IAAID;AACtE;AAKO,MAAMI,aAAaC,WACxB,CAACC,OAAOC,gBAAgB;;AAChB,QAAA;AAAA,IACJC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC,QAAQ;AAAA,IACRC,WAAW;AAAA,IACXC,WAAW;AAAA,IACXC,UAAU;AAAA,IACV,GAAGC;AAAAA,EACDV,IAAAA;AACE,QAAA;AAAA,IAAEE;AAAAA,IAASS;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,WAAWV,WAAW;AAC7C,QAAA;AAAA,IAAEW;AAAAA,IAAaC;AAAAA,IAAcC;AAAAA,MAAWC,SAAS;AACjDC,QAAAA,eAAeC,WAAWC,YAAY;AACtCC,QAAAA,sBAAsBF,WAAWG,mBAAmB;AAE1D,QAAM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N,QAAQO,OAAO,GAAGA;AAAAA,MACnB,CAACP,QAAQiD,WAAW,GAAGtB,UAAUD,SAAS;AAAA,MAC1C,CAAC1B,QAAQkD,eAAe,GAAGvB,UAAUD,SAAS;AAAA,OAEhDxB,SACF;AAAA,IACAiD,MAAMtB,cAAcvC,mBAAmB,OAAO;AAAA,IAAM,GAChDkB;AAAAA,EAAAA,CACL;AAEL,CACF;"}
1
+ {"version":3,"file":"TableRow.js","sources":["../../../../../src/components/Table/TableRow/TableRow.tsx"],"sourcesContent":["import { forwardRef, useContext, useEffect, useState } from \"react\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { checkValidHexColorValue } from \"@core/utils/checkValidHexColorValue\";\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\nimport { getVarValue } from \"@core/utils/theme\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useTheme } from \"@core/hooks/useTheme\";\n\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\nconst getStripedColor = (color?: string, opacity: number = 0.6) => {\n return checkValidHexColorValue(color) ? hexToRgbA(color, opacity) : color;\n};\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 } = props;\n const { classes, cx, css } = useClasses(classesProp);\n const { colors, rootId } = useTheme();\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const [even, setEven] = useState<string | undefined>();\n const [odd, setOdd] = useState<string | undefined>();\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 const [stripedColorEven, setStripedColorEven] = useState(\n getStripedColor(even)\n );\n const [stripedColorOdd, setStripedColorOdd] = useState(\n getStripedColor(odd)\n );\n\n useEffect(() => {\n setEven(getVarValue(theme.table.rowStripedBackgroundColorEven, rootId));\n setOdd(getVarValue(theme.table.rowStripedBackgroundColorOdd, rootId));\n\n setStripedColorEven(getStripedColor(even));\n setStripedColorOdd(getStripedColor(odd));\n }, [colors, even, odd, rootId]);\n\n return (\n <Component\n ref={externalRef}\n className={cx(\n tableSectionContext.filterClassName,\n classes.root,\n classes[type],\n striped &&\n css({\n \"&:nth-of-type(even)\": {\n backgroundColor: stripedColorEven,\n \"&:hover\": {\n backgroundColor: theme.table.rowHoverColor,\n },\n },\n \"&:nth-of-type(odd)\": {\n backgroundColor: stripedColorOdd,\n \"&:hover\": {\n backgroundColor: theme.table.rowHoverColor,\n },\n },\n }),\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":["defaultComponent","getStripedColor","color","opacity","checkValidHexColorValue","hexToRgbA","HvTableRow","forwardRef","props","externalRef","classes","classesProp","className","component","hover","selected","expanded","striped","others","cx","css","useClasses","colors","rootId","useTheme","tableContext","useContext","TableContext","tableSectionContext","TableSectionContext","even","setEven","useState","odd","setOdd","type","isList","variant","Component","components","Tr","stripedColorEven","setStripedColorEven","stripedColorOdd","setStripedColorOdd","useEffect","getVarValue","theme","table","rowStripedBackgroundColorEven","rowStripedBackgroundColorOdd","ref","filterClassName","root","backgroundColor","rowHoverColor","variantList","variantListHead","role"],"mappings":";;;;;;;;;;;AAqCA,MAAMA,mBAAmB;AAEzB,MAAMC,kBAAkBA,CAACC,OAAgBC,UAAkB,QAAQ;AACjE,SAAOC,wBAAwBF,KAAK,IAAIG,UAAUH,OAAOC,OAAO,IAAID;AACtE;AAKO,MAAMI,aAAaC,WACxB,CAACC,OAAOC,gBAAgB;;AAChB,QAAA;AAAA,IACJC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC,QAAQ;AAAA,IACRC,WAAW;AAAA,IACXC,WAAW;AAAA,IACXC,UAAU;AAAA,IACV,GAAGC;AAAAA,EACDV,IAAAA;AACE,QAAA;AAAA,IAAEE;AAAAA,IAASS;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,WAAWV,WAAW;AAC7C,QAAA;AAAA,IAAEW;AAAAA,IAAQC;AAAAA,MAAWC,SAAS;AAC9BC,QAAAA,eAAeC,WAAWC,YAAY;AACtCC,QAAAA,sBAAsBF,WAAWG,mBAAmB;AAE1D,QAAM,CAACC,MAAMC,OAAO,IAAIC,SAA6B;AACrD,QAAM,CAACC,KAAKC,MAAM,IAAIF,SAA6B;AAE7CG,QAAAA,QAAOP,2DAAqBO,SAAQ;AAEpCC,QAAAA,SAASX,aAAaY,YAAY;AAExC,QAAMC,YACJzB,eAAaY,kDAAcc,eAAdd,mBAA0Be,OAAMxC;AAE/C,QAAM,CAACyC,kBAAkBC,mBAAmB,IAAIV,SAC9C/B,gBAAgB6B,IAAI,CACtB;AACA,QAAM,CAACa,iBAAiBC,kBAAkB,IAAIZ,SAC5C/B,gBAAgBgC,GAAG,CACrB;AAEAY,YAAU,MAAM;AACdd,YAAQe,YAAYC,MAAMC,MAAMC,+BAA+B1B,MAAM,CAAC;AACtEW,WAAOY,YAAYC,MAAMC,MAAME,8BAA8B3B,MAAM,CAAC;AAEhDtB,wBAAAA,gBAAgB6B,IAAI,CAAC;AACtB7B,uBAAAA,gBAAgBgC,GAAG,CAAC;AAAA,KACtC,CAACX,QAAQQ,MAAMG,KAAKV,MAAM,CAAC;AAE9B,6BACGe,WAAS;AAAA,IACRa,KAAK1C;AAAAA,IACLG,WAAWO,GACTS,oBAAoBwB,iBACpB1C,QAAQ2C,MACR3C,QAAQyB,IAAI,GACZlB,WACEG,IAAI;AAAA,MACF,uBAAuB;AAAA,QACrBkC,iBAAiBb;AAAAA,QACjB,WAAW;AAAA,UACTa,iBAAiBP,MAAMC,MAAMO;AAAAA,QAC/B;AAAA,MACF;AAAA,MACA,sBAAsB;AAAA,QACpBD,iBAAiBX;AAAAA,QACjB,WAAW;AAAA,UACTW,iBAAiBP,MAAMC,MAAMO;AAAAA,QAC/B;AAAA,MACF;AAAA,IAAA,CACD,GACH;AAAA,MACE,CAAC7C,QAAQI,KAAK,GAAGA;AAAAA,MACjB,CAACJ,QAAQK,QAAQ,GAAGA;AAAAA,MACpB,CAACL,QAAQM,QAAQ,GAAGA;AAAAA,MACpB,CAACN,QAAQO,OAAO,GAAGA;AAAAA,MACnB,CAACP,QAAQ8C,WAAW,GAAGpB,UAAUD,SAAS;AAAA,MAC1C,CAACzB,QAAQ+C,eAAe,GAAGrB,UAAUD,SAAS;AAAA,OAEhDvB,SACF;AAAA,IACA8C,MAAMpB,cAActC,mBAAmB,OAAO;AAAA,IAAM,GAChDkB;AAAAA,EAAAA,CACL;AAEL,CACF;"}
@@ -7,7 +7,8 @@ const normalizeProgressBar = (value, max) => {
7
7
  const HvProgressColumnCell = ({
8
8
  partial,
9
9
  total,
10
- color = "primary"
10
+ color = "primary",
11
+ "aria-labelledby": ariaLabelledBy
11
12
  }) => {
12
13
  const {
13
14
  classes
@@ -27,7 +28,8 @@ const HvProgressColumnCell = ({
27
28
  },
28
29
  color,
29
30
  variant: "determinate",
30
- value: percentage
31
+ value: percentage,
32
+ "aria-labelledby": ariaLabelledBy
31
33
  })
32
34
  })
33
35
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressColumnCell.js","sources":["../../../../../../src/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.tsx"],"sourcesContent":["import MuiLinearProgress from \"@mui/material/LinearProgress\";\n\nimport { useClasses } from \"./ProgressColumnCell.styles\";\n\nexport interface HvProgressColumnCellProp {\n /** Current value of the bar. */\n partial: number;\n /** Maximum value of the bar. */\n total: number;\n /** The color of the bar. */\n color?: \"primary\" | \"secondary\";\n}\n\nexport const normalizeProgressBar = (value: number, max: number) => {\n return max > 0 ? Math.floor((value * 100) / max) : 0;\n};\n\nexport const HvProgressColumnCell = ({\n partial,\n total,\n color = \"primary\",\n}: HvProgressColumnCellProp): JSX.Element => {\n const { classes } = useClasses();\n\n const percentage = normalizeProgressBar(partial, total);\n\n return (\n <div className={classes.root}>\n <div className={classes.linearProgressContainer}>\n <MuiLinearProgress\n className={classes.linearProgress}\n classes={{\n root: classes.linearProgressRoot,\n colorPrimary: classes.linearProgressColorPrimary,\n barColorPrimary: classes.linearProgressBarColorPrimary,\n barColorSecondary: classes.linearProgressBarColorSecondary,\n }}\n color={color}\n variant=\"determinate\"\n value={percentage}\n />\n </div>\n </div>\n );\n};\n"],"names":["normalizeProgressBar","value","max","Math","floor","HvProgressColumnCell","partial","total","color","classes","useClasses","percentage","className","root","children","linearProgressContainer","MuiLinearProgress","linearProgress","linearProgressRoot","colorPrimary","linearProgressColorPrimary","barColorPrimary","linearProgressBarColorPrimary","barColorSecondary","linearProgressBarColorSecondary","variant"],"mappings":";;;AAaaA,MAAAA,uBAAuBA,CAACC,OAAeC,QAAgB;AAClE,SAAOA,MAAM,IAAIC,KAAKC,MAAOH,QAAQ,MAAOC,GAAG,IAAI;AACrD;AAEO,MAAMG,uBAAuBA,CAAC;AAAA,EACnCC;AAAAA,EACAC;AAAAA,EACAC,QAAQ;AACgB,MAAmB;AACrC,QAAA;AAAA,IAAEC;AAAAA,MAAYC,WAAW;AAEzBC,QAAAA,aAAaX,qBAAqBM,SAASC,KAAK;AAEtD,6BACE,OAAA;AAAA,IAAKK,WAAWH,QAAQI;AAAAA,IAAKC,8BAC3B,OAAA;AAAA,MAAKF,WAAWH,QAAQM;AAAAA,MAAwBD,8BAC7CE,mBAAiB;AAAA,QAChBJ,WAAWH,QAAQQ;AAAAA,QACnBR,SAAS;AAAA,UACPI,MAAMJ,QAAQS;AAAAA,UACdC,cAAcV,QAAQW;AAAAA,UACtBC,iBAAiBZ,QAAQa;AAAAA,UACzBC,mBAAmBd,QAAQe;AAAAA,QAC7B;AAAA,QACAhB;AAAAA,QACAiB,SAAQ;AAAA,QACRxB,OAAOU;AAAAA,MAAAA,CACR;AAAA,IAAA,CACE;AAAA,EAAA,CACF;AAET;"}
1
+ {"version":3,"file":"ProgressColumnCell.js","sources":["../../../../../../src/components/Table/renderers/ProgressColumnCell/ProgressColumnCell.tsx"],"sourcesContent":["import MuiLinearProgress from \"@mui/material/LinearProgress\";\n\nimport { useClasses } from \"./ProgressColumnCell.styles\";\n\nexport interface HvProgressColumnCellProp {\n /** Current value of the bar. */\n partial: number;\n /** Maximum value of the bar. */\n total: number;\n /** The color of the bar. */\n color?: \"primary\" | \"secondary\";\n \"aria-labelledby\"?: string;\n}\n\nexport const normalizeProgressBar = (value: number, max: number) => {\n return max > 0 ? Math.floor((value * 100) / max) : 0;\n};\n\nexport const HvProgressColumnCell = ({\n partial,\n total,\n color = \"primary\",\n \"aria-labelledby\": ariaLabelledBy,\n}: HvProgressColumnCellProp): JSX.Element => {\n const { classes } = useClasses();\n\n const percentage = normalizeProgressBar(partial, total);\n\n return (\n <div className={classes.root}>\n <div className={classes.linearProgressContainer}>\n <MuiLinearProgress\n className={classes.linearProgress}\n classes={{\n root: classes.linearProgressRoot,\n colorPrimary: classes.linearProgressColorPrimary,\n barColorPrimary: classes.linearProgressBarColorPrimary,\n barColorSecondary: classes.linearProgressBarColorSecondary,\n }}\n color={color}\n variant=\"determinate\"\n value={percentage}\n aria-labelledby={ariaLabelledBy}\n />\n </div>\n </div>\n );\n};\n"],"names":["normalizeProgressBar","value","max","Math","floor","HvProgressColumnCell","partial","total","color","ariaLabelledBy","classes","useClasses","percentage","className","root","children","linearProgressContainer","MuiLinearProgress","linearProgress","linearProgressRoot","colorPrimary","linearProgressColorPrimary","barColorPrimary","linearProgressBarColorPrimary","barColorSecondary","linearProgressBarColorSecondary","variant"],"mappings":";;;AAcaA,MAAAA,uBAAuBA,CAACC,OAAeC,QAAgB;AAClE,SAAOA,MAAM,IAAIC,KAAKC,MAAOH,QAAQ,MAAOC,GAAG,IAAI;AACrD;AAEO,MAAMG,uBAAuBA,CAAC;AAAA,EACnCC;AAAAA,EACAC;AAAAA,EACAC,QAAQ;AAAA,EACR,mBAAmBC;AACK,MAAmB;AACrC,QAAA;AAAA,IAAEC;AAAAA,MAAYC,WAAW;AAEzBC,QAAAA,aAAaZ,qBAAqBM,SAASC,KAAK;AAEtD,6BACE,OAAA;AAAA,IAAKM,WAAWH,QAAQI;AAAAA,IAAKC,8BAC3B,OAAA;AAAA,MAAKF,WAAWH,QAAQM;AAAAA,MAAwBD,8BAC7CE,mBAAiB;AAAA,QAChBJ,WAAWH,QAAQQ;AAAAA,QACnBR,SAAS;AAAA,UACPI,MAAMJ,QAAQS;AAAAA,UACdC,cAAcV,QAAQW;AAAAA,UACtBC,iBAAiBZ,QAAQa;AAAAA,UACzBC,mBAAmBd,QAAQe;AAAAA,QAC7B;AAAA,QACAjB;AAAAA,QACAkB,SAAQ;AAAA,QACRzB,OAAOW;AAAAA,QACP,mBAAiBH;AAAAA,MAAAA,CAClB;AAAA,IAAA,CACE;AAAA,EAAA,CACF;AAET;"}
@@ -20,10 +20,13 @@ const HvSwitchColumnCell = ({
20
20
  className: classes.switchNo,
21
21
  children: falseLabel
22
22
  }), /* @__PURE__ */ jsx(HvBaseSwitch, {
23
- "aria-label": switchLabel,
24
23
  checked,
25
24
  value,
26
- ...switchProps
25
+ ...switchProps,
26
+ inputProps: {
27
+ "aria-label": switchLabel,
28
+ ...switchProps == null ? void 0 : switchProps.inputProps
29
+ }
27
30
  }), trueLabel != null && /* @__PURE__ */ jsx(HvTypography, {
28
31
  "aria-hidden": "true",
29
32
  variant: "body",
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchColumnCell.js","sources":["../../../../../../src/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.tsx"],"sourcesContent":["import { HvBaseSwitch, HvBaseSwitchProps } from \"@core/components/BaseSwitch\";\nimport { HvTypography } from \"@core/components/Typography\";\n\nimport { useClasses } from \"./SwitchColumnCell.styles\";\n\nexport interface HvSwitchColumnCellProp {\n /** Whether the switch is checked or not. */\n checked: boolean;\n /** The switch label. */\n value: number | string | undefined;\n /** The value of the switch. */\n switchLabel: string;\n /** The right switch label. */\n falseLabel?: string;\n /** The left switch label. */\n trueLabel?: string;\n /** Extra props to be passed to the switch. */\n switchProps?: HvBaseSwitchProps;\n}\n\nexport const HvSwitchColumnCell = ({\n checked,\n value,\n switchLabel,\n falseLabel,\n trueLabel,\n switchProps,\n}: HvSwitchColumnCellProp): JSX.Element => {\n const { classes } = useClasses();\n\n return (\n <>\n {falseLabel != null && (\n <HvTypography\n aria-hidden=\"true\"\n variant=\"body\"\n className={classes.switchNo}\n >\n {falseLabel}\n </HvTypography>\n )}\n <HvBaseSwitch\n aria-label={switchLabel}\n checked={checked}\n value={value}\n {...switchProps}\n />\n {trueLabel != null && (\n <HvTypography\n aria-hidden=\"true\"\n variant=\"body\"\n className={classes.switchYes}\n >\n {trueLabel}\n </HvTypography>\n )}\n </>\n );\n};\n"],"names":["HvSwitchColumnCell","checked","value","switchLabel","falseLabel","trueLabel","switchProps","classes","useClasses","_Fragment","children","HvTypography","variant","className","switchNo","_jsx","HvBaseSwitch","switchYes"],"mappings":";;;;AAoBO,MAAMA,qBAAqBA,CAAC;AAAA,EACjCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AACsB,MAAmB;AACnC,QAAA;AAAA,IAAEC;AAAAA,MAAYC,WAAW;AAE/B,8BACEC,UAAA;AAAA,IAAAC,WACGN,cAAc,4BACZO,cAAY;AAAA,MACX,eAAY;AAAA,MACZC,SAAQ;AAAA,MACRC,WAAWN,QAAQO;AAAAA,MAASJ,UAE3BN;AAAAA,IAAAA,CACW,GAEhBW,oBAACC,cAAY;AAAA,MACX,cAAYb;AAAAA,MACZF;AAAAA,MACAC;AAAAA,MAAa,GACTI;AAAAA,IACL,CAAA,GACAD,aAAa,4BACXM,cAAY;AAAA,MACX,eAAY;AAAA,MACZC,SAAQ;AAAA,MACRC,WAAWN,QAAQU;AAAAA,MAAUP,UAE5BL;AAAAA,IAAAA,CACW,CACf;AAAA,EAAA,CACD;AAEN;"}
1
+ {"version":3,"file":"SwitchColumnCell.js","sources":["../../../../../../src/components/Table/renderers/SwitchColumnCell/SwitchColumnCell.tsx"],"sourcesContent":["import { HvBaseSwitch, HvBaseSwitchProps } from \"@core/components/BaseSwitch\";\nimport { HvTypography } from \"@core/components/Typography\";\n\nimport { useClasses } from \"./SwitchColumnCell.styles\";\n\nexport interface HvSwitchColumnCellProp {\n /** Whether the switch is checked or not. */\n checked: boolean;\n /** The switch label. */\n value: number | string | undefined;\n /** The value of the switch. */\n switchLabel: string;\n /** The right switch label. */\n falseLabel?: string;\n /** The left switch label. */\n trueLabel?: string;\n /** Extra props to be passed to the switch. */\n switchProps?: HvBaseSwitchProps;\n}\n\nexport const HvSwitchColumnCell = ({\n checked,\n value,\n switchLabel,\n falseLabel,\n trueLabel,\n switchProps,\n}: HvSwitchColumnCellProp): JSX.Element => {\n const { classes } = useClasses();\n\n return (\n <>\n {falseLabel != null && (\n <HvTypography\n aria-hidden=\"true\"\n variant=\"body\"\n className={classes.switchNo}\n >\n {falseLabel}\n </HvTypography>\n )}\n <HvBaseSwitch\n checked={checked}\n value={value}\n {...switchProps}\n inputProps={{ \"aria-label\": switchLabel, ...switchProps?.inputProps }}\n />\n {trueLabel != null && (\n <HvTypography\n aria-hidden=\"true\"\n variant=\"body\"\n className={classes.switchYes}\n >\n {trueLabel}\n </HvTypography>\n )}\n </>\n );\n};\n"],"names":["HvSwitchColumnCell","checked","value","switchLabel","falseLabel","trueLabel","switchProps","classes","useClasses","_Fragment","children","HvTypography","variant","className","switchNo","_jsx","HvBaseSwitch","inputProps","switchYes"],"mappings":";;;;AAoBO,MAAMA,qBAAqBA,CAAC;AAAA,EACjCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AACsB,MAAmB;AACnC,QAAA;AAAA,IAAEC;AAAAA,MAAYC,WAAW;AAE/B,8BACEC,UAAA;AAAA,IAAAC,WACGN,cAAc,4BACZO,cAAY;AAAA,MACX,eAAY;AAAA,MACZC,SAAQ;AAAA,MACRC,WAAWN,QAAQO;AAAAA,MAASJ,UAE3BN;AAAAA,IAAAA,CACW,GAEhBW,oBAACC,cAAY;AAAA,MACXf;AAAAA,MACAC;AAAAA,MAAa,GACTI;AAAAA,MACJW,YAAY;AAAA,QAAE,cAAcd;AAAAA,QAAa,GAAGG,2CAAaW;AAAAA,MAAW;AAAA,IACrE,CAAA,GACAZ,aAAa,4BACXM,cAAY;AAAA,MACX,eAAY;AAAA,MACZC,SAAQ;AAAA,MACRC,WAAWN,QAAQW;AAAAA,MAAUR,UAE5BL;AAAAA,IAAAA,CACW,CACf;AAAA,EAAA,CACD;AAEN;"}
@@ -165,7 +165,8 @@ function hvDropdownColumn(col, id, placeholder, disabledPlaceholder, onChange) {
165
165
  onChange: (val) => onChange == null ? void 0 : onChange(row.id, val),
166
166
  disabled: dsbld,
167
167
  dropdownProps: {
168
- "aria-labelledby": setId(id, column.id)
168
+ "aria-labelledby": setId(id, column.id) || column.id || id
169
+ // TODO - to be reviewed because it doesn't make much sense
169
170
  }
170
171
  });
171
172
  },
@@ -180,7 +181,8 @@ function hvProgressColumn(col, getPartial, getTotal, color) {
180
181
  return {
181
182
  Cell: (cellProps) => {
182
183
  const {
183
- row
184
+ row,
185
+ column
184
186
  } = cellProps;
185
187
  const partial = (getPartial == null ? void 0 : getPartial(row)) || 0;
186
188
  const total = getTotal == null ? void 0 : getTotal(row);
@@ -188,7 +190,8 @@ function hvProgressColumn(col, getPartial, getTotal, color) {
188
190
  return /* @__PURE__ */ jsx(HvProgressColumnCell, {
189
191
  partial,
190
192
  total,
191
- color
193
+ color,
194
+ "aria-labelledby": column.id
192
195
  });
193
196
  }
194
197
  return /* @__PURE__ */ jsx(Fragment, {
@@ -1 +1 @@
1
- {"version":3,"file":"renderers.js","sources":["../../../../../src/components/Table/renderers/renderers.tsx"],"sourcesContent":["import { ClassNames } from \"@emotion/react\";\n\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport { setId } from \"@core/utils/setId\";\nimport { HvTag, HvTagProps } from \"@core/components/Tag\";\nimport { HvButton } from \"@core/components/Button\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport {\n HvOverflowTooltip,\n HvOverflowTooltipProps,\n} from \"@core/components/OverflowTooltip\";\nimport { HvBaseSwitchProps } from \"@core/components/BaseSwitch\";\nimport { HvListValue } from \"@core/components/List\";\n\nimport {\n HvTableHeaderRenderer,\n HvCellProps,\n HvTableColumnConfig,\n HvRowInstance,\n} from \"../hooks/useTable\";\nimport { HvDateColumnCell } from \"./DateColumnCell\";\nimport { HvSwitchColumnCell } from \"./SwitchColumnCell\";\nimport { HvProgressColumnCell } from \"./ProgressColumnCell\";\nimport { HvDropdownColumnCell } from \"./DropdownColumnCell\";\nimport { hvStringFallback, hvNumberFallback } from \"../utils\";\n\nexport function hvTextColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n overflowTooltipProps: Omit<HvOverflowTooltipProps, \"data\"> = {}\n): HvTableColumnConfig<D, H> {\n return {\n Cell: ({ value }: HvCellProps<D, H>) => (\n <HvOverflowTooltip\n data={hvStringFallback(value)}\n {...overflowTooltipProps}\n />\n ),\n sortType: \"alphanumeric\",\n ...col,\n };\n}\n\nexport function hvNumberColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(col: HvTableColumnConfig<D, H>): HvTableColumnConfig<D, H> {\n return {\n Cell: ({ value }: HvCellProps<D, H>) => <>{hvNumberFallback(value)}</>,\n align: \"right\",\n sortType: \"number\",\n ...col,\n };\n}\n\nexport function hvDateColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n dateFormat?: string\n): HvTableColumnConfig<D, H> {\n return {\n Cell: ({ value }: HvCellProps<D, H>) => (\n <HvDateColumnCell date={value} dateFormat={dateFormat} />\n ),\n sortType: \"alphanumeric\",\n sortDescFirst: true,\n ...col,\n };\n}\n\nexport function hvExpandColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n expandRowButtonAriaLabel: string,\n collapseRowButtonAriaLabel: string,\n getCanRowExpand?: (row: HvRowInstance<D, H>) => boolean,\n ExpandedIcon: React.ReactNode = <DropUpXS />,\n CollapsedIcon: React.ReactNode = <DropDownXS />\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { value, row } = cellProps;\n const expandedProps = row.getToggleRowExpandedProps?.();\n\n const hasContent = getCanRowExpand?.(row) ?? true;\n\n return (\n <ClassNames>\n {({ css }) => (\n <>\n {hasContent && (\n <HvButton\n icon\n aria-label={\n row.isExpanded\n ? collapseRowButtonAriaLabel\n : expandRowButtonAriaLabel\n }\n aria-expanded={row.isExpanded}\n onClick={expandedProps?.onClick}\n classes={{\n root: css({\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n }),\n }}\n >\n {row.isExpanded ? ExpandedIcon : CollapsedIcon}\n </HvButton>\n )}\n\n <HvOverflowTooltip data={hvStringFallback(value)} />\n </>\n )}\n </ClassNames>\n );\n },\n sortType: \"alphanumeric\",\n cellStyle: {\n position: \"relative\",\n },\n ...col,\n };\n}\n\nexport function hvTagColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer,\n A extends object = Record<string, unknown>\n>(\n col: HvTableColumnConfig<D, H>,\n valueDataKey: keyof A,\n colorDataKey: keyof A,\n textColorDataKey: keyof A,\n fromRowData: boolean = false,\n tagProps?: HvTagProps\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { value, row } = cellProps;\n if (!value) {\n return <>—</>;\n }\n\n const {\n [valueDataKey]: name,\n [colorDataKey]: color,\n [textColorDataKey]: textColor,\n } = fromRowData ? row.original : value;\n\n return (\n <HvTag\n label={<HvTypography variant=\"body\">{name}</HvTypography>}\n type=\"semantic\"\n color={color}\n style={textColor != null ? { color: textColor } : {}}\n tabIndex={-1}\n {...tagProps}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvSwitchColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n switchLabel: string,\n falseLabel?: string,\n trueLabel?: string,\n switchProps?: HvBaseSwitchProps\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { value, row } = cellProps;\n return (\n <HvSwitchColumnCell\n checked={value}\n value={row.id}\n switchLabel={switchLabel}\n falseLabel={falseLabel}\n trueLabel={trueLabel}\n switchProps={switchProps}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvDropdownColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n id: string,\n placeholder: string,\n disabledPlaceholder: string,\n onChange?: (identifier: string, value: HvListValue) => void\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { value, row, column } = cellProps;\n const dsbld = value.length < 1;\n return (\n <HvDropdownColumnCell\n values={value}\n placeholder={dsbld ? disabledPlaceholder : placeholder}\n onChange={(val) => onChange?.(row.id, val)}\n disabled={dsbld}\n dropdownProps={{\n \"aria-labelledby\": setId(id, column.id),\n }}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvProgressColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n getPartial?: (row: HvRowInstance<D, H>) => number,\n getTotal?: (row: HvRowInstance<D, H>) => number,\n color?: \"primary\" | \"secondary\"\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { row } = cellProps;\n const partial = getPartial?.(row) || 0;\n const total = getTotal?.(row);\n\n if (total) {\n return (\n <HvProgressColumnCell partial={partial} total={total} color={color} />\n );\n }\n\n return <>—</>;\n },\n\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n"],"names":["hvTextColumn","col","overflowTooltipProps","Cell","value","HvOverflowTooltip","data","hvStringFallback","sortType","hvNumberColumn","_Fragment","children","hvNumberFallback","align","hvDateColumn","dateFormat","HvDateColumnCell","date","sortDescFirst","hvExpandColumn","expandRowButtonAriaLabel","collapseRowButtonAriaLabel","getCanRowExpand","ExpandedIcon","DropUpXS","CollapsedIcon","_jsx","DropDownXS","cellProps","row","expandedProps","getToggleRowExpandedProps","hasContent","ClassNames","css","HvButton","icon","isExpanded","onClick","classes","root","position","left","top","transform","cellStyle","hvTagColumn","valueDataKey","colorDataKey","textColorDataKey","fromRowData","tagProps","name","color","textColor","original","HvTag","label","HvTypography","variant","type","style","tabIndex","paddingTop","paddingBottom","hvSwitchColumn","switchLabel","falseLabel","trueLabel","switchProps","HvSwitchColumnCell","checked","id","hvDropdownColumn","placeholder","disabledPlaceholder","onChange","column","dsbld","length","HvDropdownColumnCell","values","val","disabled","dropdownProps","setId","hvProgressColumn","getPartial","getTotal","partial","total","HvProgressColumnCell"],"mappings":";;;;;;;;;;;;;AA2BO,SAASA,aAIdC,KACAC,uBAA6D,IAClC;AACpB,SAAA;AAAA,IACLC,MAAMA,CAAC;AAAA,MAAEC;AAAAA,IAAAA,0BACNC,mBAAiB;AAAA,MAChBC,MAAMC,iBAAiBH,KAAK;AAAA,MAAE,GAC1BF;AAAAA,IAAAA,CACL;AAAA,IAEHM,UAAU;AAAA,IACV,GAAGP;AAAAA,EAAAA;AAEP;AAEO,SAASQ,eAGdR,KAA2D;AACpD,SAAA;AAAA,IACLE,MAAMA,CAAC;AAAA,MAAEC;AAAAA,IAAAA,0BAA+BM,UAAA;AAAA,MAAAC,UAAGC,iBAAiBR,KAAK;AAAA,IAAA,CAAI;AAAA,IACrES,OAAO;AAAA,IACPL,UAAU;AAAA,IACV,GAAGP;AAAAA,EAAAA;AAEP;AAEgBa,SAAAA,aAIdb,KACAc,YAC2B;AACpB,SAAA;AAAA,IACLZ,MAAMA,CAAC;AAAA,MAAEC;AAAAA,IAAAA,0BACNY,kBAAgB;AAAA,MAACC,MAAMb;AAAAA,MAAOW;AAAAA,IAAAA,CAAyB;AAAA,IAE1DP,UAAU;AAAA,IACVU,eAAe;AAAA,IACf,GAAGjB;AAAAA,EAAAA;AAEP;AAEO,SAASkB,eAIdlB,KACAmB,0BACAC,4BACAC,iBACAC,eAAiCC,oBAAAA,UAAU,CAAA,CA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oB;AAAA,QACnBC,QAAQ7E;AAAAA,QACRsE,aAAaI,QAAQH,sBAAsBD;AAAAA,QAC3CE,UAAWM,CAAAA,QAAQN,qCAAW/C,IAAI2C,IAAIU;AAAAA,QACtCC,UAAUL;AAAAA,QACVM,eAAe;AAAA,UACb,mBAAmBC,MAAMb,IAAIK,OAAOL,EAAE;AAAA,QACxC;AAAA,MAAA,CACD;AAAA,IAEL;AAAA,IACA3B,WAAW;AAAA,MACTkB,YAAY;AAAA,MACZC,eAAe;AAAA,IACjB;AAAA,IACA,GAAG/D;AAAAA,EAAAA;AAEP;AAEO,SAASqF,iBAIdrF,KACAsF,YACAC,UACAnC,OAC2B;AACpB,SAAA;AAAA,IACLlD,MAAMA,CAACyB,cAAiC;AAChC,YAAA;AAAA,QAAEC;AAAAA,MAAQD,IAAAA;AACV6D,YAAAA,WAAUF,yCAAa1D,SAAQ;AAC/B6D,YAAAA,QAAQF,qCAAW3D;AAEzB,UAAI6D,OAAO;AACT,mCACGC,sBAAoB;AAAA,UAACF;AAAAA,UAAkBC;AAAAA,UAAcrC;AAAAA,QAAAA,CAAe;AAAA,MAEzE;AAEA,iCAAO3C,UAAA;AAAA,QAAAC,UAAE;AAAA,MAAA,CAAG;AAAA,IACd;AAAA,IAEAkC,WAAW;AAAA,MACTkB,YAAY;AAAA,MACZC,eAAe;AAAA,IACjB;AAAA,IACA,GAAG/D;AAAAA,EAAAA;AAEP;"}
1
+ {"version":3,"file":"renderers.js","sources":["../../../../../src/components/Table/renderers/renderers.tsx"],"sourcesContent":["import { ClassNames } from \"@emotion/react\";\n\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport { setId } from \"@core/utils/setId\";\nimport { HvTag, HvTagProps } from \"@core/components/Tag\";\nimport { HvButton } from \"@core/components/Button\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport {\n HvOverflowTooltip,\n HvOverflowTooltipProps,\n} from \"@core/components/OverflowTooltip\";\nimport { HvBaseSwitchProps } from \"@core/components/BaseSwitch\";\nimport { HvListValue } from \"@core/components/List\";\n\nimport {\n HvTableHeaderRenderer,\n HvCellProps,\n HvTableColumnConfig,\n HvRowInstance,\n} from \"../hooks/useTable\";\nimport { HvDateColumnCell } from \"./DateColumnCell\";\nimport { HvSwitchColumnCell } from \"./SwitchColumnCell\";\nimport { HvProgressColumnCell } from \"./ProgressColumnCell\";\nimport { HvDropdownColumnCell } from \"./DropdownColumnCell\";\nimport { hvStringFallback, hvNumberFallback } from \"../utils\";\n\nexport function hvTextColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n overflowTooltipProps: Omit<HvOverflowTooltipProps, \"data\"> = {}\n): HvTableColumnConfig<D, H> {\n return {\n Cell: ({ value }: HvCellProps<D, H>) => (\n <HvOverflowTooltip\n data={hvStringFallback(value)}\n {...overflowTooltipProps}\n />\n ),\n sortType: \"alphanumeric\",\n ...col,\n };\n}\n\nexport function hvNumberColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(col: HvTableColumnConfig<D, H>): HvTableColumnConfig<D, H> {\n return {\n Cell: ({ value }: HvCellProps<D, H>) => <>{hvNumberFallback(value)}</>,\n align: \"right\",\n sortType: \"number\",\n ...col,\n };\n}\n\nexport function hvDateColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n dateFormat?: string\n): HvTableColumnConfig<D, H> {\n return {\n Cell: ({ value }: HvCellProps<D, H>) => (\n <HvDateColumnCell date={value} dateFormat={dateFormat} />\n ),\n sortType: \"alphanumeric\",\n sortDescFirst: true,\n ...col,\n };\n}\n\nexport function hvExpandColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n expandRowButtonAriaLabel: string,\n collapseRowButtonAriaLabel: string,\n getCanRowExpand?: (row: HvRowInstance<D, H>) => boolean,\n ExpandedIcon: React.ReactNode = <DropUpXS />,\n CollapsedIcon: React.ReactNode = <DropDownXS />\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { value, row } = cellProps;\n const expandedProps = row.getToggleRowExpandedProps?.();\n\n const hasContent = getCanRowExpand?.(row) ?? true;\n\n return (\n <ClassNames>\n {({ css }) => (\n <>\n {hasContent && (\n <HvButton\n icon\n aria-label={\n row.isExpanded\n ? collapseRowButtonAriaLabel\n : expandRowButtonAriaLabel\n }\n aria-expanded={row.isExpanded}\n onClick={expandedProps?.onClick}\n classes={{\n root: css({\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n }),\n }}\n >\n {row.isExpanded ? ExpandedIcon : CollapsedIcon}\n </HvButton>\n )}\n\n <HvOverflowTooltip data={hvStringFallback(value)} />\n </>\n )}\n </ClassNames>\n );\n },\n sortType: \"alphanumeric\",\n cellStyle: {\n position: \"relative\",\n },\n ...col,\n };\n}\n\nexport function hvTagColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer,\n A extends object = Record<string, unknown>\n>(\n col: HvTableColumnConfig<D, H>,\n valueDataKey: keyof A,\n colorDataKey: keyof A,\n textColorDataKey: keyof A,\n fromRowData: boolean = false,\n tagProps?: HvTagProps\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { value, row } = cellProps;\n if (!value) {\n return <>—</>;\n }\n\n const {\n [valueDataKey]: name,\n [colorDataKey]: color,\n [textColorDataKey]: textColor,\n } = fromRowData ? row.original : value;\n\n return (\n <HvTag\n label={<HvTypography variant=\"body\">{name}</HvTypography>}\n type=\"semantic\"\n color={color}\n style={textColor != null ? { color: textColor } : {}}\n tabIndex={-1}\n {...tagProps}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\n// TODO - Review accessibility on the next renderers because they all differ\n\nexport function hvSwitchColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n switchLabel: string,\n falseLabel?: string,\n trueLabel?: string,\n switchProps?: HvBaseSwitchProps\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { value, row } = cellProps;\n return (\n <HvSwitchColumnCell\n checked={value}\n value={row.id}\n switchLabel={switchLabel}\n falseLabel={falseLabel}\n trueLabel={trueLabel}\n switchProps={switchProps}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvDropdownColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n id: string | undefined,\n placeholder: string,\n disabledPlaceholder: string,\n onChange?: (identifier: string, value: HvListValue) => void\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { value, row, column } = cellProps;\n const dsbld = value.length < 1;\n return (\n <HvDropdownColumnCell\n values={value}\n placeholder={dsbld ? disabledPlaceholder : placeholder}\n onChange={(val) => onChange?.(row.id, val)}\n disabled={dsbld}\n dropdownProps={{\n \"aria-labelledby\": setId(id, column.id) || column.id || id, // TODO - to be reviewed because it doesn't make much sense\n }}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvProgressColumn<\n D extends object = Record<string, unknown>,\n H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer\n>(\n col: HvTableColumnConfig<D, H>,\n getPartial?: (row: HvRowInstance<D, H>) => number,\n getTotal?: (row: HvRowInstance<D, H>) => number,\n color?: \"primary\" | \"secondary\"\n): HvTableColumnConfig<D, H> {\n return {\n Cell: (cellProps: HvCellProps<D, H>) => {\n const { row, column } = cellProps;\n const partial = getPartial?.(row) || 0;\n const total = getTotal?.(row);\n\n if (total) {\n return (\n <HvProgressColumnCell\n partial={partial}\n total={total}\n color={color}\n aria-labelledby={column.id}\n />\n );\n }\n\n return <>—</>;\n },\n\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n"],"names":["hvTextColumn","col","overflowTooltipProps","Cell","value","HvOverflowTooltip","data","hvStringFallback","sortType","hvNumberColumn","_Fragment","children","hvNumberFallback","align","hvDateColumn","dateFormat","HvDateColumnCell","date","sortDescFirst","hvExpandColumn","expandRowButtonAriaLabel","collapseRowButtonAriaLabel","getCanRowExpand","ExpandedIcon","DropUpXS","CollapsedIcon","_jsx","DropDownXS","cellProps","row","expandedProps","getToggleRowExpandedProps","hasContent","ClassNames","css","HvButton","icon","isExpanded","onClick","classes","root","position","left","top","transform","cellStyle","hvTagColumn","valueDataKey","colorDataKey","textColorDataKey","fromRowData","tagProps","name","color","textColor","original","HvTag","label","HvTypography","variant","type","style","tabIndex","paddingTop","paddingBottom","hvSwitchColumn","switchLabel","falseLabel","trueLabel","switchProps","HvSwitchColumnCell","checked","id","hvDropdownColumn","placeholder","disabledPlaceholder","onChange","column","dsbld","length","HvDropdownColumnCell","values","val","disabled","dropdownProps","setId","hvProgressColumn","getPartial","getTotal","partial","total","HvProgressColumnCell"],"mappings":";;;;;;;;;;;;;AA2BO,SAASA,aAIdC,KACAC,uBAA6D,IAClC;AACpB,SAAA;AAAA,IACLC,MAAMA,CAAC;AAAA,MAAEC;AAAAA,IAAAA,0BACNC,mBAAiB;AAAA,MAChBC,MAAMC,iBAAiBH,KAAK;AAAA,MAAE,GAC1BF;AAAAA,IAAAA,CACL;AAAA,IAEHM,UAAU;AAAA,IACV,GAAGP;AAAAA,EAAAA;AAEP;AAEO,SAASQ,eAGdR,KAA2D;AACpD,SAAA;AAAA,IACLE,MAAMA,CAA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,mBAAiBwB,OAAOL;AAAAA,QAAAA,CACzB;AAAA,MAEL;AAEA,iCAAO9D,UAAA;AAAA,QAAAC,UAAE;AAAA,MAAA,CAAG;AAAA,IACd;AAAA,IAEAkC,WAAW;AAAA,MACTkB,YAAY;AAAA,MACZC,eAAe;AAAA,IACjB;AAAA,IACA,GAAG/D;AAAAA,EAAAA;AAEP;"}
@@ -22,7 +22,6 @@ const getColor = (customColor, type, colors) => {
22
22
  return backgroundColor;
23
23
  };
24
24
  const HvTag = (props) => {
25
- var _a;
26
25
  const {
27
26
  classes: classesProp,
28
27
  className,
@@ -40,8 +39,7 @@ const HvTag = (props) => {
40
39
  ...others
41
40
  } = useDefaultProps("HvTag", props);
42
41
  const {
43
- activeTheme,
44
- selectedMode
42
+ colors
45
43
  } = useTheme();
46
44
  const {
47
45
  classes,
@@ -82,7 +80,7 @@ const HvTag = (props) => {
82
80
  const inlineStyle = {
83
81
  ...style
84
82
  };
85
- const categoricalBackgroundColor = type === "categorical" ? getColor(color, type, (_a = activeTheme == null ? void 0 : activeTheme.colors) == null ? void 0 : _a.modes[selectedMode]) : void 0;
83
+ const categoricalBackgroundColor = type === "categorical" ? getColor(color, type, colors) : void 0;
86
84
  if (type === "semantic") {
87
85
  inlineStyle.backgroundColor = getColor(color, type, {});
88
86
  } else if (type === "categorical") {
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import { CSSProperties, useState } from \"react\";\nimport { HvColorAny, theme } from \"@hitachivantara/uikit-styles\";\nimport Chip, { ChipProps as MuiChipProps } from \"@mui/material/Chip\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useTheme } from \"@core/hooks/useTheme\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { HvButton, HvButtonProps } from \"@core/components/Button\";\n\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { CloseXS } from \"@hitachivantara/uikit-react-icons\";\nimport { staticClasses, useClasses } from \"./Tag.styles\";\nimport { getOnDeleteCallback, hasDeleteAction, hasClickAction } from \"./utils\";\n\nexport { staticClasses as tagClasses };\n\nexport type HvTagClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTagProps\n extends Omit<MuiChipProps, \"color\" | \"classes\">,\n HvBaseProps<HTMLDivElement, \"children\"> {\n /** Inline styles to be applied to the root element. */\n style?: CSSProperties;\n /** The label of the tag element. */\n label?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** The type of the tag element. A tag can be of semantic or categoric type. */\n type?: \"semantic\" | \"categorical\";\n /** Background color to be applied to the tag */\n color?: HvColorAny;\n /** Icon used to customize the delete icon in the Chip element */\n deleteIcon?: React.ReactElement;\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component, in order to render the delete icon\n * */\n onDelete?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Callback triggered when any item is clicked. */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** The role of the element with an attributed event. */\n role?: string;\n /** Aria properties to apply to delete button in tag */\n deleteButtonArialLabel?: string; // TODO: fix typo \"ArialLabel\" in next version\n /** Props to apply to delete button */\n deleteButtonProps?: HvButtonProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTagClasses;\n}\n\nconst getColor = (customColor, type, colors) => {\n const defaultSemanticColor = theme.colors.neutral_20;\n const defaultCategoricalColor = colors.cat1;\n\n let backgroundColor;\n\n if (type === \"semantic\") {\n backgroundColor =\n theme.colors[customColor] || customColor || defaultSemanticColor;\n }\n if (type === \"categorical\") {\n backgroundColor =\n colors[customColor] || customColor || defaultCategoricalColor;\n }\n return backgroundColor;\n};\n\n/**\n * A Tag is one word that describes a specific aspect of an asset. A single asset can have\n * multiple tags.\n * Use tags to highlight an item's status for quick recognition and navigation\n * Use color to indicate meanings that users can learn and recognize across products\n *\n * It leverages the Chip component from Material UI\n */\nexport const HvTag = (props: HvTagProps) => {\n const {\n classes: classesProp,\n className,\n style,\n label,\n disabled,\n type = \"semantic\",\n color,\n deleteIcon,\n onDelete,\n onClick,\n role,\n deleteButtonArialLabel = \"Delete tag\",\n deleteButtonProps = {},\n ...others\n } = useDefaultProps(\"HvTag\", props);\n const { activeTheme, selectedMode } = useTheme();\n const { classes, cx, css } = useClasses(classesProp);\n\n const getDeleteIcon = () => {\n const disabledSemanticColor =\n type === \"semantic\" ? \"secondary_60\" : \"base_dark\";\n const { tabIndex = 0 } = deleteButtonProps;\n\n const closeIconStyles = css({\n ...(disabled ? { cursor: \"not-allowed\" } : undefined),\n height: 16,\n \"& svg .color0\": {\n fill: theme.colors[disabled ? disabledSemanticColor : \"base_dark\"],\n },\n });\n return (\n <HvButton\n classes={{\n startIcon: classes.tagButton,\n focusVisible: classes.focusVisible,\n root: classes.button,\n }}\n aria-label={deleteButtonArialLabel}\n tabIndex={tabIndex}\n variant=\"secondaryGhost\"\n {...deleteButtonProps}\n >\n <CloseXS\n iconSize=\"XS\"\n className={closeIconStyles}\n color={disabled ? disabledSemanticColor : \"base_dark\"}\n />\n </HvButton>\n );\n };\n\n const inlineStyle = {\n ...style,\n };\n\n const categoricalBackgroundColor =\n type === \"categorical\"\n ? getColor(color, type, activeTheme?.colors?.modes[selectedMode])\n : undefined;\n\n if (type === \"semantic\") {\n inlineStyle.backgroundColor = getColor(color, type, {});\n } else if (type === \"categorical\") {\n inlineStyle.backgroundColor = `${categoricalBackgroundColor}30`;\n }\n\n const [hover, setHover] = useState(false);\n\n return (\n <Chip\n label={label}\n className={cx(classes.root, className)}\n onMouseEnter={() => {\n setHover(!!onClick);\n }}\n onMouseLeave={() => {\n setHover(false);\n }}\n style={{\n ...(disabled ? null : inlineStyle),\n ...(hover && !disabled\n ? { boxShadow: `0 0 0 1pt ${categoricalBackgroundColor}` }\n : null),\n }}\n classes={{\n root: cx(classes.chipRoot, {\n [classes.disabled]: disabled,\n [classes.clickable]: !!onClick,\n [classes.categorical]: type === \"categorical\",\n [classes.categoricalFocus]: type === \"categorical\" && !disabled,\n [classes.categoricalDisabled]: type === \"categorical\" && disabled,\n }),\n label: classes.label,\n deleteIcon: cx(classes.deleteIcon, {\n [classes.disabledDeleteIcon]: disabled,\n }),\n }}\n deleteIcon={(hasDeleteAction(onDelete) && deleteIcon) || getDeleteIcon()}\n onDelete={getOnDeleteCallback(disabled, onDelete)}\n onClick={disabled ? undefined : onClick}\n role={role || (hasClickAction(onClick) ? \"button\" : undefined)}\n tabIndex={hasDeleteAction(onDelete) ? undefined : 0}\n {...others}\n />\n );\n};\n"],"names":["getColor","customColor","type","colors","defaultSemanticColor","theme","neutral_20","defaultCategoricalColor","cat1","backgroundColor","HvTag","props","classes","classesProp","className","style","label","disabled","color","deleteIcon","onDelete","onClick","role","deleteButtonArialLabel","deleteButtonProps","others","useDefaultProps","activeTheme","selectedMode","useTheme","cx","css","useClasses","getDeleteIcon","disabledSemanticColor","tabIndex","closeIconStyles","cursor","undefined","height","fill","HvButton","startIcon","tagButton","focusVisible","root","button","variant","children","CloseXS","iconSize","inlineStyle","categoricalBackgroundColor","modes","hover","setHover","useState","Chip","onMouseEnter","onMouseLeave","boxShadow","chipRoot","clickable","categorical","categoricalFocus","categoricalDisabled","disabledDeleteIcon","hasDeleteAction","getOnDeleteCallback","hasClickAction"],"mappings":";;;;;;;;;;;AAiDA,MAAMA,WAAWA,CAACC,aAAaC,MAAMC,WAAW;AACxCC,QAAAA,uBAAuBC,MAAMF,OAAOG;AAC1C,QAAMC,0BAA0BJ,OAAOK;AAEnCC,MAAAA;AAEJ,MAAIP,SAAS,YAAY;AACvBO,sBACEJ,MAAMF,OAAOF,WAAW,KAAKA,eAAeG;AAAAA,EAChD;AACA,MAAIF,SAAS,eAAe;AAExBC,sBAAAA,OAAOF,WAAW,KAAKA,eAAeM;AAAAA,EAC1C;AACOE,SAAAA;AACT;AAUaC,MAAAA,QAAQA,CAACC,UAAsB;;AACpC,QAAA;AAAA,IACJC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC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ASJ,WAAWqB,SAAYjB;AAAAA,IAChCC,MAAMA,SAAS+C,eAAehD,OAAO,IAAI,WAAWiB;AAAAA,IACpDH,UAAUgC,gBAAgB/C,QAAQ,IAAIkB,SAAY;AAAA,IAAE,GAChDb;AAAAA,EAAAA,CACL;AAEL;"}
1
+ {"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import { CSSProperties, useState } from \"react\";\nimport { HvColorAny, theme } from \"@hitachivantara/uikit-styles\";\nimport Chip, { ChipProps as MuiChipProps } from \"@mui/material/Chip\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useTheme } from \"@core/hooks/useTheme\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { HvButton, HvButtonProps } from \"@core/components/Button\";\n\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { CloseXS } from \"@hitachivantara/uikit-react-icons\";\nimport { staticClasses, useClasses } from \"./Tag.styles\";\nimport { getOnDeleteCallback, hasDeleteAction, hasClickAction } from \"./utils\";\n\nexport { staticClasses as tagClasses };\n\nexport type HvTagClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTagProps\n extends Omit<MuiChipProps, \"color\" | \"classes\">,\n HvBaseProps<HTMLDivElement, \"children\"> {\n /** Inline styles to be applied to the root element. */\n style?: CSSProperties;\n /** The label of the tag element. */\n label?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** The type of the tag element. A tag can be of semantic or categoric type. */\n type?: \"semantic\" | \"categorical\";\n /** Background color to be applied to the tag */\n color?: HvColorAny;\n /** Icon used to customize the delete icon in the Chip element */\n deleteIcon?: React.ReactElement;\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component, in order to render the delete icon\n * */\n onDelete?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Callback triggered when any item is clicked. */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** The role of the element with an attributed event. */\n role?: string;\n /** Aria properties to apply to delete button in tag */\n deleteButtonArialLabel?: string; // TODO: fix typo \"ArialLabel\" in next version\n /** Props to apply to delete button */\n deleteButtonProps?: HvButtonProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTagClasses;\n}\n\nconst getColor = (customColor, type, colors) => {\n const defaultSemanticColor = theme.colors.neutral_20;\n const defaultCategoricalColor = colors.cat1;\n\n let backgroundColor;\n\n if (type === \"semantic\") {\n backgroundColor =\n theme.colors[customColor] || customColor || defaultSemanticColor;\n }\n if (type === \"categorical\") {\n backgroundColor =\n colors[customColor] || customColor || defaultCategoricalColor;\n }\n return backgroundColor;\n};\n\n/**\n * A Tag is one word that describes a specific aspect of an asset. A single asset can have\n * multiple tags.\n * Use tags to highlight an item's status for quick recognition and navigation\n * Use color to indicate meanings that users can learn and recognize across products\n *\n * It leverages the Chip component from Material UI\n */\nexport const HvTag = (props: HvTagProps) => {\n const {\n classes: classesProp,\n className,\n style,\n label,\n disabled,\n type = \"semantic\",\n color,\n deleteIcon,\n onDelete,\n onClick,\n role,\n deleteButtonArialLabel = \"Delete tag\",\n deleteButtonProps = {},\n ...others\n } = useDefaultProps(\"HvTag\", props);\n const { colors } = useTheme();\n const { classes, cx, css } = useClasses(classesProp);\n\n const getDeleteIcon = () => {\n const disabledSemanticColor =\n type === \"semantic\" ? \"secondary_60\" : \"base_dark\";\n const { tabIndex = 0 } = deleteButtonProps;\n\n const closeIconStyles = css({\n ...(disabled ? { cursor: \"not-allowed\" } : undefined),\n height: 16,\n \"& svg .color0\": {\n fill: theme.colors[disabled ? disabledSemanticColor : \"base_dark\"],\n },\n });\n return (\n <HvButton\n classes={{\n startIcon: classes.tagButton,\n focusVisible: classes.focusVisible,\n root: classes.button,\n }}\n aria-label={deleteButtonArialLabel}\n tabIndex={tabIndex}\n variant=\"secondaryGhost\"\n {...deleteButtonProps}\n >\n <CloseXS\n iconSize=\"XS\"\n className={closeIconStyles}\n color={disabled ? disabledSemanticColor : \"base_dark\"}\n />\n </HvButton>\n );\n };\n\n const inlineStyle = {\n ...style,\n };\n\n const categoricalBackgroundColor =\n type === \"categorical\" ? getColor(color, type, colors) : undefined;\n\n if (type === \"semantic\") {\n inlineStyle.backgroundColor = getColor(color, type, {});\n } else if (type === \"categorical\") {\n inlineStyle.backgroundColor = `${categoricalBackgroundColor}30`;\n }\n\n const [hover, setHover] = useState(false);\n\n return (\n <Chip\n label={label}\n className={cx(classes.root, className)}\n onMouseEnter={() => {\n setHover(!!onClick);\n }}\n onMouseLeave={() => {\n setHover(false);\n }}\n style={{\n ...(disabled ? null : inlineStyle),\n ...(hover && !disabled\n ? { boxShadow: `0 0 0 1pt ${categoricalBackgroundColor}` }\n : null),\n }}\n classes={{\n root: cx(classes.chipRoot, {\n [classes.disabled]: disabled,\n [classes.clickable]: !!onClick,\n [classes.categorical]: type === \"categorical\",\n [classes.categoricalFocus]: type === \"categorical\" && !disabled,\n [classes.categoricalDisabled]: type === \"categorical\" && disabled,\n }),\n label: classes.label,\n deleteIcon: cx(classes.deleteIcon, {\n [classes.disabledDeleteIcon]: disabled,\n }),\n }}\n deleteIcon={(hasDeleteAction(onDelete) && deleteIcon) || getDeleteIcon()}\n onDelete={getOnDeleteCallback(disabled, onDelete)}\n onClick={disabled ? undefined : onClick}\n role={role || (hasClickAction(onClick) ? \"button\" : undefined)}\n tabIndex={hasDeleteAction(onDelete) ? undefined : 0}\n {...others}\n />\n );\n};\n"],"names":["getColor","customColor","type","colors","defaultSemanticColor","theme","neutral_20","defaultCategoricalColor","cat1","backgroundColor","HvTag","props","classes","classesProp","className","style","label","disabled","color","deleteIcon","onDelete","onClick","role","deleteButtonArialLabel","deleteButtonProps","others","useDefaultProps","useTheme","cx","css","useClasses","getDeleteIcon","disabledSemanticColor","tabIndex","closeIconStyles","cursor","undefined","height","fill","HvButton","startIcon","tagButton","focusVisible","root","button","variant","children","CloseXS","iconSize","inlineStyle","categoricalBackgroundColor","hover","setHover","useState","Chip","onMouseEnter","onMouseLeave","boxShadow","chipRoot","clickable","categorical","categoricalFocus","categoricalDisabled","disabledDeleteIcon","hasDeleteAction","getOnDeleteCallback","hasClickAction"],"mappings":";;;;;;;;;;;AAiDA,MAAMA,WAAWA,CAACC,aAAaC,MAAMC,WAAW;AACxCC,QAAAA,uBAAuBC,MAAMF,OAAOG;AAC1C,QAAMC,0BAA0BJ,OAAOK;AAEnCC,MAAAA;AAEJ,MAAIP,SAAS,YAAY;AACvBO,sBACEJ,MAAMF,OAAOF,WAAW,KAAKA,eAAeG;AAAAA,EAChD;AACA,MAAIF,SAAS,eAAe;AAExBC,sBAAAA,OAAOF,WAAW,KAAKA,eAAeM;AAAAA,EAC1C;AACOE,SAAAA;AACT;AAUaC,MAAAA,QAAQA,CAACC,UAAsB;AACpC,QAAA;AAAA,IACJC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAf,OAAO;AAAA,IACPgB;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,yBAAyB;AAAA,IACzBC,oBAAoB,CAAC;AAAA,IACrB,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,SAASf,KAAK;AAC5B,QAAA;AAAA,IAAER;AAAAA,MAAWwB,SAAS;AACtB,QAAA;AAAA,IAAEf;AAAAA,IAASgB;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,WAAWjB,WAAW;AAEnD,QAAMkB,gBAAgBA,MAAM;AACpBC,UAAAA,wBACJ9B,SAAS,aAAa,iBAAiB;AACnC,UAAA;AAAA,MAAE+B,WAAW;AAAA,IAAMT,IAAAA;AAEzB,UAAMU,kBAAkBL,IAAI;AAAA,MAC1B,GAAIZ,WAAW;AAAA,QAAEkB,QAAQ;AAAA,MAAkBC,IAAAA;AAAAA,MAC3CC,QAAQ;AAAA,MACR,iBAAiB;AAAA,QACfC,MAAMjC,MAAMF,OAAOc,WAAWe,wBAAwB,WAAW;AAAA,MACnE;AAAA,IAAA,CACD;AACD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AAG,CAAC,CAACtC;AAAAA,QACvB,CAACT,QAAQgD,WAAW,GAAG1D,SAAS;AAAA,QAChC,CAACU,QAAQiD,gBAAgB,GAAG3D,SAAS,iBAAiB,CAACe;AAAAA,QACvD,CAACL,QAAQkD,mBAAmB,GAAG5D,SAAS,iBAAiBe;AAAAA,MAAAA,CAC1D;AAAA,MACDD,OAAOJ,QAAQI;AAAAA,MACfG,YAAYS,GAAGhB,QAAQO,YAAY;AAAA,QACjC,CAACP,QAAQmD,kBAAkB,GAAG9C;AAAAA,MAAAA,CAC/B;AAAA,IACH;AAAA,IACAE,YAAa6C,gBAAgB5C,QAAQ,KAAKD,cAAeY,cAAc;AAAA,IACvEX,UAAU6C,oBAAoBhD,UAAUG,QAAQ;AAAA,IAChDC,SAASJ,WAAWmB,SAAYf;AAAAA,IAChCC,MAAMA,SAAS4C,eAAe7C,OAAO,IAAI,WAAWe;AAAAA,IACpDH,UAAU+B,gBAAgB5C,QAAQ,IAAIgB,SAAY;AAAA,IAAE,GAChDX;AAAAA,EAAAA,CACL;AAEL;"}
@@ -40,7 +40,7 @@ const {
40
40
  flexDirection: "row",
41
41
  justifyContent: "center",
42
42
  alignItems: "center",
43
- padding: theme.spacing(["xs", 0]),
43
+ padding: theme.spacing("xs", 0),
44
44
  userSelect: "none",
45
45
  minWidth: "175px"
46
46
  },
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.styles.js","sources":["../../../../src/components/TimePicker/TimePicker.styles.ts"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvTimePicker\", {\n root: {\n position: \"relative\",\n },\n\n labelContainer: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n label: {\n marginBottom: 6,\n display: \"block\",\n },\n description: {},\n\n placeholder: {\n display: \"flex\",\n gap: 1,\n },\n placeholderDisabled: {\n color: theme.colors.secondary_60,\n },\n\n dropdownHeader: {},\n dropdownHeaderOpen: {},\n dropdownHeaderInvalid: {\n border: `1px solid ${theme.colors.negative}`,\n \"&:hover\": {\n border: `1px solid ${theme.colors.negative}`,\n },\n },\n dropdownPanel: {},\n\n icon: {},\n\n timePopperContainer: {\n backgroundColor: theme.colors.atmo1,\n zIndex: 10,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: theme.spacing([\"xs\", 0]),\n userSelect: \"none\",\n minWidth: \"175px\",\n },\n\n error: {},\n});\n"],"names":["useClasses","staticClasses","createClasses","root","position","labelContainer","display","alignItems","label","marginBottom","description","placeholder","gap","placeholderDisabled","color","theme","colors","secondary_60","dropdownHeader","dropdownHeaderOpen","dropdownHeaderInvalid","border","negative","dropdownPanel","icon","timePopperContainer","backgroundColor","atmo1","zIndex","flexDirection","justifyContent","padding","spacing","userSelect","minWidth","error"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAAc,gBAAgB;AAAA,EACzEC,MAAM;AAAA,IACJC,UAAU;AAAA,EACZ;AAAA,EAEAC,gBAAgB;AAAA,IACdC,SAAS;AAAA,IACTC,YAAY;AAAA,EACd;AAAA,EACAC,OAAO;AAAA,IACLC,cAAc;AAAA,IACdH,SAAS;AAAA,EACX;AAAA,EACAI,aAAa,CAAC;AAAA,EAEdC,aAAa;AAAA,IACXL,SAAS;AAAA,IACTM,KAAK;AAAA,EACP;AAAA,EACAC,qBAAqB;AAAA,IACnBC,OAAOC,MAAMC,OAAOC;AAAAA,EACtB;AAAA,EAEAC,gBAAgB,CAAC;AAAA,EACjBC,oBAAoB,CAAC;AAAA,EACrBC,uBAAuB;AAAA,IACrBC,QAAS,aAAYN,MAAMC,OAAOM;AAAAA,IAClC,WAAW;AAAA,MACTD,QAAS,aAAYN,MAAMC,OAAOM;AAAAA,IACpC;AAAA,EACF;AAAA,EACAC,eAAe,CAAC;AAAA,EAEhBC,MAAM,CAAC;AAAA,EAEPC,qBAAqB;AAAA,IACnBC,iBAAiBX,MAAMC,OAAOW;AAAAA,IAC9BC,QAAQ;AAAA,IACRtB,SAAS;AAAA,IACTuB,eAAe;AAAA,IACfC,gBAAgB;AAAA,IAChBvB,YAAY;AAAA,IACZwB,SAAShB,MAAMiB,QAAQ,CAAC,MAAM,CAAC,CAAC;AAAA,IAChCC,YAAY;AAAA,IACZC,UAAU;AAAA,EACZ;AAAA,EAEAC,OAAO,CAAC;AACV,CAAC;"}
1
+ {"version":3,"file":"TimePicker.styles.js","sources":["../../../../src/components/TimePicker/TimePicker.styles.ts"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvTimePicker\", {\n root: {\n position: \"relative\",\n },\n\n labelContainer: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n label: {\n marginBottom: 6,\n display: \"block\",\n },\n description: {},\n\n placeholder: {\n display: \"flex\",\n gap: 1,\n },\n placeholderDisabled: {\n color: theme.colors.secondary_60,\n },\n\n dropdownHeader: {},\n dropdownHeaderOpen: {},\n dropdownHeaderInvalid: {\n border: `1px solid ${theme.colors.negative}`,\n \"&:hover\": {\n border: `1px solid ${theme.colors.negative}`,\n },\n },\n dropdownPanel: {},\n\n icon: {},\n\n timePopperContainer: {\n backgroundColor: theme.colors.atmo1,\n zIndex: 10,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: theme.spacing(\"xs\", 0),\n userSelect: \"none\",\n minWidth: \"175px\",\n },\n\n error: {},\n});\n"],"names":["useClasses","staticClasses","createClasses","root","position","labelContainer","display","alignItems","label","marginBottom","description","placeholder","gap","placeholderDisabled","color","theme","colors","secondary_60","dropdownHeader","dropdownHeaderOpen","dropdownHeaderInvalid","border","negative","dropdownPanel","icon","timePopperContainer","backgroundColor","atmo1","zIndex","flexDirection","justifyContent","padding","spacing","userSelect","minWidth","error"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAAc,gBAAgB;AAAA,EACzEC,MAAM;AAAA,IACJC,UAAU;AAAA,EACZ;AAAA,EAEAC,gBAAgB;AAAA,IACdC,SAAS;AAAA,IACTC,YAAY;AAAA,EACd;AAAA,EACAC,OAAO;AAAA,IACLC,cAAc;AAAA,IACdH,SAAS;AAAA,EACX;AAAA,EACAI,aAAa,CAAC;AAAA,EAEdC,aAAa;AAAA,IACXL,SAAS;AAAA,IACTM,KAAK;AAAA,EACP;AAAA,EACAC,qBAAqB;AAAA,IACnBC,OAAOC,MAAMC,OAAOC;AAAAA,EACtB;AAAA,EAEAC,gBAAgB,CAAC;AAAA,EACjBC,oBAAoB,CAAC;AAAA,EACrBC,uBAAuB;AAAA,IACrBC,QAAS,aAAYN,MAAMC,OAAOM;AAAAA,IAClC,WAAW;AAAA,MACTD,QAAS,aAAYN,MAAMC,OAAOM;AAAAA,IACpC;AAAA,EACF;AAAA,EACAC,eAAe,CAAC;AAAA,EAEhBC,MAAM,CAAC;AAAA,EAEPC,qBAAqB;AAAA,IACnBC,iBAAiBX,MAAMC,OAAOW;AAAAA,IAC9BC,QAAQ;AAAA,IACRtB,SAAS;AAAA,IACTuB,eAAe;AAAA,IACfC,gBAAgB;AAAA,IAChBvB,YAAY;AAAA,IACZwB,SAAShB,MAAMiB,QAAQ,MAAM,CAAC;AAAA,IAC9BC,YAAY;AAAA,IACZC,UAAU;AAAA,EACZ;AAAA,EAEAC,OAAO,CAAC;AACV,CAAC;"}