@hitachivantara/uikit-react-core 5.47.2 → 5.48.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 (48) hide show
  1. package/dist/cjs/BaseDropdown/BaseDropdown.cjs.map +1 -1
  2. package/dist/cjs/Button/Button.cjs +53 -55
  3. package/dist/cjs/Button/Button.cjs.map +1 -1
  4. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +0 -9
  5. package/dist/cjs/DropDownMenu/DropDownMenu.cjs.map +1 -1
  6. package/dist/cjs/Dropdown/Dropdown.cjs.map +1 -1
  7. package/dist/cjs/Dropdown/Dropdown.styles.cjs +1 -4
  8. package/dist/cjs/Dropdown/Dropdown.styles.cjs.map +1 -1
  9. package/dist/cjs/ListContainer/ListContainer.cjs +20 -10
  10. package/dist/cjs/ListContainer/ListContainer.cjs.map +1 -1
  11. package/dist/cjs/ListContainer/ListContext/ListContext.cjs.map +1 -1
  12. package/dist/cjs/ListContainer/ListItem/ListItem.cjs +5 -2
  13. package/dist/cjs/ListContainer/ListItem/ListItem.cjs.map +1 -1
  14. package/dist/cjs/TimeAgo/TimeAgo.cjs +25 -30
  15. package/dist/cjs/TimeAgo/TimeAgo.cjs.map +1 -1
  16. package/dist/cjs/TreeView/TreeView.cjs +2 -2
  17. package/dist/cjs/TreeView/TreeView.cjs.map +1 -1
  18. package/dist/cjs/Typography/Typography.cjs +35 -37
  19. package/dist/cjs/Typography/Typography.cjs.map +1 -1
  20. package/dist/cjs/index.cjs +2 -0
  21. package/dist/cjs/index.cjs.map +1 -1
  22. package/dist/cjs/types/generic.cjs +8 -0
  23. package/dist/cjs/types/generic.cjs.map +1 -0
  24. package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
  25. package/dist/esm/Button/Button.js +53 -55
  26. package/dist/esm/Button/Button.js.map +1 -1
  27. package/dist/esm/DropDownMenu/DropDownMenu.js +0 -9
  28. package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
  29. package/dist/esm/Dropdown/Dropdown.js.map +1 -1
  30. package/dist/esm/Dropdown/Dropdown.styles.js +1 -4
  31. package/dist/esm/Dropdown/Dropdown.styles.js.map +1 -1
  32. package/dist/esm/ListContainer/ListContainer.js +21 -11
  33. package/dist/esm/ListContainer/ListContainer.js.map +1 -1
  34. package/dist/esm/ListContainer/ListContext/ListContext.js.map +1 -1
  35. package/dist/esm/ListContainer/ListItem/ListItem.js +5 -2
  36. package/dist/esm/ListContainer/ListItem/ListItem.js.map +1 -1
  37. package/dist/esm/TimeAgo/TimeAgo.js +25 -28
  38. package/dist/esm/TimeAgo/TimeAgo.js.map +1 -1
  39. package/dist/esm/TreeView/TreeView.js +2 -2
  40. package/dist/esm/TreeView/TreeView.js.map +1 -1
  41. package/dist/esm/Typography/Typography.js +35 -37
  42. package/dist/esm/Typography/Typography.js.map +1 -1
  43. package/dist/esm/index.js +2 -0
  44. package/dist/esm/index.js.map +1 -1
  45. package/dist/esm/types/generic.js +8 -0
  46. package/dist/esm/types/generic.js.map +1 -0
  47. package/dist/types/index.d.ts +164 -69
  48. package/package.json +2 -2
@@ -29,6 +29,7 @@ import { DividerProps } from '@mui/material/Divider';
29
29
  import { DrawerProps } from '@mui/material/Drawer';
30
30
  import { ds3 } from '@hitachivantara/uikit-styles';
31
31
  import { ds5 } from '@hitachivantara/uikit-styles';
32
+ import { ElementType } from 'react';
32
33
  import { EmblaOptionsType } from 'embla-carousel-react';
33
34
  import { EmotionCache } from '@emotion/cache';
34
35
  import { EmotionContext } from '@hitachivantara/uikit-react-shared';
@@ -70,8 +71,9 @@ import { JSXElementConstructor } from 'react';
70
71
  import { MouseEvent as MouseEvent_2 } from 'react';
71
72
  import { MouseEventHandler } from 'react';
72
73
  import { OptionsObject } from 'notistack';
73
- import { PopperProps } from '@mui/material/Popper';
74
+ import { PopperProps } from 'react-popper';
74
75
  import { PropGetter } from 'react-table';
76
+ import { PropsWithoutRef } from 'react';
75
77
  import { RadioProps } from '@mui/material/Radio';
76
78
  import { default as React_2 } from 'react';
77
79
  import * as React_3 from 'react';
@@ -248,6 +250,7 @@ declare interface AskAction {
248
250
  }
249
251
 
250
252
  declare type AsProp<C extends React.ElementType> = {
253
+ /** Custom element type to override the root component */
251
254
  component?: C;
252
255
  };
253
256
 
@@ -941,6 +944,9 @@ export declare const findDescriptors: (children: any, descriptors?: {
941
944
 
942
945
  declare type FixComponentProps<T> = T extends any ? T : never;
943
946
 
947
+ /** React.forwardRef with fixed type declarations */
948
+ export declare function fixedForwardRef<T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
949
+
944
950
  export declare const focusClasses: {
945
951
  root: "HvFocus-root";
946
952
  disabled: "HvFocus-disabled";
@@ -1633,7 +1639,7 @@ export declare interface HvBaseDropdownProps extends HvBaseProps {
1633
1639
  /**
1634
1640
  * An object containing props to be wired to the popper component.
1635
1641
  */
1636
- popperProps?: Partial<PopperProps>;
1642
+ popperProps?: Partial<PopperProps<any>>;
1637
1643
  /**
1638
1644
  * Placement of the dropdown.
1639
1645
  */
@@ -1717,8 +1723,8 @@ export declare interface HvBaseInputProps extends Omit<InputProps, "onChange" |
1717
1723
  classes?: HvBaseInputClasses;
1718
1724
  }
1719
1725
 
1720
- /** HV Base Props. Extends `HTMLAttributes` of an element `E`, and filters `K` keys. */
1721
- export declare type HvBaseProps<E extends HTMLElement = HTMLDivElement, K extends keyof HTMLAttributes<E> = never> = Omit<HTMLAttributes<E>, K>;
1726
+ /** HV Base Props. Extends `React.HTMLAttributes` of an element `E`, and filters `K` keys. */
1727
+ export declare type HvBaseProps<E extends HTMLElement = HTMLDivElement, K extends keyof React.HTMLAttributes<E> = never> = Omit<React.HTMLAttributes<E>, K>;
1722
1728
 
1723
1729
  /**
1724
1730
  * A Radio Button is a mechanism that allows user to select one or more options.
@@ -2000,11 +2006,55 @@ export declare interface HvBulkActionsProps extends HvBaseProps {
2000
2006
  /**
2001
2007
  * Button component is used to trigger an action or event.
2002
2008
  */
2003
- export declare const HvButton: <C extends React_2.ElementType = "button">(props: HvButtonProps<C>) => React_2.ReactElement | null;
2009
+ export declare const HvButton: <C extends ElementType<any> = "button">(props: {
2010
+ /** Use the variant prop to change the visual style of the Button. */
2011
+ variant?: "secondary" | "primary" | "semantic" | "secondarySubtle" | "secondaryGhost" | "primaryGhost" | "primarySubtle" | "ghost" | undefined;
2012
+ /** Whether the Button is an icon-only button. */
2013
+ icon?: boolean | undefined;
2014
+ /** Whether the Button is disabled or not. */
2015
+ disabled?: boolean | undefined;
2016
+ /** Class names to be applied. */
2017
+ className?: string | undefined;
2018
+ /** Element placed before the children. */
2019
+ startIcon?: React.ReactNode;
2020
+ /** Element placed after the children. */
2021
+ endIcon?: React.ReactNode;
2022
+ /** Button size. */
2023
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
2024
+ /** Button border radius. */
2025
+ radius?: "base" | "none" | "round" | "circle" | "full" | undefined;
2026
+ /** Defines the default colors of the button are forced into the icon. */
2027
+ overrideIconColors?: boolean | undefined;
2028
+ /** A Jss Object used to override or extend the styles applied. */
2029
+ classes?: Partial<{
2030
+ secondary: string;
2031
+ primary: string;
2032
+ root: string;
2033
+ disabled: string;
2034
+ semantic: string;
2035
+ secondarySubtle: string;
2036
+ icon: string;
2037
+ secondaryGhost: string;
2038
+ primaryGhost: string;
2039
+ primarySubtle: string;
2040
+ ghost: string;
2041
+ startIcon: string;
2042
+ endIcon: string;
2043
+ focusVisible: string;
2044
+ }> | undefined;
2045
+ /** Whether the Button is selected or not. */
2046
+ selected?: boolean | undefined;
2047
+ } & {
2048
+ component?: C | undefined;
2049
+ } & {
2050
+ children?: ReactNode;
2051
+ } & (Omit<PropsWithoutRef<ComponentProps<C>>, "classes" | "disabled" | "icon" | "selected" | "size" | "component" | "className" | "radius" | "variant" | "startIcon" | "endIcon" | "overrideIconColors"> extends infer T ? T extends Omit<PropsWithoutRef<ComponentProps<C>>, "classes" | "disabled" | "icon" | "selected" | "size" | "component" | "className" | "radius" | "variant" | "startIcon" | "endIcon" | "overrideIconColors"> ? T extends any ? T : never : never : never) & {
2052
+ ref?: PolymorphicRef<C> | undefined;
2053
+ } & RefAttributes<unknown>) => ReactElement<any, string | JSXElementConstructor<any>> | null;
2004
2054
 
2005
2055
  export declare type HvButtonClasses = ExtractNames<typeof useClasses_33>;
2006
2056
 
2007
- export declare type HvButtonProps<C extends React_2.ElementType = "button"> = PolymorphicComponentRef<C, {
2057
+ export declare type HvButtonProps<C extends React.ElementType = "button"> = PolymorphicComponentRef<C, {
2008
2058
  /** Use the variant prop to change the visual style of the Button. */
2009
2059
  variant?: HvButtonVariant;
2010
2060
  /** Whether the Button is an icon-only button. */
@@ -2014,9 +2064,9 @@ export declare type HvButtonProps<C extends React_2.ElementType = "button"> = Po
2014
2064
  /** Class names to be applied. */
2015
2065
  className?: string;
2016
2066
  /** Element placed before the children. */
2017
- startIcon?: ReactElement;
2067
+ startIcon?: React.ReactNode;
2018
2068
  /** Element placed after the children. */
2019
- endIcon?: ReactElement;
2069
+ endIcon?: React.ReactNode;
2020
2070
  /** Button size. */
2021
2071
  size?: HvButtonSize;
2022
2072
  /** Button border radius. */
@@ -3147,42 +3197,15 @@ export declare interface HvDropDownMenuProps extends HvBaseProps<HTMLDivElement,
3147
3197
  classes?: HvDropDownMenuClasses;
3148
3198
  }
3149
3199
 
3150
- export declare interface HvDropdownProps extends HvBaseProps<HTMLDivElement, "onChange"> {
3200
+ export declare interface HvDropdownProps extends Omit<HvFormElementProps, "value" | "onChange">, Pick<HvBaseDropdownProps, "placement" | "popperProps" | "disablePortal" | "variableWidth" | "expanded" | "defaultExpanded"> {
3151
3201
  /**
3152
3202
  * A Jss Object used to override or extend the component styles applied.
3153
3203
  */
3154
3204
  classes?: HvDropdownClasses;
3155
- /**
3156
- * The form element name.
3157
- */
3158
- name?: string;
3159
- /**
3160
- * The label of the form element.
3161
- *
3162
- * The form element must be labeled for accessibility reasons.
3163
- * If not provided, an aria-label or aria-labelledby must be provided instead.
3164
- */
3165
- label?: any;
3166
- /**
3167
- * Provide additional descriptive text for the form element.
3168
- */
3169
- description?: any;
3170
3205
  /**
3171
3206
  * The placeholder value when nothing is selected.
3172
3207
  */
3173
3208
  placeholder?: string;
3174
- /**
3175
- * Indicates that the form element is disabled.
3176
- */
3177
- disabled?: boolean;
3178
- /**
3179
- * Indicates that the form element is in read only mode.
3180
- */
3181
- readOnly?: boolean;
3182
- /**
3183
- * Indicates that user input is required on the form element.
3184
- */
3185
- required?: boolean;
3186
3209
  /**
3187
3210
  * The status of the form element.
3188
3211
  *
@@ -3220,14 +3243,6 @@ export declare interface HvDropdownProps extends HvBaseProps<HTMLDivElement, "on
3220
3243
  * If `true` the dropdown is rendered with a search bar, if `false` there won't be a search bar.
3221
3244
  */
3222
3245
  showSearch?: boolean;
3223
- /**
3224
- * If `true` the dropdown starts opened if `false` it starts closed.
3225
- */
3226
- expanded?: boolean;
3227
- /**
3228
- * When uncontrolled, defines the initial expanded state.
3229
- */
3230
- defaultExpanded?: boolean;
3231
3246
  /**
3232
3247
  * If 'true' the dropdown will notify on the first render.
3233
3248
  */
@@ -3240,28 +3255,10 @@ export declare interface HvDropdownProps extends HvBaseProps<HTMLDivElement, "on
3240
3255
  * If `true` the dropdown will show tooltips when user mouseenter text in list
3241
3256
  */
3242
3257
  hasTooltips?: boolean;
3243
- /**
3244
- * Disable the portal behavior.
3245
- * The children stay within it's parent DOM hierarchy.
3246
- */
3247
- disablePortal?: boolean;
3248
- /**
3249
- * If `true` the dropdown width depends size of content if `false` the width depends on the header size.
3250
- * Defaults to `false`.
3251
- */
3252
- variableWidth?: boolean;
3253
3258
  /**
3254
3259
  * If `true`, selection can be toggled when single selection.
3255
3260
  */
3256
3261
  singleSelectionToggle?: boolean;
3257
- /**
3258
- * Placement of the dropdown.
3259
- */
3260
- placement?: "left" | "right";
3261
- /**
3262
- * An object containing props to be wired to the popper component.
3263
- */
3264
- popperProps?: Partial<PopperProps>;
3265
3262
  /**
3266
3263
  * Callback called when the user cancels the changes.
3267
3264
  *
@@ -3310,7 +3307,7 @@ export declare interface HvDropdownProps extends HvBaseProps<HTMLDivElement, "on
3310
3307
  /**
3311
3308
  * Extra props passed to the list.
3312
3309
  */
3313
- listProps?: HvDropdownListProps;
3310
+ listProps?: Partial<HvDropdownListProps>;
3314
3311
  }
3315
3312
 
3316
3313
  export declare type HvDropdownStatus = "standBy" | "valid" | "invalid";
@@ -4375,6 +4372,8 @@ export declare interface HvListContainerProps extends HvBaseProps<HTMLUListEleme
4375
4372
  interactive?: boolean;
4376
4373
  /** If `true` compact the vertical spacing between list items. */
4377
4374
  condensed?: boolean;
4375
+ /** If `true`, the list items are _visually_ selectable. To enable selection, use `HvSelectionList` */
4376
+ selectable?: boolean;
4378
4377
  /** If `true`, the list items' left and right padding is removed. */
4379
4378
  disableGutters?: boolean;
4380
4379
  /** A Jss Object used to override or extend the styles applied to the component. */
@@ -4391,6 +4390,8 @@ export declare type HvListItemClasses = ExtractNames<typeof useClasses_4>;
4391
4390
  export declare interface HvListItemProps extends HvBaseProps<HTMLLIElement> {
4392
4391
  /** Indicates if the list item is selected. */
4393
4392
  selected?: boolean;
4393
+ /** Indicated if the list item is _visually_ selectable */
4394
+ selectable?: boolean;
4394
4395
  /** If true, the list item will be disabled. */
4395
4396
  disabled?: boolean;
4396
4397
  /**
@@ -6656,7 +6657,42 @@ declare interface HvThemeProviderProps {
6656
6657
  /**
6657
6658
  * The HvTimeAgo component implements the Design System relative time format guidelines.
6658
6659
  */
6659
- export declare const HvTimeAgo: <C extends React.ElementType = "p">(props: HvTimeAgoProps<C>) => React.ReactElement | null;
6660
+ export declare const HvTimeAgo: <C extends ElementType<any> = "p">(props: {
6661
+ /**
6662
+ * The timestamp to format, in seconds or milliseconds.
6663
+ * Defaults to `emptyElement` if value is null or 0
6664
+ */
6665
+ timestamp?: number | undefined;
6666
+ /**
6667
+ * The locale to be used. Should be on of the dayjs supported locales and explicitly imported
6668
+ * @see https://day.js.org/docs/en/i18n/i18n
6669
+ */
6670
+ locale?: string | undefined;
6671
+ /**
6672
+ * The element to render when the timestamp is null or 0
6673
+ * Defaults to `—` (Em Dash)
6674
+ */
6675
+ emptyElement?: React.ReactNode;
6676
+ /** Disables periodic date refreshes */
6677
+ disableRefresh?: boolean | undefined;
6678
+ /** Whether to show seconds in the rendered time */
6679
+ showSeconds?: boolean | undefined;
6680
+ /**
6681
+ * Whether the component should render just the string
6682
+ * Consider using `useTimeAgo` instead
6683
+ */
6684
+ justText?: boolean | undefined;
6685
+ /** A Jss Object used to override or extend the styles applied to the component. */
6686
+ classes?: Partial<{
6687
+ root: string;
6688
+ }> | undefined;
6689
+ } & {
6690
+ component?: C | undefined;
6691
+ } & {
6692
+ children?: ReactNode;
6693
+ } & (Omit<PropsWithoutRef<ComponentProps<C>>, "classes" | "component" | "locale" | "emptyElement" | "showSeconds" | "timestamp" | "disableRefresh" | "justText"> extends infer T ? T extends Omit<PropsWithoutRef<ComponentProps<C>>, "classes" | "component" | "locale" | "emptyElement" | "showSeconds" | "timestamp" | "disableRefresh" | "justText"> ? T extends any ? T : never : never : never) & {
6694
+ ref?: PolymorphicRef<C> | undefined;
6695
+ } & RefAttributes<unknown>) => ReactElement<any, string | JSXElementConstructor<any>> | null;
6660
6696
 
6661
6697
  export declare type HvTimeAgoClasses = ExtractNames<typeof useClasses_111>;
6662
6698
 
@@ -6897,23 +6933,82 @@ export declare interface HvTreeItemProps extends HTMLAttributes<HTMLElement> {
6897
6933
  * </HvTreeView>
6898
6934
  * ```
6899
6935
  */
6900
- export declare const HvTreeView: HvTreeViewComponent;
6936
+ export declare const HvTreeView: <Multiple extends boolean | undefined>(props: HvTreeViewProps<Multiple> & RefAttributes<HTMLUListElement>) => ReactElement<any, string | JSXElementConstructor<any>> | null;
6901
6937
 
6902
6938
  export declare type HvTreeViewClasses = ExtractNames<typeof useClasses_113>;
6903
6939
 
6904
- declare type HvTreeViewComponent = <Multiple extends boolean | undefined = undefined>(props: HvTreeViewProps<Multiple>) => React.JSX.Element;
6905
-
6906
6940
  export declare interface HvTreeViewProps<Multiple extends boolean | undefined> extends HvBaseProps<HTMLUListElement>, DefaultTreeViewPluginParameters<Multiple> {
6907
6941
  /** A Jss Object used to override or extend the styles applied. */
6908
6942
  classes?: HvTreeViewClasses;
6909
6943
  /** Tree View children. Usually a `HvTreeItem` instance, or a custom variation of it */
6910
- children?: ReactNode;
6944
+ children?: React.ReactNode;
6911
6945
  }
6912
6946
 
6913
6947
  /**
6914
6948
  * Typography component is used to render text and paragraphs within an interface.
6915
6949
  */
6916
- export declare const HvTypography: <C extends React.ElementType = "p">(props: HvTypographyProps<C>) => React.ReactElement | null;
6950
+ export declare const HvTypography: <C extends ElementType<any> = "p">(props: {
6951
+ /** Use the variant prop to change the visual style of the Typography. */
6952
+ variant?: "display" | "title1" | "title2" | "title3" | "title4" | "label" | "body" | "caption1" | "caption2" | HvTypographyLegacyVariants | undefined;
6953
+ /** If `true` the typography will display the look of a link. */
6954
+ link?: boolean | undefined;
6955
+ /** If `true` the typography will display the look of a disabled state. */
6956
+ disabled?: boolean | undefined;
6957
+ /**
6958
+ * If `true`, the typography will render a "p" element
6959
+ * @deprecated use `component="p"` instead
6960
+ * */
6961
+ paragraph?: boolean | undefined;
6962
+ /**
6963
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
6964
+ *
6965
+ * Note that text overflow can only happen with block or inline-block level elements
6966
+ * (the element needs to have a width in order to overflow).
6967
+ */
6968
+ noWrap?: boolean | undefined;
6969
+ /** A Jss Object used to override or extend the styles applied to the component. */
6970
+ classes?: Partial<{
6971
+ display: string;
6972
+ "5xlTitle": string;
6973
+ "4xlTitle": string;
6974
+ title1: string;
6975
+ title2: string;
6976
+ title3: string;
6977
+ title4: string;
6978
+ label: string;
6979
+ body: string;
6980
+ caption1: string;
6981
+ caption2: string;
6982
+ xxlTitle: string;
6983
+ lTitle: string;
6984
+ sTitle: string;
6985
+ xxsTitle: string;
6986
+ sectionTitle: string;
6987
+ placeholderText: string;
6988
+ link: string;
6989
+ disabledText: string;
6990
+ selectedNavText: string;
6991
+ vizTextDisabled: string;
6992
+ xsInlineLink: string;
6993
+ root: string;
6994
+ disabled: string;
6995
+ "3xlTitle": string;
6996
+ xlTitle: string;
6997
+ mTitle: string;
6998
+ xsTitle: string;
6999
+ highlightText: string;
7000
+ normalText: string;
7001
+ vizText: string;
7002
+ isLink: string;
7003
+ noWrap: string;
7004
+ }> | undefined;
7005
+ } & {
7006
+ component?: C | undefined;
7007
+ } & {
7008
+ children?: ReactNode;
7009
+ } & (Omit<PropsWithoutRef<ComponentProps<C>>, "link" | "classes" | "disabled" | "component" | "noWrap" | "variant" | "paragraph"> extends infer T ? T extends Omit<PropsWithoutRef<ComponentProps<C>>, "link" | "classes" | "disabled" | "component" | "noWrap" | "variant" | "paragraph"> ? T extends any ? T : never : never : never) & {
7010
+ ref?: PolymorphicRef<C> | undefined;
7011
+ } & RefAttributes<unknown>) => ReactElement<any, string | JSXElementConstructor<any>> | null;
6917
7012
 
6918
7013
  export declare type HvTypographyClasses = ExtractNames<typeof useClasses>;
6919
7014
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "5.47.2",
3
+ "version": "5.48.0",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Core React components for the NEXT Design System.",
@@ -63,7 +63,7 @@
63
63
  "access": "public",
64
64
  "directory": "package"
65
65
  },
66
- "gitHead": "d47ae985a5ccb7c13d43ba47f293523caab14636",
66
+ "gitHead": "e7726b2e22a291fa4d2dc3b21c1e943f2a45feb0",
67
67
  "main": "dist/cjs/index.cjs",
68
68
  "exports": {
69
69
  ".": {