@hitachivantara/uikit-react-core 5.7.5 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cjs/components/Carousel/Carousel.cjs +230 -0
  2. package/dist/cjs/components/Carousel/Carousel.cjs.map +1 -0
  3. package/dist/cjs/components/Carousel/Carousel.styles.cjs +177 -0
  4. package/dist/cjs/components/Carousel/Carousel.styles.cjs.map +1 -0
  5. package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.cjs +43 -0
  6. package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.cjs.map +1 -0
  7. package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.styles.cjs +15 -0
  8. package/dist/cjs/components/Carousel/CarouselSlide/CarouselSlide.styles.cjs.map +1 -0
  9. package/dist/cjs/components/Carousel/utils.cjs +36 -0
  10. package/dist/cjs/components/Carousel/utils.cjs.map +1 -0
  11. package/dist/cjs/components/Dialog/Dialog.cjs +6 -53
  12. package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
  13. package/dist/cjs/components/VerticalNavigation/Navigation/Navigation.cjs.map +1 -1
  14. package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +6 -6
  15. package/dist/cjs/components/VerticalNavigation/NavigationSlider/NavigationSlider.cjs.map +1 -1
  16. package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs +2 -3
  17. package/dist/cjs/components/VerticalNavigation/TreeView/TreeViewItem.cjs.map +1 -1
  18. package/dist/cjs/components/VerticalNavigation/VerticalNavigation.cjs.map +1 -1
  19. package/dist/cjs/index.cjs +8 -0
  20. package/dist/cjs/index.cjs.map +1 -1
  21. package/dist/esm/components/Carousel/Carousel.js +228 -0
  22. package/dist/esm/components/Carousel/Carousel.js.map +1 -0
  23. package/dist/esm/components/Carousel/Carousel.styles.js +177 -0
  24. package/dist/esm/components/Carousel/Carousel.styles.js.map +1 -0
  25. package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.js +43 -0
  26. package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.js.map +1 -0
  27. package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.styles.js +15 -0
  28. package/dist/esm/components/Carousel/CarouselSlide/CarouselSlide.styles.js.map +1 -0
  29. package/dist/esm/components/Carousel/utils.js +36 -0
  30. package/dist/esm/components/Carousel/utils.js.map +1 -0
  31. package/dist/esm/components/Dialog/Dialog.js +7 -53
  32. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  33. package/dist/esm/components/VerticalNavigation/Navigation/Navigation.js.map +1 -1
  34. package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.js +6 -6
  35. package/dist/esm/components/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
  36. package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js +2 -3
  37. package/dist/esm/components/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
  38. package/dist/esm/components/VerticalNavigation/VerticalNavigation.js.map +1 -1
  39. package/dist/esm/index.js +8 -0
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/types/index.d.ts +283 -36
  42. package/package.json +6 -5
@@ -12,6 +12,7 @@ import { CheckboxProps } from '@mui/material';
12
12
  import { ChipProps } from '@mui/material/Chip';
13
13
  import { ColumnInstance } from 'react-table';
14
14
  import { ColumnInterface } from 'react-table';
15
+ import { ComponentProps } from 'react';
15
16
  import { ContainerProps } from '@mui/material/Container';
16
17
  import type { Context } from 'react';
17
18
  import { CSSProperties } from 'react';
@@ -22,6 +23,7 @@ import { DialogTitleProps } from '@mui/material/DialogTitle';
22
23
  import { DividerProps } from '@mui/material/Divider';
23
24
  import { ds3 } from '@hitachivantara/uikit-styles';
24
25
  import { ds5 } from '@hitachivantara/uikit-styles';
26
+ import { EmblaOptionsType } from 'embla-carousel-react';
25
27
  import type { ForwardRefExoticComponent } from 'react';
26
28
  import { GridProps } from '@mui/material';
27
29
  import { Hooks } from 'react-table';
@@ -47,6 +49,7 @@ import type { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
47
49
  import { MouseEvent as MouseEvent_2 } from 'react';
48
50
  import { MouseEventHandler } from 'react';
49
51
  import { PopperProps } from '@mui/material';
52
+ import type { Property } from 'csstype';
50
53
  import { PropGetter } from 'react-table';
51
54
  import { RadioProps } from '@mui/material';
52
55
  import { default as React_2 } from 'react';
@@ -425,6 +428,38 @@ export declare const cardMediaClasses: {
425
428
  root: "HvCard-Media-root";
426
429
  };
427
430
 
431
+ export declare const carouselClasses: {
432
+ main: "HvCarousel-main";
433
+ title: "HvCarousel-title";
434
+ dot: "HvCarousel-dot";
435
+ controls: "HvCarousel-controls";
436
+ xs: "HvCarousel-xs";
437
+ root: "HvCarousel-root";
438
+ actions: "HvCarousel-actions";
439
+ panel: "HvCarousel-panel";
440
+ fullscreen: "HvCarousel-fullscreen";
441
+ closeButton: "HvCarousel-closeButton";
442
+ mainContainer: "HvCarousel-mainContainer";
443
+ pageCounter: "HvCarousel-pageCounter";
444
+ mainXs: "HvCarousel-mainXs";
445
+ mainFullscreen: "HvCarousel-mainFullscreen";
446
+ counterContainer: "HvCarousel-counterContainer";
447
+ counter: "HvCarousel-counter";
448
+ slideControls: "HvCarousel-slideControls";
449
+ slidesViewport: "HvCarousel-slidesViewport";
450
+ slidesContainer: "HvCarousel-slidesContainer";
451
+ dots: "HvCarousel-dots";
452
+ dotsXs: "HvCarousel-dotsXs";
453
+ dotSelected: "HvCarousel-dotSelected";
454
+ thumbnail: "HvCarousel-thumbnail";
455
+ thumbnailSelected: "HvCarousel-thumbnailSelected";
456
+ };
457
+
458
+ export declare const cc: {
459
+ image: "HvCarouselSlide-image";
460
+ slide: "HvCarouselSlide-slide";
461
+ };
462
+
428
463
  declare type CellValue<V = any> = V;
429
464
 
430
465
  export declare const CellWithCheckBox: ({ row, labels: labelsProp }: {
@@ -561,8 +596,8 @@ export declare const dialogActionClasses: {
561
596
  export declare const dialogClasses: {
562
597
  background: "HvDialog-background";
563
598
  root: "HvDialog-root";
564
- closeButton: "HvDialog-closeButton";
565
599
  fullscreen: "HvDialog-fullscreen";
600
+ closeButton: "HvDialog-closeButton";
566
601
  paper: "HvDialog-paper";
567
602
  };
568
603
 
@@ -2182,6 +2217,64 @@ export declare interface HvCardProps extends HvBaseProps {
2182
2217
  classes?: HvCardClasses;
2183
2218
  }
2184
2219
 
2220
+ /**
2221
+ * A Carousel is commonly used to browse images, it can also be used to browse any kind of content like text, video, or charts.
2222
+ * It allows you to focus on a particular content while having a notion of how many you have to explore.
2223
+ */
2224
+ export declare const HvCarousel: (props: HvCarouselProps) => JSX_2.Element;
2225
+
2226
+ export declare type HvCarouselClasses = Record<keyof typeof styles, string>;
2227
+
2228
+ export declare interface HvCarouselProps extends HvBaseProps<HTMLDivElement, "title" | "onChange"> {
2229
+ /** A Jss Object used to override or extend the styles applied. */
2230
+ classes?: Partial<HvCarouselClasses>;
2231
+ /** Height of the Slider container. If `undefined`, images will keep a 16/9 aspect-ratio */
2232
+ height?: CSSProperties["height"];
2233
+ /** Width of the thumbnail. Height will try to maintain a 16/9 aspect-ratio */
2234
+ thumbnailWidth?: CSSProperties["width"];
2235
+ /** Title of the carousel */
2236
+ title?: React_2.ReactNode;
2237
+ /** Content slides to be displayed. @see `<HvCarouselSlide />` */
2238
+ children?: React_2.ReactNode;
2239
+ /** Custom content to render in the actions area */
2240
+ actions?: React_2.ReactNode;
2241
+ /** Whether Carousel is in "xs mode" - to use in embedded contexts */
2242
+ xs?: boolean;
2243
+ /** Whether to show dots instead of arrow pagination. Defaults to true under 5 elements */
2244
+ showDots?: boolean;
2245
+ /** Whether to show the counter on the top-right corner of the active slide */
2246
+ showCounter?: boolean;
2247
+ /** Whether to show the back/forwards buttons over the active slide */
2248
+ showSlideControls?: boolean;
2249
+ /** Whether to enable the fullscreen toggle button */
2250
+ showFullscreen?: boolean;
2251
+ /** Whether to hide the thumbnails. Hidden by default in "xs" mode */
2252
+ hideThumbnails?: boolean;
2253
+ /** Carousel configuration options. @see https://www.embla-carousel.com/api/options/ */
2254
+ carouselOptions?: EmblaOptionsType;
2255
+ /** */
2256
+ renderThumbnail?: (index: number) => React_2.ReactNode;
2257
+ /** The callback fired when the active slide changes. */
2258
+ onChange?: (index: number) => void;
2259
+ }
2260
+
2261
+ /**
2262
+ * A container to use as `children` of `HvCarousel`.
2263
+ * Pass `img` props directly to it, or `children` for any custom content
2264
+ */
2265
+ export declare const HvCarouselSlide: ({ classes: classesProp, children, size: flexBasis, src, alt, ...props }: HvCarouselSlideProps) => JSX_2.Element;
2266
+
2267
+ export declare type HvCarouselSlideClasses = Record<keyof typeof styles_2, string>;
2268
+
2269
+ export declare interface HvCarouselSlideProps extends ImgHTMLAttributes<HTMLImageElement> {
2270
+ /** A Jss Object used to override or extend the styles applied. */
2271
+ classes?: Partial<HvCarouselSlideClasses>;
2272
+ /** The width of the Slide. Defaults to `100%` */
2273
+ size?: string;
2274
+ /** Content of a slide to be displayed */
2275
+ children?: React.ReactNode;
2276
+ }
2277
+
2185
2278
  export declare type HvCategoricalColorKeys = "cat1" | "cat1_180" | "cat1_160" | "cat1_140" | "cat1_120" | "cat1_80" | "cat1_60" | "cat1_40" | "cat1_20" | "cat2" | "cat2_180" | "cat2_160" | "cat2_140" | "cat2_120" | "cat2_80" | "cat2_60" | "cat2_40" | "cat2_20" | "cat3" | "cat3_180" | "cat3_160" | "cat3_140" | "cat3_120" | "cat3_80" | "cat3_60" | "cat3_40" | "cat3_20" | "cat4" | "cat4_180" | "cat4_160" | "cat4_140" | "cat4_120" | "cat4_80" | "cat4_60" | "cat4_40" | "cat4_20" | "cat5" | "cat5_180" | "cat5_160" | "cat5_140" | "cat5_120" | "cat5_80" | "cat5_60" | "cat5_40" | "cat5_20" | "cat6" | "cat6_180" | "cat6_160" | "cat6_140" | "cat6_120" | "cat6_80" | "cat6_60" | "cat6_40" | "cat6_20" | "cat7" | "cat7_180" | "cat7_160" | "cat7_140" | "cat7_120" | "cat7_80" | "cat7_60" | "cat7_40" | "cat7_20" | "cat8" | "cat8_180" | "cat8_160" | "cat8_140" | "cat8_120" | "cat8_80" | "cat8_60" | "cat8_40" | "cat8_20" | "cat9" | "cat9_180" | "cat9_160" | "cat9_140" | "cat9_120" | "cat9_80" | "cat9_60" | "cat9_40" | "cat9_20" | "cat10" | "cat10_180" | "cat10_160" | "cat10_140" | "cat10_120" | "cat10_80" | "cat10_60" | "cat10_40" | "cat10_20" | "cat11" | "cat11_180" | "cat11_160" | "cat11_140" | "cat11_120" | "cat11_80" | "cat11_60" | "cat11_40" | "cat11_20" | "cat12" | "cat12_180" | "cat12_160" | "cat12_140" | "cat12_120" | "cat12_80" | "cat12_60" | "cat12_40" | "cat12_20" | "cat13" | "cat14" | "cat15" | "cat16" | "cat17" | "cat18" | "cat19" | "cat20";
2186
2279
 
2187
2280
  export declare interface HvCellInstance<D extends object = Record<string, unknown>, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, V = any> extends Omit<Cell<D, V>, "column" | "row" | "getCellProps">, Partial<UseGroupByCellProps<D>> {
@@ -2885,7 +2978,11 @@ export declare interface HvDialogProps extends Omit<DialogProps, "fullScreen" |
2885
2978
  maxWidth?: DialogProps["maxWidth"];
2886
2979
  /** @inheritdoc */
2887
2980
  fullWidth?: DialogProps["fullWidth"];
2888
- /** Element id that should be focus when the Dialog opens. */
2981
+ /**
2982
+ * Element id that should be focus when the Dialog opens.
2983
+ * Auto-focusing elements can cause usability issues, so this should be avoided.
2984
+ * @deprecated Use `autoFocus` on the element instead, if auto-focusing is required.
2985
+ */
2889
2986
  firstFocusable?: string;
2890
2987
  /** Title for the button close. */
2891
2988
  buttonTitle?: string;
@@ -7247,7 +7344,7 @@ export declare interface HvValidationMessages {
7247
7344
  * It is recommended to use vertical navigation when your application requires global navigation that is displayed on the left.
7248
7345
  * While vertical navigation menus generally consume more space than their horizontal counterparts, they have become more popular as desktop monitors move to wide-screen formats.
7249
7346
  *
7250
- * Even thou both the hierarchically organized data and the visual style ressemble a treeview-like structure, the [Treeview Design Pattern](https://w3c.github.io/aria-practices/#TreeView)
7347
+ * Although both the hierarchically organized data and the visual style resemble a treeview-like structure, the [Treeview Design Pattern](https://w3c.github.io/aria-practices/#TreeView)
7251
7348
  * isn't necessarily the most appropriate.
7252
7349
  *
7253
7350
  * The tree role provides complex functionality that is not needed for typical site navigation, and changes the most common keyboard navigation using TAB.
@@ -8037,44 +8134,20 @@ export declare const multiButtonClasses: {
8037
8134
 
8038
8135
  export declare const multiSelectionEventHandler: (evt: any, index: any, selectionAnchor: any, allValues: any, selectedState: any, selectionCheck: any) => any[];
8039
8136
 
8040
- export declare interface NavigationData {
8041
- /**
8042
- * the id to be applied to the root element.
8043
- */
8137
+ export declare type NavigationData<T extends React.ElementType = "a"> = ComponentProps<T> & Record<string, any> & {
8138
+ /** The id to be applied to the root element. */
8044
8139
  id: string;
8045
- /**
8046
- * the label to be rendered on the menu item.
8047
- */
8140
+ /** The label to be rendered on the menu item. */
8048
8141
  label: string;
8049
- /**
8050
- * The url for the link.
8051
- */
8052
- href?: string;
8053
- /**
8054
- * The behavior when opening a link.
8055
- */
8056
- target?: string;
8057
- /**
8058
- * Icon to be render.
8059
- */
8142
+ /** The icon to be rendered. */
8060
8143
  icon?: React.ReactNode;
8061
- /**
8062
- * Data subset.
8063
- */
8064
- data?: NavigationData[];
8065
- /**
8066
- * if `true` the item is disabled and is not interactive.
8067
- */
8144
+ /** The Data children subset. */
8145
+ data?: NavigationData<T>[];
8146
+ /** Whether the item is disabled and not interactive. */
8068
8147
  disabled?: boolean;
8069
- /**
8070
- * if `true` the item doesn't have a selected state.
8071
- */
8148
+ /** Whether the item has a selected state. */
8072
8149
  selectable?: boolean;
8073
- /**
8074
- * Any other properties.
8075
- */
8076
- [otherProperty: string]: any;
8077
- }
8150
+ };
8078
8151
 
8079
8152
  export declare type NavigationMode = "treeview" | "navigation" | "slider";
8080
8153
 
@@ -8426,6 +8499,180 @@ export declare const stackClasses: {
8426
8499
 
8427
8500
  declare type StringKey<D> = Extract<keyof D, string>;
8428
8501
 
8502
+ declare const styles: {
8503
+ /** Styles applied to the component root class. */
8504
+ root: {
8505
+ display: "flex";
8506
+ alignItems: "stretch";
8507
+ flexDirection: "column";
8508
+ backgroundColor: string;
8509
+ margin: number;
8510
+ paddingTop: string;
8511
+ paddingBottom: string;
8512
+ };
8513
+ xs: {
8514
+ "&:not(._)": {
8515
+ padding: number;
8516
+ };
8517
+ "& $dots": {
8518
+ position: "relative";
8519
+ top: string;
8520
+ };
8521
+ "& $actions": {
8522
+ top: number;
8523
+ };
8524
+ "& $controls": {
8525
+ display: string;
8526
+ };
8527
+ };
8528
+ fullscreen: {
8529
+ width: string;
8530
+ height: string;
8531
+ position: "fixed";
8532
+ inset: number;
8533
+ zIndex: string;
8534
+ "&:not(._)": {
8535
+ padding: string;
8536
+ };
8537
+ };
8538
+ title: {
8539
+ display: "flex";
8540
+ justifyContent: "flex-start";
8541
+ marginBottom: string;
8542
+ };
8543
+ actions: {
8544
+ display: "flex";
8545
+ justifyContent: "flex-end";
8546
+ height: number;
8547
+ zIndex: number;
8548
+ position: "relative";
8549
+ top: string;
8550
+ };
8551
+ closeButton: {};
8552
+ mainContainer: {
8553
+ display: "flex";
8554
+ flexDirection: Property.FlexDirection | undefined;
8555
+ };
8556
+ controls: {
8557
+ display: "flex";
8558
+ alignItems: "center";
8559
+ height: number;
8560
+ justifyContent: string;
8561
+ backgroundColor: string;
8562
+ border: string;
8563
+ gap: string;
8564
+ "&:has($dots)": {
8565
+ justifyContent: "center";
8566
+ };
8567
+ };
8568
+ pageCounter: {};
8569
+ main: {
8570
+ padding: number;
8571
+ display: "flex";
8572
+ flexDirection: "column";
8573
+ position: "relative";
8574
+ "&:hover $slideControls": {
8575
+ opacity: number;
8576
+ };
8577
+ };
8578
+ mainXs: {};
8579
+ mainFullscreen: {
8580
+ maxHeight: string;
8581
+ };
8582
+ counterContainer: {
8583
+ position: "absolute";
8584
+ top: string;
8585
+ right: string;
8586
+ zIndex: number;
8587
+ display: string;
8588
+ };
8589
+ counter: {
8590
+ color: string;
8591
+ backgroundColor: string;
8592
+ padding: string;
8593
+ };
8594
+ slideControls: {
8595
+ position: "absolute";
8596
+ left: number;
8597
+ right: number;
8598
+ top: string;
8599
+ padding: string;
8600
+ display: "flex";
8601
+ flexDirection: "row";
8602
+ alignItems: "center";
8603
+ justifyContent: "space-between";
8604
+ opacity: number;
8605
+ "& button": {
8606
+ zIndex: number;
8607
+ };
8608
+ "&:focus-within": {
8609
+ opacity: number;
8610
+ };
8611
+ };
8612
+ slidesViewport: {
8613
+ overflow: "hidden";
8614
+ };
8615
+ slidesContainer: {
8616
+ display: "flex";
8617
+ flexDirection: "row";
8618
+ height: string;
8619
+ };
8620
+ dots: {
8621
+ display: "flex";
8622
+ alignItems: "center";
8623
+ justifyContent: "center";
8624
+ gap: string;
8625
+ height: string;
8626
+ };
8627
+ dotsXs: {};
8628
+ dot: {
8629
+ width: number;
8630
+ height: number;
8631
+ margin: string;
8632
+ borderRadius: string;
8633
+ backgroundColor: string;
8634
+ };
8635
+ dotSelected: {
8636
+ width: number;
8637
+ height: number;
8638
+ backgroundColor: string;
8639
+ };
8640
+ panel: {
8641
+ display: "flex";
8642
+ width: string;
8643
+ overflowX: "auto";
8644
+ overflowY: "hidden";
8645
+ padding: string;
8646
+ };
8647
+ thumbnail: {
8648
+ height: string;
8649
+ padding: number;
8650
+ "& img": {
8651
+ width: string;
8652
+ height: string;
8653
+ textAlign: "center";
8654
+ aspectRatio: "16/9";
8655
+ opacity: "50%";
8656
+ borderRadius: string;
8657
+ };
8658
+ };
8659
+ thumbnailSelected: {
8660
+ "& img": {
8661
+ border: string;
8662
+ opacity: "100%";
8663
+ };
8664
+ };
8665
+ };
8666
+
8667
+ declare const styles_2: {
8668
+ slide: {};
8669
+ image: {
8670
+ aspectRatio: "16/9";
8671
+ width: string;
8672
+ height: string;
8673
+ };
8674
+ };
8675
+
8429
8676
  export declare const suggestionsClasses: {
8430
8677
  list: "HvSuggestions-list";
8431
8678
  root: "HvSuggestions-root";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "5.7.5",
3
+ "version": "5.8.1",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Core React components for the NEXT Design System.",
@@ -30,15 +30,16 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@emotion/cache": "^11.10.5",
33
- "@hitachivantara/uikit-react-icons": "^5.1.7",
34
- "@hitachivantara/uikit-react-shared": "^5.0.11",
35
- "@hitachivantara/uikit-styles": "^5.6.2",
33
+ "@hitachivantara/uikit-react-icons": "^5.1.8",
34
+ "@hitachivantara/uikit-react-shared": "^5.0.12",
35
+ "@hitachivantara/uikit-styles": "^5.7.0",
36
36
  "@popperjs/core": "^2.11.6",
37
37
  "@types/react-table": "^7.7.14",
38
38
  "attr-accept": "^2.2.2",
39
39
  "clsx": "^1.2.1",
40
40
  "dayjs": "^1.11.7",
41
41
  "detect-browser": "^5.3.0",
42
+ "embla-carousel-react": "^8.0.0-rc03",
42
43
  "hoist-non-react-statics": "^3.3.2",
43
44
  "lodash": "^4.17.21",
44
45
  "notistack": "^2.0.8",
@@ -57,7 +58,7 @@
57
58
  "access": "public",
58
59
  "directory": "package"
59
60
  },
60
- "gitHead": "f741d028c5523357e9cf472cd5a124cd395ebb22",
61
+ "gitHead": "26926baeded1a7e543655d96170f985bad7c4cbe",
61
62
  "main": "dist/cjs/index.cjs",
62
63
  "exports": {
63
64
  ".": {