@hitachivantara/uikit-react-core 5.90.0 → 5.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/cjs/Accordion/Accordion.cjs +1 -1
  2. package/dist/cjs/Accordion/Accordion.styles.cjs +1 -5
  3. package/dist/cjs/Avatar/Avatar.cjs +16 -9
  4. package/dist/cjs/Avatar/Avatar.styles.cjs +13 -37
  5. package/dist/cjs/AvatarGroup/AvatarGroup.styles.cjs +36 -43
  6. package/dist/cjs/Badge/Badge.cjs +3 -2
  7. package/dist/cjs/Badge/Badge.styles.cjs +5 -2
  8. package/dist/cjs/BaseCheckBox/BaseCheckBox.cjs +8 -11
  9. package/dist/cjs/BaseCheckBox/BaseCheckBox.styles.cjs +17 -16
  10. package/dist/cjs/BaseDropdown/BaseDropdown.cjs +4 -3
  11. package/dist/cjs/BaseDropdown/BaseDropdown.styles.cjs +26 -24
  12. package/dist/cjs/BaseRadio/BaseRadio.cjs +6 -10
  13. package/dist/cjs/BaseRadio/BaseRadio.styles.cjs +12 -26
  14. package/dist/cjs/BaseSwitch/BaseSwitch.styles.cjs +12 -8
  15. package/dist/cjs/BulkActions/BulkActions.styles.cjs +4 -3
  16. package/dist/cjs/Button/Button.styles.cjs +11 -12
  17. package/dist/cjs/Card/Card.styles.cjs +2 -2
  18. package/dist/cjs/CheckBox/CheckBox.cjs +1 -1
  19. package/dist/cjs/CheckBox/CheckBox.styles.cjs +13 -4
  20. package/dist/cjs/ColorPicker/PresetColors/PresetColors.cjs +2 -0
  21. package/dist/cjs/ColorPicker/SavedColors/SavedColors.cjs +5 -6
  22. package/dist/cjs/DatePicker/DatePicker.cjs +1 -1
  23. package/dist/cjs/DatePicker/DatePicker.styles.cjs +1 -1
  24. package/dist/cjs/DotPagination/DotPagination.cjs +10 -15
  25. package/dist/cjs/DotPagination/DotPagination.styles.cjs +15 -3
  26. package/dist/cjs/Drawer/Drawer.styles.cjs +2 -2
  27. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +2 -2
  28. package/dist/cjs/DropDownMenu/DropDownMenu.styles.cjs +8 -8
  29. package/dist/cjs/Dropdown/Dropdown.styles.cjs +5 -6
  30. package/dist/cjs/DropdownButton/DropdownButton.cjs +2 -3
  31. package/dist/cjs/DropdownButton/DropdownButton.styles.cjs +9 -10
  32. package/dist/cjs/FileUploader/File/File.cjs +4 -2
  33. package/dist/cjs/FileUploader/File/File.styles.cjs +15 -13
  34. package/dist/cjs/FileUploader/FileList/FileList.cjs +1 -1
  35. package/dist/cjs/FileUploader/FileList/FileList.styles.cjs +2 -10
  36. package/dist/cjs/Footer/Footer.styles.cjs +4 -12
  37. package/dist/cjs/Header/Header.styles.cjs +1 -1
  38. package/dist/cjs/InlineEditor/InlineEditor.cjs +0 -1
  39. package/dist/cjs/InlineEditor/InlineEditor.styles.cjs +1 -1
  40. package/dist/cjs/MultiButton/MultiButton.styles.cjs +11 -9
  41. package/dist/cjs/Pagination/Pagination.styles.cjs +2 -3
  42. package/dist/cjs/QueryBuilder/QueryBuilder.styles.cjs +2 -3
  43. package/dist/cjs/Radio/Radio.styles.cjs +1 -6
  44. package/dist/cjs/Select/Select.cjs +1 -1
  45. package/dist/cjs/Select/Select.styles.cjs +12 -7
  46. package/dist/cjs/Skeleton/Skeleton.cjs +2 -5
  47. package/dist/cjs/Slider/Slider.styles.cjs +3 -3
  48. package/dist/cjs/Slider/SliderInput/SliderInput.cjs +2 -3
  49. package/dist/cjs/Slider/SliderInput/SliderInput.styles.cjs +9 -3
  50. package/dist/cjs/Table/TableHeader/TableHeader.cjs +0 -1
  51. package/dist/cjs/Tag/Tag.cjs +19 -10
  52. package/dist/cjs/Tag/Tag.styles.cjs +35 -8
  53. package/dist/cjs/TimePicker/TimePicker.styles.cjs +1 -1
  54. package/dist/cjs/Tooltip/Tooltip.styles.cjs +1 -1
  55. package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +1 -1
  56. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +1 -1
  57. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +1 -0
  58. package/dist/cjs/VerticalNavigation/VerticalNavigation.styles.cjs +2 -2
  59. package/dist/cjs/index.cjs +0 -1
  60. package/dist/cjs/utils/Callout.cjs +1 -1
  61. package/dist/esm/Accordion/Accordion.js +1 -1
  62. package/dist/esm/Accordion/Accordion.js.map +1 -1
  63. package/dist/esm/Accordion/Accordion.styles.js +1 -5
  64. package/dist/esm/Accordion/Accordion.styles.js.map +1 -1
  65. package/dist/esm/Avatar/Avatar.js +14 -7
  66. package/dist/esm/Avatar/Avatar.js.map +1 -1
  67. package/dist/esm/Avatar/Avatar.styles.js +13 -37
  68. package/dist/esm/Avatar/Avatar.styles.js.map +1 -1
  69. package/dist/esm/AvatarGroup/AvatarGroup.styles.js +36 -43
  70. package/dist/esm/AvatarGroup/AvatarGroup.styles.js.map +1 -1
  71. package/dist/esm/Badge/Badge.js +3 -2
  72. package/dist/esm/Badge/Badge.js.map +1 -1
  73. package/dist/esm/Badge/Badge.styles.js +5 -2
  74. package/dist/esm/Badge/Badge.styles.js.map +1 -1
  75. package/dist/esm/BaseCheckBox/BaseCheckBox.js +4 -7
  76. package/dist/esm/BaseCheckBox/BaseCheckBox.js.map +1 -1
  77. package/dist/esm/BaseCheckBox/BaseCheckBox.styles.js +17 -16
  78. package/dist/esm/BaseCheckBox/BaseCheckBox.styles.js.map +1 -1
  79. package/dist/esm/BaseDropdown/BaseDropdown.js +4 -3
  80. package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
  81. package/dist/esm/BaseDropdown/BaseDropdown.styles.js +26 -24
  82. package/dist/esm/BaseDropdown/BaseDropdown.styles.js.map +1 -1
  83. package/dist/esm/BaseRadio/BaseRadio.js +4 -8
  84. package/dist/esm/BaseRadio/BaseRadio.js.map +1 -1
  85. package/dist/esm/BaseRadio/BaseRadio.styles.js +12 -26
  86. package/dist/esm/BaseRadio/BaseRadio.styles.js.map +1 -1
  87. package/dist/esm/BaseSwitch/BaseSwitch.styles.js +12 -8
  88. package/dist/esm/BaseSwitch/BaseSwitch.styles.js.map +1 -1
  89. package/dist/esm/BulkActions/BulkActions.styles.js +4 -3
  90. package/dist/esm/BulkActions/BulkActions.styles.js.map +1 -1
  91. package/dist/esm/Button/Button.styles.js +11 -12
  92. package/dist/esm/Button/Button.styles.js.map +1 -1
  93. package/dist/esm/Card/Card.styles.js +2 -2
  94. package/dist/esm/Card/Card.styles.js.map +1 -1
  95. package/dist/esm/CheckBox/CheckBox.js +1 -1
  96. package/dist/esm/CheckBox/CheckBox.js.map +1 -1
  97. package/dist/esm/CheckBox/CheckBox.styles.js +13 -4
  98. package/dist/esm/CheckBox/CheckBox.styles.js.map +1 -1
  99. package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
  100. package/dist/esm/ColorPicker/PresetColors/PresetColors.js +2 -0
  101. package/dist/esm/ColorPicker/PresetColors/PresetColors.js.map +1 -1
  102. package/dist/esm/ColorPicker/SavedColors/SavedColors.js +5 -6
  103. package/dist/esm/ColorPicker/SavedColors/SavedColors.js.map +1 -1
  104. package/dist/esm/DatePicker/DatePicker.js +1 -1
  105. package/dist/esm/DatePicker/DatePicker.js.map +1 -1
  106. package/dist/esm/DatePicker/DatePicker.styles.js +1 -1
  107. package/dist/esm/DatePicker/DatePicker.styles.js.map +1 -1
  108. package/dist/esm/DotPagination/DotPagination.js +10 -15
  109. package/dist/esm/DotPagination/DotPagination.js.map +1 -1
  110. package/dist/esm/DotPagination/DotPagination.styles.js +15 -3
  111. package/dist/esm/DotPagination/DotPagination.styles.js.map +1 -1
  112. package/dist/esm/Drawer/Drawer.styles.js +2 -2
  113. package/dist/esm/Drawer/Drawer.styles.js.map +1 -1
  114. package/dist/esm/DropDownMenu/DropDownMenu.js +2 -2
  115. package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
  116. package/dist/esm/DropDownMenu/DropDownMenu.styles.js +8 -8
  117. package/dist/esm/DropDownMenu/DropDownMenu.styles.js.map +1 -1
  118. package/dist/esm/Dropdown/Dropdown.styles.js +5 -6
  119. package/dist/esm/Dropdown/Dropdown.styles.js.map +1 -1
  120. package/dist/esm/DropdownButton/DropdownButton.js +2 -3
  121. package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
  122. package/dist/esm/DropdownButton/DropdownButton.styles.js +9 -10
  123. package/dist/esm/DropdownButton/DropdownButton.styles.js.map +1 -1
  124. package/dist/esm/FileUploader/File/File.js +4 -2
  125. package/dist/esm/FileUploader/File/File.js.map +1 -1
  126. package/dist/esm/FileUploader/File/File.styles.js +15 -13
  127. package/dist/esm/FileUploader/File/File.styles.js.map +1 -1
  128. package/dist/esm/FileUploader/FileList/FileList.js +1 -1
  129. package/dist/esm/FileUploader/FileList/FileList.js.map +1 -1
  130. package/dist/esm/FileUploader/FileList/FileList.styles.js +2 -10
  131. package/dist/esm/FileUploader/FileList/FileList.styles.js.map +1 -1
  132. package/dist/esm/Footer/Footer.styles.js +4 -12
  133. package/dist/esm/Footer/Footer.styles.js.map +1 -1
  134. package/dist/esm/Header/Header.styles.js +1 -1
  135. package/dist/esm/Header/Header.styles.js.map +1 -1
  136. package/dist/esm/InlineEditor/InlineEditor.js +0 -1
  137. package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
  138. package/dist/esm/InlineEditor/InlineEditor.styles.js +1 -1
  139. package/dist/esm/InlineEditor/InlineEditor.styles.js.map +1 -1
  140. package/dist/esm/MultiButton/MultiButton.styles.js +11 -9
  141. package/dist/esm/MultiButton/MultiButton.styles.js.map +1 -1
  142. package/dist/esm/Pagination/Pagination.styles.js +2 -3
  143. package/dist/esm/Pagination/Pagination.styles.js.map +1 -1
  144. package/dist/esm/QueryBuilder/QueryBuilder.styles.js +2 -3
  145. package/dist/esm/QueryBuilder/QueryBuilder.styles.js.map +1 -1
  146. package/dist/esm/Radio/Radio.styles.js +1 -6
  147. package/dist/esm/Radio/Radio.styles.js.map +1 -1
  148. package/dist/esm/Select/Select.js +1 -1
  149. package/dist/esm/Select/Select.js.map +1 -1
  150. package/dist/esm/Select/Select.styles.js +12 -7
  151. package/dist/esm/Select/Select.styles.js.map +1 -1
  152. package/dist/esm/SimpleGrid/SimpleGrid.js.map +1 -1
  153. package/dist/esm/Skeleton/Skeleton.js +2 -5
  154. package/dist/esm/Skeleton/Skeleton.js.map +1 -1
  155. package/dist/esm/Slider/Slider.styles.js +3 -3
  156. package/dist/esm/Slider/Slider.styles.js.map +1 -1
  157. package/dist/esm/Slider/SliderInput/SliderInput.js +3 -4
  158. package/dist/esm/Slider/SliderInput/SliderInput.js.map +1 -1
  159. package/dist/esm/Slider/SliderInput/SliderInput.styles.js +9 -3
  160. package/dist/esm/Slider/SliderInput/SliderInput.styles.js.map +1 -1
  161. package/dist/esm/Table/TableHeader/TableHeader.js +0 -1
  162. package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
  163. package/dist/esm/Tag/Tag.js +20 -11
  164. package/dist/esm/Tag/Tag.js.map +1 -1
  165. package/dist/esm/Tag/Tag.styles.js +35 -8
  166. package/dist/esm/Tag/Tag.styles.js.map +1 -1
  167. package/dist/esm/TimePicker/TimePicker.styles.js +1 -1
  168. package/dist/esm/TimePicker/TimePicker.styles.js.map +1 -1
  169. package/dist/esm/Tooltip/Tooltip.styles.js +1 -1
  170. package/dist/esm/Tooltip/Tooltip.styles.js.map +1 -1
  171. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js +1 -1
  172. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
  173. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +1 -1
  174. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
  175. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js +1 -0
  176. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
  177. package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js +2 -2
  178. package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
  179. package/dist/esm/index.js +1 -2
  180. package/dist/esm/utils/Callout.js +1 -1
  181. package/dist/esm/utils/Callout.js.map +1 -1
  182. package/dist/types/index.d.ts +35 -25
  183. package/package.json +6 -6
@@ -83,11 +83,11 @@ const HvDropDownMenu = forwardRef(function HvDropDownMenu2(props, ref) {
83
83
  {
84
84
  ref,
85
85
  id,
86
- className: cx(classes.container, classes.icon, className, {
86
+ className: cx(classes.root, classes.container, classes.icon, className, {
87
87
  [classes.iconSelected]: open
88
+ // TODO: rename to open
88
89
  }),
89
90
  classes: {
90
- root: classes.root,
91
91
  container: classes.baseContainer,
92
92
  panel: classes.menuListRoot
93
93
  },
@@ -1 +1 @@
1
- {"version":3,"file":"DropDownMenu.js","sources":["../../../src/DropDownMenu/DropDownMenu.tsx"],"sourcesContent":["import { forwardRef, useMemo } from \"react\";\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { HvSize } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseDropdown } from \"../BaseDropdown\";\nimport { useBaseDropdownContext } from \"../BaseDropdown/context\";\nimport { HvButtonVariant } from \"../Button\";\nimport { HvDropdownButton, HvDropdownButtonProps } from \"../DropdownButton\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useLabels } from \"../hooks/useLabels\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { HvList, HvListProps, HvListValue } from \"../List\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { getPrevNextFocus } from \"../utils/focusableElementFinder\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./DropDownMenu.styles\";\n\nexport { staticClasses as dropDownMenuClasses };\n\nexport type HvDropDownMenuClasses = ExtractNames<typeof useClasses>;\n\nconst DEFAULT_LABELS = {\n dropdownMenu: \"Dropdown menu\",\n};\n\nexport interface HvDropDownMenuProps\n extends HvBaseProps<HTMLDivElement, \"onClick\" | \"onToggle\"> {\n /** Icon. */\n icon?: React.ReactElement;\n /**\n * A list containing the elements to be rendered.\n *\n * - label: The label of the element to be rendered.\n * - selected: The selection state of the element.\n * - disabled: The disabled state of the element.\n * - icon: The icon node to be rendered on the left.\n * - showNavIcon: If true renders the navigation icon on the right.\n */\n dataList: HvListValue[];\n /** Placement of the dropdown. */\n placement?: \"left\" | \"right\";\n /** Disable the portal behavior. The children stay within it's parent DOM hierarchy. */\n disablePortal?: boolean;\n /** Function executed on toggle of the dropdown. Should receive the open status. */\n onToggle?: (\n event:\n | Event\n | React.KeyboardEvent<HTMLUListElement>\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLIElement>,\n open: boolean,\n ) => void;\n /** Function executed in each onClick. Should received the clicked element. */\n onClick?: (\n event:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLIElement>,\n value: HvListValue,\n ) => void;\n /** Keep the Dropdown Menu opened after clicking one option */\n keepOpened?: boolean;\n /** Defines if the component is disabled. */\n disabled?: boolean;\n /** If true it should be displayed open. */\n expanded?: boolean;\n /** When uncontrolled, defines the initial expanded state. */\n defaultExpanded?: boolean;\n /**\n * The variant to be used in the header.\n * @deprecated Use `variant` instead\n */\n category?: HvButtonVariant;\n /** The variant to be used in the header. */\n variant?: HvButtonVariant;\n /** Button size. */\n size?: HvSize;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvDropDownMenuClasses;\n /** An object containing all the labels. */\n labels?: Partial<typeof DEFAULT_LABELS>;\n}\n\nconst HeaderComponent = forwardRef<HTMLButtonElement, HvDropdownButtonProps>(\n function HeaderComponent(props, ref) {\n const { open, icon, disabled, ...others } = props;\n const { popperPlacement } = useBaseDropdownContext();\n\n return (\n <HvDropdownButton\n icon\n ref={ref}\n open={open}\n disabled={disabled}\n aria-expanded={open}\n aria-haspopup=\"menu\"\n placement={popperPlacement}\n {...others}\n >\n {icon || <MoreOptionsVertical role=\"presentation\" />}\n </HvDropdownButton>\n );\n },\n);\n\n/**\n * A dropdown menu is a graphical control element, similar to a list box, that allows the user to choose a value from a list.\n */\nexport const HvDropDownMenu = forwardRef<\n React.ComponentRef<typeof HvBaseDropdown>,\n HvDropDownMenuProps\n>(function HvDropDownMenu(props, ref) {\n const {\n id: idProp,\n classes: classesProp,\n className,\n icon,\n placement = \"right\",\n dataList,\n disablePortal = false,\n onToggle,\n onClick,\n keepOpened = true,\n disabled = false,\n expanded,\n defaultExpanded = false,\n category = \"secondaryGhost\", // TODO - remove and update variant default in v6\n variant,\n size = \"md\",\n labels: labelsProp,\n ...others\n } = useDefaultProps(\"HvDropDownMenu\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n\n const [open, setOpen] = useControlled(expanded, Boolean(defaultExpanded));\n const id = useUniqueId(idProp);\n\n const listId = setId(id, \"list\");\n\n const handleClose = (\n event:\n | React.KeyboardEvent<HTMLUListElement>\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLIElement>,\n ) => {\n // this will only run if uncontrolled\n setOpen(false);\n onToggle?.(event, false);\n };\n\n // If the ESCAPE key is pressed inside the list, the close handler must be called.\n const handleKeyDown: HvListProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"Tab\")) {\n const focusNodes = getPrevNextFocus(setId(id, \"icon-button\"));\n const node = event.shiftKey ? focusNodes.prevFocus : focusNodes.nextFocus;\n if (node) setTimeout(() => node.focus(), 0);\n handleClose(event);\n }\n event.preventDefault();\n };\n\n const condensed = useMemo(() => dataList.every((el) => !el.icon), [dataList]);\n\n return (\n <HvBaseDropdown\n ref={ref}\n id={id}\n className={cx(classes.container, classes.icon, className, {\n [classes.iconSelected]: open,\n })}\n classes={{\n root: classes.root,\n container: classes.baseContainer,\n panel: classes.menuListRoot,\n }}\n expanded={open && !disabled}\n headerComponent={HeaderComponent}\n // @ts-expect-error infer HeaderComponent typings\n size={size}\n variant={variant ?? category}\n open={open}\n aria-label={labels.dropdownMenu}\n icon={icon}\n placement={placement}\n variableWidth\n disablePortal={disablePortal}\n onToggle={(e, s) => {\n // this will only run if uncontrolled\n setOpen(s);\n onToggle?.(e, s);\n }}\n disabled={disabled}\n onContainerCreation={(containerEl) => {\n containerEl?.getElementsByTagName(\"li\")[0]?.focus();\n }}\n {...others}\n >\n <HvList\n id={listId}\n values={dataList}\n selectable={false}\n condensed={condensed}\n onClick={(event, item) => {\n if (!keepOpened) handleClose(event);\n onClick?.(event, item);\n }}\n onKeyDown={handleKeyDown}\n classes={{\n root: classes.menuList,\n }}\n />\n </HvBaseDropdown>\n );\n});\n"],"names":["HeaderComponent","HvDropDownMenu"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAM,iBAAiB;AAAA,EACrB,cAAc;AAChB;AA2DA,MAAM,kBAAkB;AAAA,EACtB,SAASA,iBAAgB,OAAO,KAAK;AACnC,UAAM,EAAE,MAAM,MAAM,UAAU,GAAG,OAAW,IAAA;AACtC,UAAA,EAAE,gBAAgB,IAAI,uBAAuB;AAGjD,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAI;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,iBAAe;AAAA,QACf,iBAAc;AAAA,QACd,WAAW;AAAA,QACV,GAAG;AAAA,QAEH,UAAQ,QAAA,oBAAC,qBAAoB,EAAA,MAAK,eAAe,CAAA;AAAA,MAAA;AAAA,IACpD;AAAA,EAAA;AAGN;AAKO,MAAM,iBAAiB,WAG5B,SAASC,gBAAe,OAAO,KAAK;AAC9B,QAAA;AAAA,IACJ,IAAI;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,WAAW;AAAA,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;AAAA,MACnB;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA,UAAU,CAAC,GAAG,MAAM;AAElB,gBAAQ,CAAC;AACT,mBAAW,GAAG,CAAC;AAAA,MACjB;AAAA,MACA;AAAA,MACA,qBAAqB,CAAC,gBAAgB;AACpC,qBAAa,qBAAqB,IAAI,EAAE,CAAC,GAAG,MAAM;AAAA,MACpD;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI;AAAA,UACJ,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ;AAAA,UACA,SAAS,CAAC,OAAO,SAAS;AACpB,gBAAA,CAAC,WAAY,aAAY,KAAK;AAClC,sBAAU,OAAO,IAAI;AAAA,UACvB;AAAA,UACA,WAAW;AAAA,UACX,SAAS;AAAA,YACP,MAAM,QAAQ;AAAA,UAAA;AAAA,QAChB;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"DropDownMenu.js","sources":["../../../src/DropDownMenu/DropDownMenu.tsx"],"sourcesContent":["import { forwardRef, useMemo } from \"react\";\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { HvSize } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseDropdown } from \"../BaseDropdown\";\nimport { useBaseDropdownContext } from \"../BaseDropdown/context\";\nimport { HvButtonVariant } from \"../Button\";\nimport { HvDropdownButton, HvDropdownButtonProps } from \"../DropdownButton\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useLabels } from \"../hooks/useLabels\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { HvList, HvListProps, HvListValue } from \"../List\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { getPrevNextFocus } from \"../utils/focusableElementFinder\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./DropDownMenu.styles\";\n\nexport { staticClasses as dropDownMenuClasses };\n\nexport type HvDropDownMenuClasses = ExtractNames<typeof useClasses>;\n\nconst DEFAULT_LABELS = {\n dropdownMenu: \"Dropdown menu\",\n};\n\nexport interface HvDropDownMenuProps\n extends HvBaseProps<HTMLDivElement, \"onClick\" | \"onToggle\"> {\n /** Icon. */\n icon?: React.ReactElement;\n /**\n * A list containing the elements to be rendered.\n *\n * - label: The label of the element to be rendered.\n * - selected: The selection state of the element.\n * - disabled: The disabled state of the element.\n * - icon: The icon node to be rendered on the left.\n * - showNavIcon: If true renders the navigation icon on the right.\n */\n dataList: HvListValue[];\n /** Placement of the dropdown. */\n placement?: \"left\" | \"right\";\n /** Disable the portal behavior. The children stay within it's parent DOM hierarchy. */\n disablePortal?: boolean;\n /** Function executed on toggle of the dropdown. Should receive the open status. */\n onToggle?: (\n event:\n | Event\n | React.KeyboardEvent<HTMLUListElement>\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLIElement>,\n open: boolean,\n ) => void;\n /** Function executed in each onClick. Should received the clicked element. */\n onClick?: (\n event:\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLIElement>,\n value: HvListValue,\n ) => void;\n /** Keep the Dropdown Menu opened after clicking one option */\n keepOpened?: boolean;\n /** Defines if the component is disabled. */\n disabled?: boolean;\n /** If true it should be displayed open. */\n expanded?: boolean;\n /** When uncontrolled, defines the initial expanded state. */\n defaultExpanded?: boolean;\n /**\n * The variant to be used in the header.\n * @deprecated Use `variant` instead\n */\n category?: HvButtonVariant;\n /** The variant to be used in the header. */\n variant?: HvButtonVariant;\n /** Button size. */\n size?: HvSize;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvDropDownMenuClasses;\n /** An object containing all the labels. */\n labels?: Partial<typeof DEFAULT_LABELS>;\n}\n\nconst HeaderComponent = forwardRef<HTMLButtonElement, HvDropdownButtonProps>(\n function HeaderComponent(props, ref) {\n const { open, icon, disabled, ...others } = props;\n const { popperPlacement } = useBaseDropdownContext();\n\n return (\n <HvDropdownButton\n icon\n ref={ref}\n open={open}\n disabled={disabled}\n aria-expanded={open}\n aria-haspopup=\"menu\"\n placement={popperPlacement}\n {...others}\n >\n {icon || <MoreOptionsVertical role=\"presentation\" />}\n </HvDropdownButton>\n );\n },\n);\n\n/**\n * A dropdown menu is a graphical control element, similar to a list box, that allows the user to choose a value from a list.\n */\nexport const HvDropDownMenu = forwardRef<\n React.ComponentRef<typeof HvBaseDropdown>,\n HvDropDownMenuProps\n>(function HvDropDownMenu(props, ref) {\n const {\n id: idProp,\n classes: classesProp,\n className,\n icon,\n placement = \"right\",\n dataList,\n disablePortal = false,\n onToggle,\n onClick,\n keepOpened = true,\n disabled = false,\n expanded,\n defaultExpanded = false,\n category = \"secondaryGhost\", // TODO - remove and update variant default in v6\n variant,\n size = \"md\",\n labels: labelsProp,\n ...others\n } = useDefaultProps(\"HvDropDownMenu\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n\n const [open, setOpen] = useControlled(expanded, Boolean(defaultExpanded));\n const id = useUniqueId(idProp);\n\n const listId = setId(id, \"list\");\n\n const handleClose = (\n event:\n | React.KeyboardEvent<HTMLUListElement>\n | React.ChangeEvent<HTMLInputElement>\n | React.MouseEvent<HTMLLIElement>,\n ) => {\n // this will only run if uncontrolled\n setOpen(false);\n onToggle?.(event, false);\n };\n\n // If the ESCAPE key is pressed inside the list, the close handler must be called.\n const handleKeyDown: HvListProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"Tab\")) {\n const focusNodes = getPrevNextFocus(setId(id, \"icon-button\"));\n const node = event.shiftKey ? focusNodes.prevFocus : focusNodes.nextFocus;\n if (node) setTimeout(() => node.focus(), 0);\n handleClose(event);\n }\n event.preventDefault();\n };\n\n const condensed = useMemo(() => dataList.every((el) => !el.icon), [dataList]);\n\n return (\n <HvBaseDropdown\n ref={ref}\n id={id}\n className={cx(classes.root, classes.container, classes.icon, className, {\n [classes.iconSelected]: open, // TODO: rename to open\n })}\n classes={{\n container: classes.baseContainer,\n panel: classes.menuListRoot,\n }}\n expanded={open && !disabled}\n headerComponent={HeaderComponent}\n // @ts-expect-error infer HeaderComponent typings\n size={size}\n variant={variant ?? category}\n open={open}\n aria-label={labels.dropdownMenu}\n icon={icon}\n placement={placement}\n variableWidth\n disablePortal={disablePortal}\n onToggle={(e, s) => {\n // this will only run if uncontrolled\n setOpen(s);\n onToggle?.(e, s);\n }}\n disabled={disabled}\n onContainerCreation={(containerEl) => {\n containerEl?.getElementsByTagName(\"li\")[0]?.focus();\n }}\n {...others}\n >\n <HvList\n id={listId}\n values={dataList}\n selectable={false}\n condensed={condensed}\n onClick={(event, item) => {\n if (!keepOpened) handleClose(event);\n onClick?.(event, item);\n }}\n onKeyDown={handleKeyDown}\n classes={{\n root: classes.menuList,\n }}\n />\n </HvBaseDropdown>\n );\n});\n"],"names":["HeaderComponent","HvDropDownMenu"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAM,iBAAiB;AAAA,EACrB,cAAc;AAChB;AA2DA,MAAM,kBAAkB;AAAA,EACtB,SAASA,iBAAgB,OAAO,KAAK;AACnC,UAAM,EAAE,MAAM,MAAM,UAAU,GAAG,OAAW,IAAA;AACtC,UAAA,EAAE,gBAAgB,IAAI,uBAAuB;AAGjD,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAI;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,iBAAe;AAAA,QACf,iBAAc;AAAA,QACd,WAAW;AAAA,QACV,GAAG;AAAA,QAEH,UAAQ,QAAA,oBAAC,qBAAoB,EAAA,MAAK,eAAe,CAAA;AAAA,MAAA;AAAA,IACpD;AAAA,EAAA;AAGN;AAKO,MAAM,iBAAiB,WAG5B,SAASC,gBAAe,OAAO,KAAK;AAC9B,QAAA;AAAA,IACJ,IAAI;AAAA,I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AAQ;AAAA,MACjB;AAAA,MACA,UAAU,QAAQ,CAAC;AAAA,MACnB,iBAAiB;AAAA,MAEjB;AAAA,MACA,SAAS,WAAW;AAAA,MACpB;AAAA,MACA,cAAY,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA,UAAU,CAAC,GAAG,MAAM;AAElB,gBAAQ,CAAC;AACT,mBAAW,GAAG,CAAC;AAAA,MACjB;AAAA,MACA;AAAA,MACA,qBAAqB,CAAC,gBAAgB;AACpC,qBAAa,qBAAqB,IAAI,EAAE,CAAC,GAAG,MAAM;AAAA,MACpD;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI;AAAA,UACJ,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ;AAAA,UACA,SAAS,CAAC,OAAO,SAAS;AACpB,gBAAA,CAAC,WAAY,aAAY,KAAK;AAClC,sBAAU,OAAO,IAAI;AAAA,UACvB;AAAA,UACA,WAAW;AAAA,UACX,SAAS;AAAA,YACP,MAAM,QAAQ;AAAA,UAAA;AAAA,QAChB;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ,CAAC;"}
@@ -1,25 +1,25 @@
1
1
  import { createClasses } from "@hitachivantara/uikit-react-utils";
2
2
  import { theme } from "@hitachivantara/uikit-styles";
3
3
  const { staticClasses, useClasses } = createClasses("HvDropDownMenu", {
4
+ root: {},
5
+ /** @deprecated use `classes.root` instead */
4
6
  container: {},
5
7
  baseContainer: {
8
+ "--r": theme.radii.base,
6
9
  "&[data-popper-placement=bottom-end] .HvBaseDropdown-panel": {
7
- borderRadius: `${theme.radii.base} 0 ${theme.radii.base} ${theme.radii.base}`
10
+ borderRadius: "var(--r) 0 var(--r) var(--r)"
8
11
  },
9
12
  "&[data-popper-placement=bottom-start] .HvBaseDropdown-panel": {
10
- borderRadius: `0 ${theme.radii.base} ${theme.radii.base} ${theme.radii.base}`
13
+ borderRadius: "0 var(--r) var(--r) var(--r)"
11
14
  },
12
15
  "&[data-popper-placement=top-start] .HvBaseDropdown-panel": {
13
- borderRadius: `${theme.radii.base} ${theme.radii.base} ${theme.radii.base} 0`
16
+ borderRadius: "var(--r) var(--r) var(--r) 0"
14
17
  },
15
18
  "&[data-popper-placement=top-end] .HvBaseDropdown-panel": {
16
- borderRadius: `${theme.radii.base} ${theme.radii.base} 0 ${theme.radii.base}`
19
+ borderRadius: "var(--r) var(--r) 0 var(--r)"
17
20
  }
18
21
  },
19
- root: {
20
- display: "inline-block",
21
- width: "auto"
22
- },
22
+ /** @deprecated use `classes.root` instead */
23
23
  icon: {},
24
24
  iconSelected: {
25
25
  boxShadow: theme.colors.shadow
@@ -1 +1 @@
1
- {"version":3,"file":"DropDownMenu.styles.js","sources":["../../../src/DropDownMenu/DropDownMenu.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropDownMenu\", {\n container: {},\n baseContainer: {\n \"&[data-popper-placement=bottom-end] .HvBaseDropdown-panel\": {\n borderRadius: `${theme.radii.base} 0 ${theme.radii.base} ${theme.radii.base}`,\n },\n \"&[data-popper-placement=bottom-start] .HvBaseDropdown-panel\": {\n borderRadius: `0 ${theme.radii.base} ${theme.radii.base} ${theme.radii.base}`,\n },\n \"&[data-popper-placement=top-start] .HvBaseDropdown-panel\": {\n borderRadius: `${theme.radii.base} ${theme.radii.base} ${theme.radii.base} 0`,\n },\n \"&[data-popper-placement=top-end] .HvBaseDropdown-panel\": {\n borderRadius: `${theme.radii.base} ${theme.radii.base} 0 ${theme.radii.base}`,\n },\n },\n root: {\n display: \"inline-block\",\n width: \"auto\",\n },\n icon: {},\n iconSelected: {\n boxShadow: theme.colors.shadow,\n },\n menuListRoot: {\n padding: theme.space.sm,\n },\n menuList: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,WAAW,CAAC;AAAA,EACZ,eAAe;AAAA,IACb,6DAA6D;AAAA,MAC3D,cAAc,GAAG,MAAM,MAAM,IAAI,MAAM,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,IAC7E;AAAA,IACA,+DAA+D;AAAA,MAC7D,cAAc,KAAK,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,IAC7E;AAAA,IACA,4DAA4D;AAAA,MAC1D,cAAc,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,IAC3E;AAAA,IACA,0DAA0D;AAAA,MACxD,cAAc,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI,MAAM,MAAM,MAAM,IAAI;AAAA,IAAA;AAAA,EAE/E;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EACA,MAAM,CAAC;AAAA,EACP,cAAc;AAAA,IACZ,WAAW,MAAM,OAAO;AAAA,EAC1B;AAAA,EACA,cAAc;AAAA,IACZ,SAAS,MAAM,MAAM;AAAA,EACvB;AAAA,EACA,UAAU,CAAA;AACZ,CAAC;"}
1
+ {"version":3,"file":"DropDownMenu.styles.js","sources":["../../../src/DropDownMenu/DropDownMenu.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropDownMenu\", {\n root: {},\n /** @deprecated use `classes.root` instead */\n container: {},\n baseContainer: {\n \"--r\": theme.radii.base,\n \"&[data-popper-placement=bottom-end] .HvBaseDropdown-panel\": {\n borderRadius: \"var(--r) 0 var(--r) var(--r)\",\n },\n \"&[data-popper-placement=bottom-start] .HvBaseDropdown-panel\": {\n borderRadius: \"0 var(--r) var(--r) var(--r)\",\n },\n \"&[data-popper-placement=top-start] .HvBaseDropdown-panel\": {\n borderRadius: \"var(--r) var(--r) var(--r) 0\",\n },\n \"&[data-popper-placement=top-end] .HvBaseDropdown-panel\": {\n borderRadius: \"var(--r) var(--r) 0 var(--r)\",\n },\n },\n /** @deprecated use `classes.root` instead */\n icon: {},\n iconSelected: {\n boxShadow: theme.colors.shadow,\n },\n menuListRoot: {\n padding: theme.space.sm,\n },\n menuList: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,MAAM,CAAC;AAAA;AAAA,EAEP,WAAW,CAAC;AAAA,EACZ,eAAe;AAAA,IACb,OAAO,MAAM,MAAM;AAAA,IACnB,6DAA6D;AAAA,MAC3D,cAAc;AAAA,IAChB;AAAA,IACA,+DAA+D;AAAA,MAC7D,cAAc;AAAA,IAChB;AAAA,IACA,4DAA4D;AAAA,MAC1D,cAAc;AAAA,IAChB;AAAA,IACA,0DAA0D;AAAA,MACxD,cAAc;AAAA,IAAA;AAAA,EAElB;AAAA;AAAA,EAEA,MAAM,CAAC;AAAA,EACP,cAAc;AAAA,IACZ,WAAW,MAAM,OAAO;AAAA,EAC1B;AAAA,EACA,cAAc;AAAA,IACZ,SAAS,MAAM,MAAM;AAAA,EACvB;AAAA,EACA,UAAU,CAAA;AACZ,CAAC;"}
@@ -24,14 +24,13 @@ const { staticClasses, useClasses } = createClasses("HvDropdown", {
24
24
  },
25
25
  dropdown: {
26
26
  width: "100%",
27
- borderRadius: theme.radii.base,
28
- "& $dropdownHeaderInvalid": {
29
- border: `1px solid ${theme.form.errorColor}`
30
- }
27
+ borderRadius: theme.radii.base
31
28
  },
32
29
  arrow: {},
33
30
  dropdownHeader: {},
34
- dropdownHeaderInvalid: {},
31
+ dropdownHeaderInvalid: {
32
+ borderColor: theme.form.errorColor
33
+ },
35
34
  dropdownHeaderOpen: {},
36
35
  dropdownListContainer: {},
37
36
  rootList: {},
@@ -40,7 +39,7 @@ const { staticClasses, useClasses } = createClasses("HvDropdown", {
40
39
  },
41
40
  readOnly: {
42
41
  "& $dropdownHeader": {
43
- border: `1px solid ${theme.colors.textSubtle}`,
42
+ borderColor: theme.colors.textSubtle,
44
43
  backgroundColor: theme.colors.bgContainer
45
44
  }
46
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.styles.js","sources":["../../../src/Dropdown/Dropdown.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropdown\", {\n root: {\n width: \"100%\",\n position: \"relative\",\n display: \"inline-block\",\n },\n labelContainer: { display: \"flex\", alignItems: \"flex-start\" },\n label: {},\n description: {},\n error: {},\n placeholder: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n placeholderClosed: {\n color: theme.colors.textSubtle,\n },\n selectionDisabled: {\n lineHeight: theme.space.md,\n color: theme.colors.textDisabled,\n },\n dropdown: {\n width: \"100%\",\n borderRadius: theme.radii.base,\n\n \"& $dropdownHeaderInvalid\": {\n border: `1px solid ${theme.form.errorColor}`,\n },\n },\n arrow: {},\n dropdownHeader: {},\n dropdownHeaderInvalid: {},\n dropdownHeaderOpen: {},\n dropdownListContainer: {},\n rootList: {},\n disabled: {\n color: theme.colors.textDisabled,\n },\n readOnly: {\n \"& $dropdownHeader\": {\n border: `1px solid ${theme.colors.textSubtle}`,\n backgroundColor: theme.colors.bgContainer,\n },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,EACX;AAAA,EACA,gBAAgB,EAAE,SAAS,QAAQ,YAAY,aAAa;AAAA,EAC5D,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,OAAO,CAAC;AAAA,EACR,aAAa;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,mBAAmB;AAAA,IACjB,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,mBAAmB;AAAA,IACjB,YAAY,MAAM,MAAM;AAAA,IACxB,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,cAAc,MAAM,MAAM;AAAA,IAE1B,4BAA4B;AAAA,MAC1B,QAAQ,aAAa,MAAM,KAAK,UAAU;AAAA,IAAA;AAAA,EAE9C;AAAA,EACA,OAAO,CAAC;AAAA,EACR,gBAAgB,CAAC;AAAA,EACjB,uBAAuB,CAAC;AAAA,EACxB,oBAAoB,CAAC;AAAA,EACrB,uBAAuB,CAAC;AAAA,EACxB,UAAU,CAAC;AAAA,EACX,UAAU;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,IACR,qBAAqB;AAAA,MACnB,QAAQ,aAAa,MAAM,OAAO,UAAU;AAAA,MAC5C,iBAAiB,MAAM,OAAO;AAAA,IAAA;AAAA,EAChC;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Dropdown.styles.js","sources":["../../../src/Dropdown/Dropdown.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropdown\", {\n root: {\n width: \"100%\",\n position: \"relative\",\n display: \"inline-block\",\n },\n labelContainer: { display: \"flex\", alignItems: \"flex-start\" },\n label: {},\n description: {},\n error: {},\n placeholder: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n placeholderClosed: {\n color: theme.colors.textSubtle,\n },\n selectionDisabled: {\n lineHeight: theme.space.md,\n color: theme.colors.textDisabled,\n },\n dropdown: {\n width: \"100%\",\n borderRadius: theme.radii.base,\n },\n arrow: {},\n dropdownHeader: {},\n dropdownHeaderInvalid: {\n borderColor: theme.form.errorColor,\n },\n dropdownHeaderOpen: {},\n dropdownListContainer: {},\n rootList: {},\n disabled: {\n color: theme.colors.textDisabled,\n },\n readOnly: {\n \"& $dropdownHeader\": {\n borderColor: theme.colors.textSubtle,\n backgroundColor: theme.colors.bgContainer,\n },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,EACX;AAAA,EACA,gBAAgB,EAAE,SAAS,QAAQ,YAAY,aAAa;AAAA,EAC5D,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,OAAO,CAAC;AAAA,EACR,aAAa;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,mBAAmB;AAAA,IACjB,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,mBAAmB;AAAA,IACjB,YAAY,MAAM,MAAM;AAAA,IACxB,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,cAAc,MAAM,MAAM;AAAA,EAC5B;AAAA,EACA,OAAO,CAAC;AAAA,EACR,gBAAgB,CAAC;AAAA,EACjB,uBAAuB;AAAA,IACrB,aAAa,MAAM,KAAK;AAAA,EAC1B;AAAA,EACA,oBAAoB,CAAC;AAAA,EACrB,uBAAuB,CAAC;AAAA,EACxB,UAAU,CAAC;AAAA,EACX,UAAU;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,IACR,qBAAqB;AAAA,MACnB,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB,MAAM,OAAO;AAAA,IAAA;AAAA,EAChC;AAEJ,CAAC;"}
@@ -18,7 +18,7 @@ const HvDropdownButton = forwardRef(function HvDropdownButton2(props, ref) {
18
18
  variant,
19
19
  ...others
20
20
  } = useDefaultProps("HvDropdownButton", props);
21
- const { classes, cx } = useClasses(classesProp);
21
+ const { classes, cx } = useClasses(classesProp, false);
22
22
  const endIcon = icon ? void 0 : /* @__PURE__ */ jsx(DropDownXS, { size: "XS", rotate: open });
23
23
  return /* @__PURE__ */ jsx(
24
24
  HvButton,
@@ -26,12 +26,11 @@ const HvDropdownButton = forwardRef(function HvDropdownButton2(props, ref) {
26
26
  ref,
27
27
  icon,
28
28
  disabled: disabled || readOnly,
29
+ "data-popper-placement": placement,
29
30
  className: cx(
30
31
  classes.root,
31
32
  {
32
33
  [classes.open]: open,
33
- [classes.openUp]: open && placement.includes("top"),
34
- [classes.openDown]: open && placement.includes("bottom"),
35
34
  [classes.disabled]: disabled,
36
35
  [classes.readOnly]: readOnly
37
36
  },
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownButton.js","sources":["../../../src/DropdownButton/DropdownButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { Placement } from \"@popperjs/core\";\nimport { DropDownXS } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps } from \"../Button\";\nimport { staticClasses, useClasses } from \"./DropdownButton.styles\";\n\nexport { staticClasses as dropdownButtonClasses };\n\nexport type HvDropdownButtonClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDropdownButtonProps\n extends Omit<HvButtonProps, \"startAdornment\" | \"endAdornment\" | \"classes\"> {\n /** Whether the button is in read only mode when used as a form element. */\n readOnly?: boolean;\n /** Whether the content triggered by the button is opened or not. */\n open?: boolean;\n /** Placement of the content triggered by the button. @default bottom */\n placement?: Placement;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvDropdownButtonClasses;\n}\n\n/**\n * IMPORTANT: This component is not ready to be exported to external users.\n *\n * Implements the DS dropdown button pattern.\n */\nexport const HvDropdownButton = forwardRef<\n HTMLButtonElement,\n HvDropdownButtonProps\n>(function HvDropdownButton(props, ref) {\n const {\n className,\n classes: classesProp,\n placement = \"bottom\",\n disabled,\n open,\n icon,\n readOnly,\n children,\n variant,\n ...others\n } = useDefaultProps(\"HvDropdownButton\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const endIcon = icon ? undefined : <DropDownXS size=\"XS\" rotate={open} />;\n\n return (\n <HvButton\n ref={ref}\n icon={icon}\n disabled={disabled || readOnly}\n className={cx(\n classes.root,\n {\n [classes.open]: open,\n [classes.openUp]: open && placement.includes(\"top\"),\n [classes.openDown]: open && placement.includes(\"bottom\"),\n [classes.disabled]: disabled,\n [classes.readOnly]: readOnly,\n },\n className,\n )}\n classes={{ endIcon: classes.arrowContainer }}\n endIcon={endIcon}\n variant={open ? \"secondarySubtle\" : variant}\n {...others}\n >\n <div className={cx({ [classes.selection]: !icon })}>\n {children && typeof children === \"string\" ? (\n <div className={classes.placeholder}>{children}</div>\n ) : (\n children\n )}\n </div>\n </HvButton>\n );\n});\n"],"names":["HvDropdownButton"],"mappings":";;;;;;;AAgCO,MAAM,mBAAmB,WAG9B,SAASA,kBAAiB,OAAO,KAAK;AAChC,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,oBAAoB,KAAK;AAE7C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,UAAU,OAAO,SAAY,oBAAC,cAAW,MAAK,MAAK,QAAQ,MAAM;AAGrE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,IAAI,GAAG;AAAA,UAChB,CAAC,QAAQ,MAAM,GAAG,QAAQ,UAAU,SAAS,KAAK;AAAA,UAClD,CAAC,QAAQ,QAAQ,GAAG,QAAQ,UAAU,SAAS,QAAQ;AAAA,UACvD,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACpB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAS,EAAE,SAAS,QAAQ,eAAe;AAAA,MAC3C;AAAA,MACA,SAAS,OAAO,oBAAoB;AAAA,MACnC,GAAG;AAAA,MAEJ,UAAA,oBAAC,OAAI,EAAA,WAAW,GAAG,EAAE,CAAC,QAAQ,SAAS,GAAG,CAAC,KAAM,CAAA,GAC9C,UAAY,YAAA,OAAO,aAAa,WAC9B,oBAAA,OAAA,EAAI,WAAW,QAAQ,aAAc,SAAS,CAAA,IAE/C,SAEJ,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"DropdownButton.js","sources":["../../../src/DropdownButton/DropdownButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { Placement } from \"@popperjs/core\";\nimport { DropDownXS } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps } from \"../Button\";\nimport { staticClasses, useClasses } from \"./DropdownButton.styles\";\n\nexport { staticClasses as dropdownButtonClasses };\n\nexport type HvDropdownButtonClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDropdownButtonProps\n extends Omit<HvButtonProps, \"startAdornment\" | \"endAdornment\" | \"classes\"> {\n /** Whether the button is in read only mode when used as a form element. */\n readOnly?: boolean;\n /** Whether the content triggered by the button is opened or not. */\n open?: boolean;\n /** Placement of the content triggered by the button. @default bottom */\n placement?: Placement;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvDropdownButtonClasses;\n}\n\n/**\n * IMPORTANT: This component is not ready to be exported to external users.\n *\n * Implements the DS dropdown button pattern.\n */\nexport const HvDropdownButton = forwardRef<\n HTMLButtonElement,\n HvDropdownButtonProps\n>(function HvDropdownButton(props, ref) {\n const {\n className,\n classes: classesProp,\n placement = \"bottom\",\n disabled,\n open,\n icon,\n readOnly,\n children,\n variant,\n ...others\n } = useDefaultProps(\"HvDropdownButton\", props);\n\n const { classes, cx } = useClasses(classesProp, false);\n\n const endIcon = icon ? undefined : <DropDownXS size=\"XS\" rotate={open} />;\n\n return (\n <HvButton\n ref={ref}\n icon={icon}\n disabled={disabled || readOnly}\n data-popper-placement={placement}\n className={cx(\n classes.root,\n {\n [classes.open]: open,\n [classes.disabled]: disabled,\n [classes.readOnly]: readOnly,\n },\n className,\n )}\n classes={{ endIcon: classes.arrowContainer }}\n endIcon={endIcon}\n variant={open ? \"secondarySubtle\" : variant}\n {...others}\n >\n <div className={cx({ [classes.selection]: !icon })}>\n {children && typeof children === \"string\" ? (\n <div className={classes.placeholder}>{children}</div>\n ) : (\n children\n )}\n </div>\n </HvButton>\n );\n});\n"],"names":["HvDropdownButton"],"mappings":";;;;;;;AAgCO,MAAM,mBAAmB,WAG9B,SAASA,kBAAiB,OAAO,KAAK;AAChC,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,oBAAoB,KAAK;AAE7C,QAAM,EAAE,SAAS,GAAA,IAAO,WAAW,aAAa,KAAK;AAE/C,QAAA,UAAU,OAAO,SAAY,oBAAC,cAAW,MAAK,MAAK,QAAQ,MAAM;AAGrE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,yBAAuB;AAAA,MACvB,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,IAAI,GAAG;AAAA,UAChB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACpB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAS,EAAE,SAAS,QAAQ,eAAe;AAAA,MAC3C;AAAA,MACA,SAAS,OAAO,oBAAoB;AAAA,MACnC,GAAG;AAAA,MAEJ,UAAA,oBAAC,OAAI,EAAA,WAAW,GAAG,EAAE,CAAC,QAAQ,SAAS,GAAG,CAAC,KAAM,CAAA,GAC9C,UAAY,YAAA,OAAO,aAAa,WAC9B,oBAAA,OAAA,EAAI,WAAW,QAAQ,aAAc,SAAS,CAAA,IAE/C,SAEJ,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ,CAAC;"}
@@ -3,9 +3,7 @@ import { theme } from "@hitachivantara/uikit-styles";
3
3
  import { staticClasses as staticClasses$1 } from "../Button/Button.styles.js";
4
4
  import "../Button/Button.js";
5
5
  const disabledStyle = {
6
- backgroundColor: theme.colors.bgDisabled,
7
- borderColor: theme.colors.bgDisabled,
8
- [`&.${staticClasses$1.subtle},&.${staticClasses$1.ghost}`]: {
6
+ [`&,&.${staticClasses$1.subtle},&.${staticClasses$1.ghost}`]: {
9
7
  backgroundColor: theme.colors.bgDisabled,
10
8
  borderColor: theme.colors.bgDisabled,
11
9
  "&:hover": { backgroundColor: theme.colors.bgDisabled }
@@ -30,13 +28,14 @@ const { staticClasses, useClasses } = createClasses("HvDropdownButton", {
30
28
  ...disabledStyle
31
29
  },
32
30
  open: {
33
- backgroundColor: theme.colors.bgContainer
34
- },
35
- openUp: {
36
- borderRadius: `0px 0px ${theme.radii.base} ${theme.radii.base}`
37
- },
38
- openDown: {
39
- borderRadius: `${theme.radii.base} ${theme.radii.base} 0px 0px`
31
+ "--r": theme.radii.base,
32
+ backgroundColor: theme.colors.bgContainer,
33
+ "&[data-popper-placement*='top']": {
34
+ borderRadius: "0px 0px var(--r) var(--r)"
35
+ },
36
+ "&[data-popper-placement*='bottom']": {
37
+ borderRadius: "var(--r) var(--r) 0px 0px"
38
+ }
40
39
  },
41
40
  selection: {
42
41
  color: "inherit",
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownButton.styles.js","sources":["../../../src/DropdownButton/DropdownButton.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { buttonClasses } from \"../Button\";\n\n// TODO: review override\nconst disabledStyle = {\n backgroundColor: theme.colors.bgDisabled,\n borderColor: theme.colors.bgDisabled,\n [`&.${buttonClasses.subtle},&.${buttonClasses.ghost}`]: {\n backgroundColor: theme.colors.bgDisabled,\n borderColor: theme.colors.bgDisabled,\n \"&:hover\": { backgroundColor: theme.colors.bgDisabled },\n },\n};\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropdownButton\", {\n root: {\n userSelect: \"none\",\n position: \"relative\",\n\n [`&:not(.${buttonClasses.icon})`]: {\n width: \"100%\",\n minWidth: \"unset\",\n justifyContent: \"flex-start\",\n paddingLeft: theme.space.xs,\n },\n },\n disabled: {\n ...disabledStyle,\n },\n readOnly: {\n userSelect: \"text\",\n ...disabledStyle,\n },\n open: {\n backgroundColor: theme.colors.bgContainer,\n },\n openUp: {\n borderRadius: `0px 0px ${theme.radii.base} ${theme.radii.base}`,\n },\n openDown: {\n borderRadius: `${theme.radii.base} ${theme.radii.base} 0px 0px`,\n },\n selection: {\n color: \"inherit\",\n flex: 1,\n textAlign: \"start\",\n overflow: \"auto\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n placeholder: {},\n arrowContainer: {\n marginRight: theme.spacing(-2),\n },\n});\n"],"names":["buttonClasses"],"mappings":";;;;AAMA,MAAM,gBAAgB;AAAA,EACpB,iBAAiB,MAAM,OAAO;AAAA,EAC9B,aAAa,MAAM,OAAO;AAAA,EAC1B,CAAC,KAAKA,gBAAc,MAAM,MAAMA,gBAAc,KAAK,EAAE,GAAG;AAAA,IACtD,iBAAiB,MAAM,OAAO;AAAA,IAC9B,aAAa,MAAM,OAAO;AAAA,IAC1B,WAAW,EAAE,iBAAiB,MAAM,OAAO,WAAW;AAAA,EAAA;AAE1D;AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,YAAY;AAAA,IACZ,UAAU;AAAA,IAEV,CAAC,UAAUA,gBAAc,IAAI,GAAG,GAAG;AAAA,MACjC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa,MAAM,MAAM;AAAA,IAAA;AAAA,EAE7B;AAAA,EACA,UAAU;AAAA,IACR,GAAG;AAAA,EACL;AAAA,EACA,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,GAAG;AAAA,EACL;AAAA,EACA,MAAM;AAAA,IACJ,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,QAAQ;AAAA,IACN,cAAc,WAAW,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EAC/D;AAAA,EACA,UAAU;AAAA,IACR,cAAc,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EACvD;AAAA,EACA,WAAW;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,aAAa,CAAC;AAAA,EACd,gBAAgB;AAAA,IACd,aAAa,MAAM,QAAQ,EAAE;AAAA,EAAA;AAEjC,CAAC;"}
1
+ {"version":3,"file":"DropdownButton.styles.js","sources":["../../../src/DropdownButton/DropdownButton.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { buttonClasses } from \"../Button\";\n\n// TODO: review override\nconst disabledStyle = {\n [`&,&.${buttonClasses.subtle},&.${buttonClasses.ghost}`]: {\n backgroundColor: theme.colors.bgDisabled,\n borderColor: theme.colors.bgDisabled,\n \"&:hover\": { backgroundColor: theme.colors.bgDisabled },\n },\n};\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropdownButton\", {\n root: {\n userSelect: \"none\",\n position: \"relative\",\n\n [`&:not(.${buttonClasses.icon})`]: {\n width: \"100%\",\n minWidth: \"unset\",\n justifyContent: \"flex-start\",\n paddingLeft: theme.space.xs,\n },\n },\n disabled: {\n ...disabledStyle,\n },\n readOnly: {\n userSelect: \"text\",\n ...disabledStyle,\n },\n open: {\n \"--r\": theme.radii.base,\n backgroundColor: theme.colors.bgContainer,\n \"&[data-popper-placement*='top']\": {\n borderRadius: \"0px 0px var(--r) var(--r)\",\n },\n \"&[data-popper-placement*='bottom']\": {\n borderRadius: \"var(--r) var(--r) 0px 0px\",\n },\n },\n selection: {\n color: \"inherit\",\n flex: 1,\n textAlign: \"start\",\n overflow: \"auto\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n placeholder: {},\n arrowContainer: {\n marginRight: theme.spacing(-2),\n },\n});\n"],"names":["buttonClasses"],"mappings":";;;;AAMA,MAAM,gBAAgB;AAAA,EACpB,CAAC,OAAOA,gBAAc,MAAM,MAAMA,gBAAc,KAAK,EAAE,GAAG;AAAA,IACxD,iBAAiB,MAAM,OAAO;AAAA,IAC9B,aAAa,MAAM,OAAO;AAAA,IAC1B,WAAW,EAAE,iBAAiB,MAAM,OAAO,WAAW;AAAA,EAAA;AAE1D;AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,YAAY;AAAA,IACZ,UAAU;AAAA,IAEV,CAAC,UAAUA,gBAAc,IAAI,GAAG,GAAG;AAAA,MACjC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa,MAAM,MAAM;AAAA,IAAA;AAAA,EAE7B;AAAA,EACA,UAAU;AAAA,IACR,GAAG;AAAA,EACL;AAAA,EACA,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,GAAG;AAAA,EACL;AAAA,EACA,MAAM;AAAA,IACJ,OAAO,MAAM,MAAM;AAAA,IACnB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,mCAAmC;AAAA,MACjC,cAAc;AAAA,IAChB;AAAA,IACA,sCAAsC;AAAA,MACpC,cAAc;AAAA,IAAA;AAAA,EAElB;AAAA,EACA,WAAW;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,aAAa,CAAC;AAAA,EACd,gBAAgB;AAAA,IACd,aAAa,MAAM,QAAQ,EAAE;AAAA,EAAA;AAEjC,CAAC;"}
@@ -60,8 +60,10 @@ const HvFile = (props) => {
60
60
  }
61
61
  ),
62
62
  statusIcon,
63
- /* @__PURE__ */ jsx(HvTypography, { className: classes.nameText, variant: "label", children: data.name }),
64
- /* @__PURE__ */ jsx("span", { className: classes.progressTextContainer, children: progressText }),
63
+ /* @__PURE__ */ jsxs("div", { className: classes.nameText, children: [
64
+ /* @__PURE__ */ jsx(HvTypography, { noWrap: true, variant: "label", children: data.name }),
65
+ /* @__PURE__ */ jsx("span", { className: classes.progressTextContainer, children: progressText })
66
+ ] }),
65
67
  data.preview && /* @__PURE__ */ jsx("div", { className: classes.previewContainer, children: data.preview }),
66
68
  /* @__PURE__ */ jsx(
67
69
  HvIconButton,
@@ -1 +1 @@
1
- {"version":3,"file":"File.js","sources":["../../../../src/FileUploader/File/File.tsx"],"sourcesContent":["import { Close, Fail, Success } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvIconButton } from \"../../IconButton\";\nimport { HvProgressBar } from \"../../ProgressBar\";\nimport { HvTypography } from \"../../Typography\";\nimport { convertUnits } from \"../utils\";\nimport { staticClasses, useClasses } from \"./File.styles\";\n\nexport { staticClasses as fileClasses };\n\nexport type HvFileClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFileData extends Omit<File, \"name\" | \"size\"> {\n /**\n * The file id.\n */\n id?: string;\n /**\n * The file name.\n */\n name?: string;\n /**\n * The upload status.\n */\n status?: \"progress\" | \"success\" | \"fail\";\n /**\n * The file size in bytes.\n */\n size?: number;\n /**\n * Upload progress in bytes.\n */\n progress?: number;\n /**\n * Optional node representing a preview of the uploaded file.\n */\n preview?: React.ReactNode;\n /**\n * Error message when the upload failed.\n */\n errorMessage?: string;\n}\n\nexport type HvFilesAddedEvent = (files: HvFileData[]) => void;\n\nexport type HvFileRemovedEvent = (file: HvFileData) => void;\n\nexport type HvFileProps = {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * File information to be displayed.\n */\n data: HvFileData;\n /**\n * Callback fired when file is removed from list.\n */\n onFileRemoved?: HvFileRemovedEvent;\n /**\n * Value of aria-label to apply to remove file button in file list.\n * */\n removeFileButtonLabel?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvFileClasses;\n};\n\nconst getStatusIcon = (\n classes?: HvFileClasses,\n status?: HvFileData[\"status\"],\n) => {\n switch (status) {\n case \"success\":\n return <Success className={classes?.icon} color=\"positive\" />;\n case \"fail\":\n return <Fail className={classes?.icon} color=\"negative\" />;\n default:\n return <div className={classes?.icon} />;\n }\n};\n\nconst getProgressText = (data: HvFileData, classes?: HvFileClasses) => {\n const hasFailed = data.status === \"fail\";\n const inProgress = data.status === \"progress\";\n\n return (\n <>\n {data.progress || data.size || data.errorMessage ? `\\xa0|\\xa0` : null}\n\n {inProgress && data.progress != null && (\n <HvTypography variant=\"label\">\n {`${convertUnits(data.progress)}\\xa0/\\xa0`}\n </HvTypography>\n )}\n\n {!hasFailed && data.size && (\n <HvTypography>{`${convertUnits(data.size)}`}</HvTypography>\n )}\n\n {hasFailed && data.errorMessage && (\n <HvTypography className={classes?.fail}>\n {data.errorMessage}\n </HvTypography>\n )}\n </>\n );\n};\n\nconst getProgressBarWith = ({ size, progress }: HvFileData) => {\n const width =\n progress != null && size != null ? Math.round((progress * 100) / size) : 0;\n\n return width;\n};\n\nexport const HvFile = (props: HvFileProps) => {\n const {\n classes: classesProp,\n data,\n onFileRemoved,\n removeFileButtonLabel,\n } = useDefaultProps(\"HvFile\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const hasError = data.status === \"fail\";\n\n const inProgress = data.status === \"progress\";\n\n const progressText = getProgressText(data, classes);\n\n const statusIcon = getStatusIcon(classes, data.status);\n\n const currentProgress = getProgressBarWith(data);\n\n return (\n <li className={classes.root}>\n {!hasError && inProgress && (\n <HvProgressBar\n classes={{\n root: classes.progressbar,\n progressBarContainer: cx(\n classes.progressbarContainer,\n classes.progressbarBack,\n ),\n }}\n value={currentProgress}\n hideLabel\n />\n )}\n\n {statusIcon}\n\n <HvTypography className={classes.nameText} variant=\"label\">\n {data.name}\n </HvTypography>\n\n <span className={classes.progressTextContainer}>{progressText}</span>\n\n {data.preview && (\n <div className={classes.previewContainer}>{data.preview}</div>\n )}\n\n <HvIconButton\n title={removeFileButtonLabel}\n className={classes.removeButton}\n onClick={() => onFileRemoved?.(data)}\n >\n <Close iconSize=\"XS\" />\n </HvIconButton>\n </li>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA0EA,MAAM,gBAAgB,CACpB,SACA,WACG;AACH,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,iCAAQ,SAAQ,EAAA,WAAW,SAAS,MAAM,OAAM,YAAW;AAAA,IAC7D,KAAK;AACH,iCAAQ,MAAK,EAAA,WAAW,SAAS,MAAM,OAAM,YAAW;AAAA,IAC1D;AACE,aAAQ,oBAAA,OAAA,EAAI,WAAW,SAAS,KAAM,CAAA;AAAA,EAAA;AAE5C;AAEA,MAAM,kBAAkB,CAAC,MAAkB,YAA4B;AAC/D,QAAA,YAAY,KAAK,WAAW;AAC5B,QAAA,aAAa,KAAK,WAAW;AAEnC,SAEK,qBAAA,UAAA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QAAQ,UAAU,SAAQ,SAChD,eAAK,KACR,CAAA;AAAA,IAEC,oBAAA,QAAA,EAAK,WAAW,QAAQ,uBAAwB,UAAa,cAAA;AAAA,IAE7D,KAAK,WACH,oBAAA,OAAA,EAAI,WAAW,QAAQ,kBAAmB,eAAK,QAAQ,CAAA;AAAA,IAG1D;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,QACP,WAAW,QAAQ;AAAA,QACnB,SAAS,MAAM,gBAAgB,IAAI;AAAA,QAEnC,UAAA,oBAAC,OAAM,EAAA,UAAS,KAAK,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACvB,GACF;AAEJ;"}
1
+ {"version":3,"file":"File.js","sources":["../../../../src/FileUploader/File/File.tsx"],"sourcesContent":["import { Close, Fail, Success } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvIconButton } from \"../../IconButton\";\nimport { HvProgressBar } from \"../../ProgressBar\";\nimport { HvTypography } from \"../../Typography\";\nimport { convertUnits } from \"../utils\";\nimport { staticClasses, useClasses } from \"./File.styles\";\n\nexport { staticClasses as fileClasses };\n\nexport type HvFileClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFileData extends Omit<File, \"name\" | \"size\"> {\n /**\n * The file id.\n */\n id?: string;\n /**\n * The file name.\n */\n name?: string;\n /**\n * The upload status.\n */\n status?: \"progress\" | \"success\" | \"fail\";\n /**\n * The file size in bytes.\n */\n size?: number;\n /**\n * Upload progress in bytes.\n */\n progress?: number;\n /**\n * Optional node representing a preview of the uploaded file.\n */\n preview?: React.ReactNode;\n /**\n * Error message when the upload failed.\n */\n errorMessage?: string;\n}\n\nexport type HvFilesAddedEvent = (files: HvFileData[]) => void;\n\nexport type HvFileRemovedEvent = (file: HvFileData) => void;\n\nexport type HvFileProps = {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * File information to be displayed.\n */\n data: HvFileData;\n /**\n * Callback fired when file is removed from list.\n */\n onFileRemoved?: HvFileRemovedEvent;\n /**\n * Value of aria-label to apply to remove file button in file list.\n * */\n removeFileButtonLabel?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvFileClasses;\n};\n\nconst getStatusIcon = (\n classes?: HvFileClasses,\n status?: HvFileData[\"status\"],\n) => {\n switch (status) {\n case \"success\":\n return <Success className={classes?.icon} color=\"positive\" />;\n case \"fail\":\n return <Fail className={classes?.icon} color=\"negative\" />;\n default:\n return <div className={classes?.icon} />;\n }\n};\n\nconst getProgressText = (data: HvFileData, classes?: HvFileClasses) => {\n const hasFailed = data.status === \"fail\";\n const inProgress = data.status === \"progress\";\n\n return (\n <>\n {data.progress || data.size || data.errorMessage ? `\\xa0|\\xa0` : null}\n\n {inProgress && data.progress != null && (\n <HvTypography variant=\"label\">\n {`${convertUnits(data.progress)}\\xa0/\\xa0`}\n </HvTypography>\n )}\n\n {!hasFailed && data.size && (\n <HvTypography>{`${convertUnits(data.size)}`}</HvTypography>\n )}\n\n {hasFailed && data.errorMessage && (\n <HvTypography className={classes?.fail}>\n {data.errorMessage}\n </HvTypography>\n )}\n </>\n );\n};\n\nconst getProgressBarWith = ({ size, progress }: HvFileData) => {\n const width =\n progress != null && size != null ? Math.round((progress * 100) / size) : 0;\n\n return width;\n};\n\nexport const HvFile = (props: HvFileProps) => {\n const {\n classes: classesProp,\n data,\n onFileRemoved,\n removeFileButtonLabel,\n } = useDefaultProps(\"HvFile\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const hasError = data.status === \"fail\";\n\n const inProgress = data.status === \"progress\";\n\n const progressText = getProgressText(data, classes);\n\n const statusIcon = getStatusIcon(classes, data.status);\n\n const currentProgress = getProgressBarWith(data);\n\n return (\n <li className={classes.root}>\n {!hasError && inProgress && (\n <HvProgressBar\n classes={{\n root: classes.progressbar,\n progressBarContainer: cx(\n classes.progressbarContainer,\n classes.progressbarBack,\n ),\n }}\n value={currentProgress}\n hideLabel\n />\n )}\n\n {statusIcon}\n\n <div className={classes.nameText}>\n <HvTypography noWrap variant=\"label\">\n {data.name}\n </HvTypography>\n\n <span className={classes.progressTextContainer}>{progressText}</span>\n </div>\n\n {data.preview && (\n <div className={classes.previewContainer}>{data.preview}</div>\n )}\n\n <HvIconButton\n title={removeFileButtonLabel}\n className={classes.removeButton}\n onClick={() => onFileRemoved?.(data)}\n >\n <Close iconSize=\"XS\" />\n </HvIconButton>\n </li>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA0EA,MAAM,gBAAgB,CACpB,SACA,WACG;AACH,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,iCAAQ,SAAQ,EAAA,WAAW,SAAS,MAAM,OAAM,YAAW;AAAA,IAC7D,KAAK;AACH,iCAAQ,MAAK,EAAA,WAAW,SAAS,MAAM,OAAM,YAAW;AAAA,IAC1D;AACE,aAAQ,oBAAA,OAAA,EAAI,WAAW,SAAS,KAAM,CAAA;AAAA,EAAA;AAE5C;AAEA,MAAM,kBAAkB,CAAC,MAAkB,YAA4B;AAC/D,QAAA,YAAY,KAAK,WAAW;AAC5B,QAAA,aAAa,KAAK,WAAW;AAEnC,SAEK,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA,KAAK,YAAY,KAAK,QAAQ,KAAK,eAAe,QAAc;AAAA,IAEhE,cAAc,KAAK,YAAY,QAC7B,oBAAA,cAAA,EAAa,SAAQ,SACnB,UAAG,GAAA,aAAa,KAAK,QAAQ,CAAC,OACjC;AAAA,IAGD,CAAC,aAAa,KAAK,QAClB,oBAAC,cAAc,EAAA,UAAA,GAAG,aAAa,KAAK,IAAI,CAAC,GAAG,CAAA;AAAA,IAG7C,aAAa,KAAK,gBACjB,oBAAC,gBAAa,WAAW,SAAS,MAC/B,UAAA,KAAK,aACR,CAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA,MAAM,qBAAqB,CAAC,EAAE,MAAM,eAA2B;AACvD,QAAA,QACJ,YAAY,QAAQ,QAA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"}
@@ -1,7 +1,16 @@
1
1
  import { createClasses } from "@hitachivantara/uikit-react-utils";
2
2
  import { theme } from "@hitachivantara/uikit-styles";
3
3
  const { staticClasses, useClasses } = createClasses("HvFile", {
4
- root: {},
4
+ root: {
5
+ position: "relative",
6
+ display: "flex",
7
+ gap: theme.space.xs,
8
+ alignItems: "center",
9
+ backgroundColor: theme.colors.bgContainer,
10
+ padding: theme.space.xs,
11
+ border: `1px solid ${theme.colors.border}`,
12
+ borderRadius: `0px 0px ${theme.radii.round} ${theme.radii.round}`
13
+ },
5
14
  progressbar: {
6
15
  position: "absolute",
7
16
  top: "-1px"
@@ -11,23 +20,18 @@ const { staticClasses, useClasses } = createClasses("HvFile", {
11
20
  },
12
21
  progressbarBack: {},
13
22
  nameText: {
14
- overflow: "hidden",
15
- textOverflow: "ellipsis",
16
- whiteSpace: "nowrap"
23
+ display: "flex",
24
+ alignItems: "center",
25
+ flex: 1
17
26
  },
18
27
  progressTextContainer: {
19
28
  display: "flex",
20
29
  flexGrow: 1,
21
30
  alignItems: "center"
22
31
  },
23
- removeButton: {
24
- width: 32,
25
- height: 32,
26
- margin: `0px ${theme.space.xs}`
27
- },
32
+ removeButton: {},
28
33
  previewContainer: {
29
34
  display: "flex",
30
- margin: `0px ${theme.space.xs}`,
31
35
  width: "48px",
32
36
  height: "48px",
33
37
  justifyContent: "center",
@@ -48,9 +52,7 @@ const { staticClasses, useClasses } = createClasses("HvFile", {
48
52
  }
49
53
  },
50
54
  icon: {
51
- width: 32,
52
- height: 32,
53
- margin: `0px ${theme.space.xs}`
55
+ margin: theme.space.xs
54
56
  },
55
57
  fail: {}
56
58
  });
@@ -1 +1 @@
1
- {"version":3,"file":"File.styles.js","sources":["../../../../src/FileUploader/File/File.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFile\", {\n root: {},\n progressbar: {\n position: \"absolute\",\n top: \"-1px\",\n },\n progressbarContainer: {\n height: \"4px\",\n },\n progressbarBack: {},\n nameText: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n progressTextContainer: {\n display: \"flex\",\n flexGrow: 1,\n alignItems: \"center\",\n },\n removeButton: {\n width: 32,\n height: 32,\n margin: `0px ${theme.space.xs}`,\n },\n previewContainer: {\n display: \"flex\",\n margin: `0px ${theme.space.xs}`,\n width: \"48px\",\n height: \"48px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n\n \"& span\": {\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width: \"100%\",\n height: \"100%\",\n },\n\n \"& img\": {\n width: \"40px\",\n height: \"40px\",\n objectFit: \"cover\",\n objectPosition: \"center\",\n alignSelf: \"center\",\n },\n },\n icon: {\n width: 32,\n height: 32,\n margin: `0px ${theme.space.xs}`,\n },\n fail: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,UAAU;AAAA,EACnE,MAAM,CAAC;AAAA,EACP,aAAa;AAAA,IACX,UAAU;AAAA,IACV,KAAK;AAAA,EACP;AAAA,EACA,sBAAsB;AAAA,IACpB,QAAQ;AAAA,EACV;AAAA,EACA,iBAAiB,CAAC;AAAA,EAClB,UAAU;AAAA,IACR,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,uBAAuB;AAAA,IACrB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ,OAAO,MAAM,MAAM,EAAE;AAAA,EAC/B;AAAA,EACA,kBAAkB;AAAA,IAChB,SAAS;AAAA,IACT,QAAQ,OAAO,MAAM,MAAM,EAAE;AAAA,IAC7B,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IAEZ,UAAU;AAAA,MACR,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,IAEA,SAAS;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,WAAW;AAAA,IAAA;AAAA,EAEf;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ,OAAO,MAAM,MAAM,EAAE;AAAA,EAC/B;AAAA,EACA,MAAM,CAAA;AACR,CAAC;"}
1
+ {"version":3,"file":"File.styles.js","sources":["../../../../src/FileUploader/File/File.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFile\", {\n root: {\n position: \"relative\",\n display: \"flex\",\n gap: theme.space.xs,\n alignItems: \"center\",\n backgroundColor: theme.colors.bgContainer,\n padding: theme.space.xs,\n border: `1px solid ${theme.colors.border}`,\n borderRadius: `0px 0px ${theme.radii.round} ${theme.radii.round}`,\n },\n progressbar: {\n position: \"absolute\",\n top: \"-1px\",\n },\n progressbarContainer: {\n height: \"4px\",\n },\n progressbarBack: {},\n nameText: {\n display: \"flex\",\n alignItems: \"center\",\n flex: 1,\n },\n progressTextContainer: {\n display: \"flex\",\n flexGrow: 1,\n alignItems: \"center\",\n },\n removeButton: {},\n previewContainer: {\n display: \"flex\",\n width: \"48px\",\n height: \"48px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n\n \"& span\": {\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width: \"100%\",\n height: \"100%\",\n },\n\n \"& img\": {\n width: \"40px\",\n height: \"40px\",\n objectFit: \"cover\",\n objectPosition: \"center\",\n alignSelf: \"center\",\n },\n },\n icon: {\n margin: theme.space.xs,\n },\n fail: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,UAAU;AAAA,EACnE,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,KAAK,MAAM,MAAM;AAAA,IACjB,YAAY;AAAA,IACZ,iBAAiB,MAAM,OAAO;AAAA,IAC9B,SAAS,MAAM,MAAM;AAAA,IACrB,QAAQ,aAAa,MAAM,OAAO,MAAM;AAAA,IACxC,cAAc,WAAW,MAAM,MAAM,KAAK,IAAI,MAAM,MAAM,KAAK;AAAA,EACjE;AAAA,EACA,aAAa;AAAA,IACX,UAAU;AAAA,IACV,KAAK;AAAA,EACP;AAAA,EACA,sBAAsB;AAAA,IACpB,QAAQ;AAAA,EACV;AAAA,EACA,iBAAiB,CAAC;AAAA,EAClB,UAAU;AAAA,IACR,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,uBAAuB;AAAA,IACrB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,cAAc,CAAC;AAAA,EACf,kBAAkB;AAAA,IAChB,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IAEZ,UAAU;AAAA,MACR,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,IAEA,SAAS;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,WAAW;AAAA,IAAA;AAAA,EAEf;AAAA,EACA,MAAM;AAAA,IACJ,QAAQ,MAAM,MAAM;AAAA,EACtB;AAAA,EACA,MAAM,CAAA;AACR,CAAC;"}
@@ -15,7 +15,7 @@ const HvFileList = (props) => {
15
15
  const { classes } = useClasses(classesProp);
16
16
  const hasFiles = list.length > 0;
17
17
  if (!hasFiles) return null;
18
- return /* @__PURE__ */ jsx("ul", { id: setId(id, "list"), className: classes.list, children: list.map((data) => /* @__PURE__ */ jsx(
18
+ return /* @__PURE__ */ jsx("ul", { id: setId(id, "list"), className: classes.root, children: list.map((data) => /* @__PURE__ */ jsx(
19
19
  HvFile,
20
20
  {
21
21
  classes: { root: classes?.listItem },
@@ -1 +1 @@
1
- {"version":3,"file":"FileList.js","sources":["../../../../src/FileUploader/FileList/FileList.tsx"],"sourcesContent":["import {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { setId } from \"../../utils/setId\";\nimport { HvFile, HvFileData, HvFileRemovedEvent } from \"../File\";\nimport { staticClasses, useClasses } from \"./FileList.styles\";\n\nexport { staticClasses as fileListClasses };\n\nexport type HvFileListClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFileListProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * The files to upload.\n */\n list?: HvFileData[];\n /**\n * Callback fired when file is removed from list.\n */\n onFileRemoved?: HvFileRemovedEvent;\n /**\n * Value of aria-label to apply to remove file button in FileList\n * */\n removeFileButtonLabel?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvFileListClasses;\n}\n\nexport const HvFileList = (props: HvFileListProps) => {\n const {\n id,\n classes: classesProp,\n list = [],\n removeFileButtonLabel,\n onFileRemoved,\n } = useDefaultProps(\"HvFileList\", props);\n const { classes } = useClasses(classesProp);\n\n const hasFiles = list.length > 0;\n if (!hasFiles) return null;\n\n return (\n <ul id={setId(id, \"list\")} className={classes.list}>\n {list.map((data) => (\n <HvFile\n key={data.id}\n classes={{ root: classes?.listItem }}\n data={data}\n onFileRemoved={onFileRemoved}\n removeFileButtonLabel={removeFileButtonLabel}\n />\n ))}\n </ul>\n );\n};\n"],"names":[],"mappings":";;;;;;AAoCa,MAAA,aAAa,CAAC,UAA2B;AAC9C,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,OAAO,CAAC;AAAA,IACR;AAAA,IACA;AAAA,EAAA,IACE,gBAAgB,cAAc,KAAK;AACvC,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAEpC,QAAA,WAAW,KAAK,SAAS;AAC3B,MAAA,CAAC,SAAiB,QAAA;AAEtB,SACG,oBAAA,MAAA,EAAG,IAAI,MAAM,IAAI,MAAM,GAAG,WAAW,QAAQ,MAC3C,UAAK,KAAA,IAAI,CAAC,SACT;AAAA,IAAC;AAAA,IAAA;AAAA,MAEC,SAAS,EAAE,MAAM,SAAS,SAAS;AAAA,MACnC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAJK,KAAK;AAAA,EAMb,CAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"FileList.js","sources":["../../../../src/FileUploader/FileList/FileList.tsx"],"sourcesContent":["import {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { setId } from \"../../utils/setId\";\nimport { HvFile, HvFileData, HvFileRemovedEvent } from \"../File\";\nimport { staticClasses, useClasses } from \"./FileList.styles\";\n\nexport { staticClasses as fileListClasses };\n\nexport type HvFileListClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFileListProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * The files to upload.\n */\n list?: HvFileData[];\n /**\n * Callback fired when file is removed from list.\n */\n onFileRemoved?: HvFileRemovedEvent;\n /**\n * Value of aria-label to apply to remove file button in FileList\n * */\n removeFileButtonLabel?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvFileListClasses;\n}\n\nexport const HvFileList = (props: HvFileListProps) => {\n const {\n id,\n classes: classesProp,\n list = [],\n removeFileButtonLabel,\n onFileRemoved,\n } = useDefaultProps(\"HvFileList\", props);\n const { classes } = useClasses(classesProp);\n\n const hasFiles = list.length > 0;\n if (!hasFiles) return null;\n\n return (\n <ul id={setId(id, \"list\")} className={classes.root}>\n {list.map((data) => (\n <HvFile\n key={data.id}\n classes={{ root: classes?.listItem }}\n data={data}\n onFileRemoved={onFileRemoved}\n removeFileButtonLabel={removeFileButtonLabel}\n />\n ))}\n </ul>\n );\n};\n"],"names":[],"mappings":";;;;;;AAoCa,MAAA,aAAa,CAAC,UAA2B;AAC9C,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,OAAO,CAAC;AAAA,IACR;AAAA,IACA;AAAA,EAAA,IACE,gBAAgB,cAAc,KAAK;AACvC,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAEpC,QAAA,WAAW,KAAK,SAAS;AAC3B,MAAA,CAAC,SAAiB,QAAA;AAEtB,SACG,oBAAA,MAAA,EAAG,IAAI,MAAM,IAAI,MAAM,GAAG,WAAW,QAAQ,MAC3C,UAAK,KAAA,IAAI,CAAC,SACT;AAAA,IAAC;AAAA,IAAA;AAAA,MAEC,SAAS,EAAE,MAAM,SAAS,SAAS;AAAA,MACnC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAJK,KAAK;AAAA,EAMb,CAAA,GACH;AAEJ;"}
@@ -1,7 +1,7 @@
1
1
  import { createClasses } from "@hitachivantara/uikit-react-utils";
2
2
  import { theme } from "@hitachivantara/uikit-styles";
3
3
  const { staticClasses, useClasses } = createClasses("HvFileList", {
4
- list: {
4
+ root: {
5
5
  display: "flex",
6
6
  flexDirection: "column",
7
7
  gap: theme.space.xs,
@@ -10,15 +10,7 @@ const { staticClasses, useClasses } = createClasses("HvFileList", {
10
10
  marginTop: theme.space.sm,
11
11
  listStyle: "none"
12
12
  },
13
- listItem: {
14
- position: "relative",
15
- display: "flex",
16
- alignItems: "center",
17
- background: theme.colors.bgContainer,
18
- padding: `${theme.space.xs} 0px`,
19
- border: `1px solid ${theme.colors.border}`,
20
- borderRadius: `0px 0px ${theme.radii.round} ${theme.radii.round}`
21
- }
13
+ listItem: {}
22
14
  });
23
15
  export {
24
16
  staticClasses,
@@ -1 +1 @@
1
- {"version":3,"file":"FileList.styles.js","sources":["../../../../src/FileUploader/FileList/FileList.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFileList\", {\n list: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: theme.space.xs,\n margin: 0,\n padding: 0,\n marginTop: theme.space.sm,\n listStyle: \"none\",\n },\n listItem: {\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n background: theme.colors.bgContainer,\n padding: `${theme.space.xs} 0px`,\n border: `1px solid ${theme.colors.border}`,\n borderRadius: `0px 0px ${theme.radii.round} ${theme.radii.round}`,\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,eAAe;AAAA,IACf,KAAK,MAAM,MAAM;AAAA,IACjB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW,MAAM,MAAM;AAAA,IACvB,WAAW;AAAA,EACb;AAAA,EACA,UAAU;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,YAAY,MAAM,OAAO;AAAA,IACzB,SAAS,GAAG,MAAM,MAAM,EAAE;AAAA,IAC1B,QAAQ,aAAa,MAAM,OAAO,MAAM;AAAA,IACxC,cAAc,WAAW,MAAM,MAAM,KAAK,IAAI,MAAM,MAAM,KAAK;AAAA,EAAA;AAEnE,CAAC;"}
1
+ {"version":3,"file":"FileList.styles.js","sources":["../../../../src/FileUploader/FileList/FileList.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFileList\", {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: theme.space.xs,\n margin: 0,\n padding: 0,\n marginTop: theme.space.sm,\n listStyle: \"none\",\n },\n listItem: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,eAAe;AAAA,IACf,KAAK,MAAM,MAAM;AAAA,IACjB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW,MAAM,MAAM;AAAA,IACvB,WAAW;AAAA,EACb;AAAA,EACA,UAAU,CAAA;AACZ,CAAC;"}
@@ -5,7 +5,8 @@ const { staticClasses, useClasses } = createClasses("HvFooter", {
5
5
  display: "flex",
6
6
  alignItems: "center",
7
7
  flexDirection: "row",
8
- padding: `${theme.space.xs} ${theme.space.sm}`,
8
+ gap: theme.space.xs,
9
+ padding: theme.spacing("xs", "sm"),
9
10
  height: 40,
10
11
  bottom: 0,
11
12
  zIndex: theme.zIndices.base,
@@ -24,7 +25,7 @@ const { staticClasses, useClasses } = createClasses("HvFooter", {
24
25
  width: 1,
25
26
  height: 16,
26
27
  backgroundColor: theme.colors.text,
27
- margin: `${theme.space.xs} ${theme.space.sm}`
28
+ margin: theme.spacing("xs", "sm")
28
29
  },
29
30
  small: {
30
31
  "&$root": {
@@ -32,17 +33,8 @@ const { staticClasses, useClasses } = createClasses("HvFooter", {
32
33
  flexDirection: "column",
33
34
  padding: theme.space.xs
34
35
  },
35
- "& $name": {
36
- marginBottom: theme.space.xs
37
- },
38
36
  "& $rightContainer": {
39
- flexDirection: "column",
40
- textAlign: "center",
41
- marginLeft: "unset"
42
- },
43
- "& $copyright": {
44
- flexDirection: "column",
45
- marginBottom: theme.space.xs
37
+ display: "contents"
46
38
  },
47
39
  "& $separator": { display: "none" }
48
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Footer.styles.js","sources":["../../../src/Footer/Footer.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFooter\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n flexDirection: \"row\",\n padding: `${theme.space.xs} ${theme.space.sm}`,\n height: 40,\n bottom: 0,\n zIndex: theme.zIndices.base,\n backgroundColor: theme.colors.bgContainer,\n boxShadow: `0 -1px 0 ${theme.colors.border}`,\n },\n name: {},\n rightContainer: {\n display: \"flex\",\n alignItems: \"center\",\n flexDirection: \"row\",\n marginLeft: \"auto\",\n },\n copyright: {},\n separator: {\n width: 1,\n height: 16,\n backgroundColor: theme.colors.text,\n margin: `${theme.space.xs} ${theme.space.sm}`,\n },\n small: {\n \"&$root\": {\n height: \"unset\",\n flexDirection: \"column\",\n padding: theme.space.xs,\n },\n \"& $name\": {\n marginBottom: theme.space.xs,\n },\n \"& $rightContainer\": {\n flexDirection: \"column\",\n textAlign: \"center\",\n marginLeft: \"unset\",\n },\n \"& $copyright\": {\n flexDirection: \"column\",\n marginBottom: theme.space.xs,\n },\n \"& $separator\": { display: \"none\" },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,SAAS,GAAG,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,EAAE;AAAA,IAC5C,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ,MAAM,SAAS;AAAA,IACvB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW,YAAY,MAAM,OAAO,MAAM;AAAA,EAC5C;AAAA,EACA,MAAM,CAAC;AAAA,EACP,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,WAAW;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,IAC9B,QAAQ,GAAG,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,EAAE;AAAA,EAC7C;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,SAAS,MAAM,MAAM;AAAA,IACvB;AAAA,IACA,WAAW;AAAA,MACT,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,qBAAqB;AAAA,MACnB,eAAe;AAAA,MACf,WAAW;AAAA,MACX,YAAY;AAAA,IACd;AAAA,IACA,gBAAgB;AAAA,MACd,eAAe;AAAA,MACf,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,gBAAgB,EAAE,SAAS,OAAO;AAAA,EAAA;AAEtC,CAAC;"}
1
+ {"version":3,"file":"Footer.styles.js","sources":["../../../src/Footer/Footer.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFooter\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n flexDirection: \"row\",\n gap: theme.space.xs,\n padding: theme.spacing(\"xs\", \"sm\"),\n height: 40,\n bottom: 0,\n zIndex: theme.zIndices.base,\n backgroundColor: theme.colors.bgContainer,\n boxShadow: `0 -1px 0 ${theme.colors.border}`,\n },\n name: {},\n rightContainer: {\n display: \"flex\",\n alignItems: \"center\",\n flexDirection: \"row\",\n marginLeft: \"auto\",\n },\n copyright: {},\n separator: {\n width: 1,\n height: 16,\n backgroundColor: theme.colors.text,\n margin: theme.spacing(\"xs\", \"sm\"),\n },\n small: {\n \"&$root\": {\n height: \"unset\",\n flexDirection: \"column\",\n padding: theme.space.xs,\n },\n \"& $rightContainer\": {\n display: \"contents\",\n },\n \"& $separator\": { display: \"none\" },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,KAAK,MAAM,MAAM;AAAA,IACjB,SAAS,MAAM,QAAQ,MAAM,IAAI;AAAA,IACjC,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ,MAAM,SAAS;AAAA,IACvB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW,YAAY,MAAM,OAAO,MAAM;AAAA,EAC5C;AAAA,EACA,MAAM,CAAC;AAAA,EACP,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,WAAW;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,IAC9B,QAAQ,MAAM,QAAQ,MAAM,IAAI;AAAA,EAClC;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,SAAS,MAAM,MAAM;AAAA,IACvB;AAAA,IACA,qBAAqB;AAAA,MACnB,SAAS;AAAA,IACX;AAAA,IACA,gBAAgB,EAAE,SAAS,OAAO;AAAA,EAAA;AAEtC,CAAC;"}
@@ -18,7 +18,7 @@ const { staticClasses, useClasses } = createClasses("HvHeader", {
18
18
  alignItems: "center",
19
19
  width: "100%",
20
20
  height: "100%",
21
- padding: `0 ${theme.space.sm}`,
21
+ padding: theme.spacing(0, "sm"),
22
22
  "& > *:not(nav)": {
23
23
  zIndex: 2
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Header.styles.js","sources":["../../../src/Header/Header.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvHeader\", {\n root: {\n height: theme.header.height,\n backgroundColor: theme.colors.bgContainer,\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n boxSizing: \"border-box\",\n flexShrink: 0,\n zIndex: theme.zIndices.banner,\n borderTop: \"none\",\n boxShadow: theme.colors.shadow,\n },\n header: {\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n height: \"100%\",\n padding: `0 ${theme.space.sm}`,\n \"& > *:not(nav)\": {\n zIndex: 2,\n },\n },\n fixed: { position: \"fixed\", top: 0, left: \"auto\", right: 0 },\n backgroundColor: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,QAAQ,MAAM,OAAO;AAAA,IACrB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,IACP,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,QAAQ,MAAM,SAAS;AAAA,IACvB,WAAW;AAAA,IACX,WAAW,MAAM,OAAO;AAAA,EAC1B;AAAA,EACA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,KAAK,MAAM,MAAM,EAAE;AAAA,IAC5B,kBAAkB;AAAA,MAChB,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,OAAO,EAAE,UAAU,SAAS,KAAK,GAAG,MAAM,QAAQ,OAAO,EAAE;AAAA,EAC3D,iBAAiB,CAAA;AACnB,CAAC;"}
1
+ {"version":3,"file":"Header.styles.js","sources":["../../../src/Header/Header.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvHeader\", {\n root: {\n height: theme.header.height,\n backgroundColor: theme.colors.bgContainer,\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n boxSizing: \"border-box\",\n flexShrink: 0,\n zIndex: theme.zIndices.banner,\n borderTop: \"none\",\n boxShadow: theme.colors.shadow,\n },\n header: {\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n height: \"100%\",\n padding: theme.spacing(0, \"sm\"),\n \"& > *:not(nav)\": {\n zIndex: 2,\n },\n },\n fixed: { position: \"fixed\", top: 0, left: \"auto\", right: 0 },\n backgroundColor: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,QAAQ,MAAM,OAAO;AAAA,IACrB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,IACP,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,QAAQ,MAAM,SAAS;AAAA,IACvB,WAAW;AAAA,IACX,WAAW,MAAM,OAAO;AAAA,EAC1B;AAAA,EACA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,MAAM,QAAQ,GAAG,IAAI;AAAA,IAC9B,kBAAkB;AAAA,MAChB,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,OAAO,EAAE,UAAU,SAAS,KAAK,GAAG,MAAM,QAAQ,OAAO,EAAE;AAAA,EAC3D,iBAAiB,CAAA;AACnB,CAAC;"}
@@ -98,7 +98,6 @@ const HvInlineEditor = fixedForwardRef(function HvInlineEditor2(props, ref) {
98
98
  HvButton,
99
99
  {
100
100
  variant: "secondaryGhost",
101
- overrideIconColors: false,
102
101
  endIcon: /* @__PURE__ */ jsx(
103
102
  Edit,
104
103
  {
@@ -1 +1 @@
1
- {"version":3,"file":"InlineEditor.js","sources":["../../../src/InlineEditor/InlineEditor.tsx"],"sourcesContent":["import { useRef, useState } from \"react\";\nimport { Edit } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n useTheme,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps } from \"../Button\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useEnhancedEffect } from \"../hooks/useEnhancedEffect\";\nimport { HvInput, HvInputProps } from \"../Input\";\nimport { HvTooltip } from \"../Tooltip\";\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport {\n HvTypography,\n HvTypographyProps,\n HvTypographyVariants,\n} from \"../Typography\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { staticClasses, useClasses } from \"./InlineEditor.styles\";\n\nexport { staticClasses as inlineEditorClasses };\n\nexport type HvInlineEditorClasses = ExtractNames<typeof useClasses>;\n\nexport type HvInlineEditorProps<C extends React.ElementType = typeof HvInput> =\n PolymorphicComponentRef<\n C,\n {\n /** The value of the form element. */\n value?: string;\n /** The default value of the form element. */\n defaultValue?: string;\n /** Whether the Edit icon should always be visible */\n showIcon?: boolean;\n /** Variant of the HvTypography to display */\n variant?: HvTypographyVariants;\n /** Called when the input is blurred. */\n onBlur?: (\n event: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>,\n value: string,\n ) => void;\n /** Called when the input value changes. */\n onChange?: (event: React.SyntheticEvent, value: string) => void;\n /** Called when there's a keydown event on the input. */\n onKeyDown?: (\n event:\n | React.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement>\n | React.MouseEvent,\n value: string,\n ) => void;\n /** Props passed to the HvButton component */\n buttonProps?: HvButtonProps;\n /** Props passed to the HvTypography text component */\n typographyProps?: HvTypographyProps;\n /** Whether the editor is disabled or not. */\n disabled?: boolean;\n /** A Jss Object used to override or extend the styles applied to the empty state component. */\n classes?: HvInlineEditorClasses;\n /** The placeholder value of the input. */\n placeholder?: string;\n }\n >;\n\n/**\n * An Inline Editor allows the user to edit a record without making a major switch\n * between viewing and editing, making it an efficient method of updating a record.\n */\nexport const HvInlineEditor = fixedForwardRef(function HvInlineEditor<\n C extends React.ElementType = typeof HvInput,\n>(props: HvInlineEditorProps<C>, ref: PolymorphicRef<C>) {\n const {\n className,\n classes: classesProp,\n value: valueProp,\n defaultValue = \"\",\n showIcon,\n component: InputComponent = HvInput,\n variant = \"body\",\n placeholder = \"Enter text\",\n onBlur,\n onChange,\n onKeyDown,\n buttonProps,\n typographyProps,\n disabled,\n ...others\n } = useDefaultProps(\"HvInlineEditor\", props);\n\n const { classes, cx } = useClasses(classesProp);\n const [value, setValue] = useControlled(valueProp, defaultValue);\n const [editMode, setEditMode] = useState(false);\n const [cachedValue, setCachedValue] = useState(value);\n const inputRef = useRef<HTMLInputElement>();\n const { activeTheme } = useTheme();\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n const typographyStyles = activeTheme?.typography[variant] || {};\n const { lineHeight } = typographyStyles;\n\n const checkOverflow = (el: HTMLElement | null) => {\n if (!el) return;\n setIsOverflowing(el.scrollWidth > el.clientWidth);\n };\n\n useEnhancedEffect(() => {\n const input = inputRef.current;\n if (editMode && input) {\n input.focus();\n input.select();\n }\n }, [editMode]);\n\n const handleClick = () => {\n setEditMode(true);\n setCachedValue(value);\n };\n\n const handleBlur: HvInputProps[\"onBlur\"] = (event) => {\n setEditMode(false);\n\n const newValue = value || cachedValue; // empty values should be ignored\n setValue(newValue);\n onBlur?.(event, newValue);\n };\n\n const handleKeyDown: HvInputProps[\"onKeyDown\"] = (event) => {\n let newValue = value;\n if (isKey(event, \"Esc\")) {\n newValue = cachedValue;\n setEditMode(false);\n setValue(newValue);\n }\n onKeyDown?.(event, newValue);\n };\n\n const handleChange: HvInputProps[\"onChange\"] = (event, val) => {\n setValue(val);\n onChange?.(event, val);\n };\n\n return (\n <div className={cx(classes.root, className)}>\n {editMode && !disabled ? (\n <InputComponent\n ref={ref}\n inputRef={inputRef}\n classes={{\n root: classes.inputRoot,\n input: classes.input,\n }}\n inputProps={{\n style: {\n ...typographyStyles,\n height: InputComponent === HvInput ? lineHeight : undefined,\n },\n }}\n value={value}\n onBlur={handleBlur}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n {...others}\n />\n ) : (\n <HvButton\n variant=\"secondaryGhost\"\n overrideIconColors={false}\n endIcon={\n <Edit\n color=\"textDisabled\"\n className={cx(classes.icon, {\n [classes.iconVisible]: showIcon,\n })}\n />\n }\n className={cx(classes.button, {\n [classes.largeText]: parseInt(lineHeight as string, 10) >= 28,\n })}\n onClick={handleClick}\n disabled={disabled}\n {...buttonProps}\n >\n <HvTooltip title={isOverflowing && value}>\n <HvTypography\n component=\"div\"\n ref={checkOverflow}\n variant={variant}\n noWrap\n className={cx(classes.text, { [classes.textEmpty]: !value })}\n {...typographyProps}\n >\n {value || placeholder}\n </HvTypography>\n </HvTooltip>\n </HvButton>\n )}\n </div>\n );\n});\n"],"names":["HvInlineEditor"],"mappings":";;;;;;;;;;;;;;AAyEO,MAAM,iBAAiB,gBAAgB,SAASA,gBAErD,OAA+B,KAAwB;AACjD,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,OAAO;AAAA,IACP,eAAe;AAAA,IACf;AAAA,IACA,WAAW,iBAAiB;AAAA,IAC5B,UAAU;AAAA,IACV,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,kBAAkB,KAAK;AAE3C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAC9C,QAAM,CAAC,OAAO,QAAQ,IAAI,cAAc,WAAW,YAAY;AAC/D,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,WAAW,OAAyB;AACpC,QAAA,EAAE,YAAY,IAAI,SAAS;AACjC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AAExD,QAAM,mBAAmB,aAAa,WAAW,OAAO,KAAK,CAAC;AACxD,QAAA,EAAE,eAAe;AAEjB,QAAA,gBAAgB,CAAC,OAA2B;AAChD,QAAI,CAAC,GAAI;AACQ,qBAAA,GAAG,cAAc,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A,UACN,WAAW,GAAG,QAAQ,MAAM;AAAA,YAC1B,CAAC,QAAQ,WAAW,GAAG;AAAA,UACxB,CAAA;AAAA,QAAA;AAAA,MACH;AAAA,MAEF,WAAW,GAAG,QAAQ,QAAQ;AAAA,QAC5B,CAAC,QAAQ,SAAS,GAAG,SAAS,YAAsB,EAAE,KAAK;AAAA,MAAA,CAC5D;AAAA,MACD,SAAS;AAAA,MACT;AAAA,MACC,GAAG;AAAA,MAEJ,UAAC,oBAAA,WAAA,EAAU,OAAO,iBAAiB,OACjC,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,KAAK;AAAA,UACL;AAAA,UACA,QAAM;AAAA,UACN,WAAW,GAAG,QAAQ,MAAM,EAAE,CAAC,QAAQ,SAAS,GAAG,CAAC,OAAO;AAAA,UAC1D,GAAG;AAAA,UAEH,UAAS,SAAA;AAAA,QAAA;AAAA,MAAA,EAEd,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,CAAC;"}
1
+ {"version":3,"file":"InlineEditor.js","sources":["../../../src/InlineEditor/InlineEditor.tsx"],"sourcesContent":["import { useRef, useState } from \"react\";\nimport { Edit } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n useTheme,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps } from \"../Button\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useEnhancedEffect } from \"../hooks/useEnhancedEffect\";\nimport { HvInput, HvInputProps } from \"../Input\";\nimport { HvTooltip } from \"../Tooltip\";\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport {\n HvTypography,\n HvTypographyProps,\n HvTypographyVariants,\n} from \"../Typography\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { staticClasses, useClasses } from \"./InlineEditor.styles\";\n\nexport { staticClasses as inlineEditorClasses };\n\nexport type HvInlineEditorClasses = ExtractNames<typeof useClasses>;\n\nexport type HvInlineEditorProps<C extends React.ElementType = typeof HvInput> =\n PolymorphicComponentRef<\n C,\n {\n /** The value of the form element. */\n value?: string;\n /** The default value of the form element. */\n defaultValue?: string;\n /** Whether the Edit icon should always be visible */\n showIcon?: boolean;\n /** Variant of the HvTypography to display */\n variant?: HvTypographyVariants;\n /** Called when the input is blurred. */\n onBlur?: (\n event: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>,\n value: string,\n ) => void;\n /** Called when the input value changes. */\n onChange?: (event: React.SyntheticEvent, value: string) => void;\n /** Called when there's a keydown event on the input. */\n onKeyDown?: (\n event:\n | React.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement>\n | React.MouseEvent,\n value: string,\n ) => void;\n /** Props passed to the HvButton component */\n buttonProps?: HvButtonProps;\n /** Props passed to the HvTypography text component */\n typographyProps?: HvTypographyProps;\n /** Whether the editor is disabled or not. */\n disabled?: boolean;\n /** A Jss Object used to override or extend the styles applied to the empty state component. */\n classes?: HvInlineEditorClasses;\n /** The placeholder value of the input. */\n placeholder?: string;\n }\n >;\n\n/**\n * An Inline Editor allows the user to edit a record without making a major switch\n * between viewing and editing, making it an efficient method of updating a record.\n */\nexport const HvInlineEditor = fixedForwardRef(function HvInlineEditor<\n C extends React.ElementType = typeof HvInput,\n>(props: HvInlineEditorProps<C>, ref: PolymorphicRef<C>) {\n const {\n className,\n classes: classesProp,\n value: valueProp,\n defaultValue = \"\",\n showIcon,\n component: InputComponent = HvInput,\n variant = \"body\",\n placeholder = \"Enter text\",\n onBlur,\n onChange,\n onKeyDown,\n buttonProps,\n typographyProps,\n disabled,\n ...others\n } = useDefaultProps(\"HvInlineEditor\", props);\n\n const { classes, cx } = useClasses(classesProp);\n const [value, setValue] = useControlled(valueProp, defaultValue);\n const [editMode, setEditMode] = useState(false);\n const [cachedValue, setCachedValue] = useState(value);\n const inputRef = useRef<HTMLInputElement>();\n const { activeTheme } = useTheme();\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n const typographyStyles = activeTheme?.typography[variant] || {};\n const { lineHeight } = typographyStyles;\n\n const checkOverflow = (el: HTMLElement | null) => {\n if (!el) return;\n setIsOverflowing(el.scrollWidth > el.clientWidth);\n };\n\n useEnhancedEffect(() => {\n const input = inputRef.current;\n if (editMode && input) {\n input.focus();\n input.select();\n }\n }, [editMode]);\n\n const handleClick = () => {\n setEditMode(true);\n setCachedValue(value);\n };\n\n const handleBlur: HvInputProps[\"onBlur\"] = (event) => {\n setEditMode(false);\n\n const newValue = value || cachedValue; // empty values should be ignored\n setValue(newValue);\n onBlur?.(event, newValue);\n };\n\n const handleKeyDown: HvInputProps[\"onKeyDown\"] = (event) => {\n let newValue = value;\n if (isKey(event, \"Esc\")) {\n newValue = cachedValue;\n setEditMode(false);\n setValue(newValue);\n }\n onKeyDown?.(event, newValue);\n };\n\n const handleChange: HvInputProps[\"onChange\"] = (event, val) => {\n setValue(val);\n onChange?.(event, val);\n };\n\n return (\n <div className={cx(classes.root, className)}>\n {editMode && !disabled ? (\n <InputComponent\n ref={ref}\n inputRef={inputRef}\n classes={{\n root: classes.inputRoot,\n input: classes.input,\n }}\n inputProps={{\n style: {\n ...typographyStyles,\n height: InputComponent === HvInput ? lineHeight : undefined,\n },\n }}\n value={value}\n onBlur={handleBlur}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n {...others}\n />\n ) : (\n <HvButton\n variant=\"secondaryGhost\"\n endIcon={\n <Edit\n color=\"textDisabled\"\n className={cx(classes.icon, {\n [classes.iconVisible]: showIcon,\n })}\n />\n }\n className={cx(classes.button, {\n [classes.largeText]: parseInt(lineHeight as string, 10) >= 28,\n })}\n onClick={handleClick}\n disabled={disabled}\n {...buttonProps}\n >\n <HvTooltip title={isOverflowing && value}>\n <HvTypography\n component=\"div\"\n ref={checkOverflow}\n variant={variant}\n noWrap\n className={cx(classes.text, { [classes.textEmpty]: !value })}\n {...typographyProps}\n >\n {value || placeholder}\n </HvTypography>\n </HvTooltip>\n </HvBut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V,KAAK;AAAA,UACL;AAAA,UACA,QAAM;AAAA,UACN,WAAW,GAAG,QAAQ,MAAM,EAAE,CAAC,QAAQ,SAAS,GAAG,CAAC,OAAO;AAAA,UAC1D,GAAG;AAAA,UAEH,UAAS,SAAA;AAAA,QAAA;AAAA,MAAA,EAEd,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,CAAC;"}
@@ -15,7 +15,7 @@ const { staticClasses, useClasses } = createClasses("HvInlineEditor", {
15
15
  color: theme.colors.textDisabled
16
16
  },
17
17
  button: {
18
- padding: theme.spacing("6px", "8px", "5px", "8px"),
18
+ padding: theme.spacing(0, "xs"),
19
19
  minHeight: "32px",
20
20
  boxSizing: "border-box",
21
21
  cursor: "text",
@@ -1 +1 @@
1
- {"version":3,"file":"InlineEditor.styles.js","sources":["../../../src/InlineEditor/InlineEditor.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvInlineEditor\", {\n root: {},\n /** @deprecated unused. use `classes.root::after` instead */\n inputBorderContainer: {},\n input: {},\n inputRoot: {\n height: \"100%\",\n minHeight: \"32px\",\n },\n text: {},\n largeText: {},\n textEmpty: {\n color: theme.colors.textDisabled,\n },\n button: {\n padding: theme.spacing(\"6px\", \"8px\", \"5px\", \"8px\"),\n minHeight: \"32px\",\n\n boxSizing: \"border-box\",\n cursor: \"text\",\n height: \"100%\",\n width: \"100%\",\n maxWidth: \"100%\",\n justifyContent: \"start\",\n textAlign: \"start\",\n alignItems: \"center\",\n\n backgroundColor: theme.colors.bgContainer,\n borderColor: \"transparent\",\n\n \"&:hover, &:focus\": {\n borderColor: theme.colors.primary,\n backgroundColor: theme.colors.bgContainer,\n\n \"& $icon\": {\n visibility: \"visible\",\n },\n },\n\n \"&:active\": {\n borderColor: theme.colors.text,\n backgroundColor: \"transparent\",\n\n \"& $icon\": {\n visibility: \"visible\",\n },\n },\n },\n icon: {\n cursor: \"pointer\",\n visibility: \"hidden\",\n alignSelf: \"center\",\n height: 16,\n },\n iconVisible: {\n visibility: \"visible\",\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,MAAM,CAAC;AAAA;AAAA,EAEP,sBAAsB,CAAC;AAAA,EACvB,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,IACT,QAAQ;AAAA,IACR,WAAW;AAAA,EACb;AAAA,EACA,MAAM,CAAC;AAAA,EACP,WAAW,CAAC;AAAA,EACZ,WAAW;AAAA,IACT,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,MAAM,QAAQ,OAAO,OAAO,OAAO,KAAK;AAAA,IACjD,WAAW;AAAA,IAEX,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,YAAY;AAAA,IAEZ,iBAAiB,MAAM,OAAO;AAAA,IAC9B,aAAa;AAAA,IAEb,oBAAoB;AAAA,MAClB,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB,MAAM,OAAO;AAAA,MAE9B,WAAW;AAAA,QACT,YAAY;AAAA,MAAA;AAAA,IAEhB;AAAA,IAEA,YAAY;AAAA,MACV,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB;AAAA,MAEjB,WAAW;AAAA,QACT,YAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAEJ;AAAA,EACA,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,QAAQ;AAAA,EACV;AAAA,EACA,aAAa;AAAA,IACX,YAAY;AAAA,EAAA;AAEhB,CAAC;"}
1
+ {"version":3,"file":"InlineEditor.styles.js","sources":["../../../src/InlineEditor/InlineEditor.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvInlineEditor\", {\n root: {},\n /** @deprecated unused. use `classes.root::after` instead */\n inputBorderContainer: {},\n input: {},\n inputRoot: {\n height: \"100%\",\n minHeight: \"32px\",\n },\n text: {},\n largeText: {},\n textEmpty: {\n color: theme.colors.textDisabled,\n },\n button: {\n padding: theme.spacing(0, \"xs\"),\n minHeight: \"32px\",\n\n boxSizing: \"border-box\",\n cursor: \"text\",\n height: \"100%\",\n width: \"100%\",\n maxWidth: \"100%\",\n justifyContent: \"start\",\n textAlign: \"start\",\n alignItems: \"center\",\n\n backgroundColor: theme.colors.bgContainer,\n borderColor: \"transparent\",\n\n \"&:hover, &:focus\": {\n borderColor: theme.colors.primary,\n backgroundColor: theme.colors.bgContainer,\n\n \"& $icon\": {\n visibility: \"visible\",\n },\n },\n\n \"&:active\": {\n borderColor: theme.colors.text,\n backgroundColor: \"transparent\",\n\n \"& $icon\": {\n visibility: \"visible\",\n },\n },\n },\n icon: {\n cursor: \"pointer\",\n visibility: \"hidden\",\n alignSelf: \"center\",\n height: 16,\n },\n iconVisible: {\n visibility: \"visible\",\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,MAAM,CAAC;AAAA;AAAA,EAEP,sBAAsB,CAAC;AAAA,EACvB,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,IACT,QAAQ;AAAA,IACR,WAAW;AAAA,EACb;AAAA,EACA,MAAM,CAAC;AAAA,EACP,WAAW,CAAC;AAAA,EACZ,WAAW;AAAA,IACT,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,MAAM,QAAQ,GAAG,IAAI;AAAA,IAC9B,WAAW;AAAA,IAEX,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,YAAY;AAAA,IAEZ,iBAAiB,MAAM,OAAO;AAAA,IAC9B,aAAa;AAAA,IAEb,oBAAoB;AAAA,MAClB,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB,MAAM,OAAO;AAAA,MAE9B,WAAW;AAAA,QACT,YAAY;AAAA,MAAA;AAAA,IAEhB;AAAA,IAEA,YAAY;AAAA,MACV,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB;AAAA,MAEjB,WAAW;AAAA,QACT,YAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAEJ;AAAA,EACA,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,QAAQ;AAAA,EACV;AAAA,EACA,aAAa;AAAA,IACX,YAAY;AAAA,EAAA;AAEhB,CAAC;"}