@hitachivantara/uikit-react-pentaho 0.2.0 → 0.4.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 (41) hide show
  1. package/dist/cjs/Canvas/BottomPanel/BottomPanel.cjs +66 -27
  2. package/dist/cjs/Canvas/BottomPanel/BottomPanel.styles.cjs +15 -8
  3. package/dist/cjs/Canvas/SidePanel/SidePanel.cjs +5 -11
  4. package/dist/cjs/Canvas/SidePanel/SidePanel.styles.cjs +0 -10
  5. package/dist/cjs/Canvas/ToolbarTabs/ToolbarTabs.cjs +262 -0
  6. package/dist/cjs/Canvas/ToolbarTabs/ToolbarTabs.styles.cjs +123 -0
  7. package/dist/cjs/Card/Card.cjs +18 -0
  8. package/dist/cjs/Card/Card.styles.cjs +16 -0
  9. package/dist/cjs/Card/CardMedia/CardMedia.cjs +33 -0
  10. package/dist/cjs/Card/CardMedia/CardMedia.styles.cjs +12 -0
  11. package/dist/cjs/Card/CardSection/CardSection.cjs +19 -0
  12. package/dist/cjs/Card/CardSection/CardSection.styles.cjs +10 -0
  13. package/dist/cjs/index.cjs +16 -0
  14. package/dist/esm/Canvas/BottomPanel/BottomPanel.js +67 -28
  15. package/dist/esm/Canvas/BottomPanel/BottomPanel.js.map +1 -1
  16. package/dist/esm/Canvas/BottomPanel/BottomPanel.styles.js +16 -9
  17. package/dist/esm/Canvas/BottomPanel/BottomPanel.styles.js.map +1 -1
  18. package/dist/esm/Canvas/SidePanel/SidePanel.js +7 -13
  19. package/dist/esm/Canvas/SidePanel/SidePanel.js.map +1 -1
  20. package/dist/esm/Canvas/SidePanel/SidePanel.styles.js +1 -11
  21. package/dist/esm/Canvas/SidePanel/SidePanel.styles.js.map +1 -1
  22. package/dist/esm/Canvas/ToolbarTabs/ToolbarTabs.js +263 -0
  23. package/dist/esm/Canvas/ToolbarTabs/ToolbarTabs.js.map +1 -0
  24. package/dist/esm/Canvas/ToolbarTabs/ToolbarTabs.styles.js +123 -0
  25. package/dist/esm/Canvas/ToolbarTabs/ToolbarTabs.styles.js.map +1 -0
  26. package/dist/esm/Card/Card.js +19 -0
  27. package/dist/esm/Card/Card.js.map +1 -0
  28. package/dist/esm/Card/Card.styles.js +16 -0
  29. package/dist/esm/Card/Card.styles.js.map +1 -0
  30. package/dist/esm/Card/CardMedia/CardMedia.js +34 -0
  31. package/dist/esm/Card/CardMedia/CardMedia.js.map +1 -0
  32. package/dist/esm/Card/CardMedia/CardMedia.styles.js +12 -0
  33. package/dist/esm/Card/CardMedia/CardMedia.styles.js.map +1 -0
  34. package/dist/esm/Card/CardSection/CardSection.js +20 -0
  35. package/dist/esm/Card/CardSection/CardSection.js.map +1 -0
  36. package/dist/esm/Card/CardSection/CardSection.styles.js +10 -0
  37. package/dist/esm/Card/CardSection/CardSection.styles.js.map +1 -0
  38. package/dist/esm/index.js +17 -1
  39. package/dist/esm/index.js.map +1 -1
  40. package/dist/types/index.d.ts +201 -9
  41. package/package.json +4 -4
@@ -1,3 +1,4 @@
1
+ import { ComponentProps } from 'react';
1
2
  import { CSSInterpolation } from '@emotion/serialize';
2
3
  import { ExtractNames } from '@hitachivantara/uikit-react-core';
3
4
  import { ForwardRefExoticComponent } from 'react';
@@ -5,6 +6,10 @@ import { HvActionGeneric } from '@hitachivantara/uikit-react-core';
5
6
  import { HvActionsGenericProps } from '@hitachivantara/uikit-react-core';
6
7
  import { HvBaseProps } from '@hitachivantara/uikit-react-core';
7
8
  import { HvIconButtonProps } from '@hitachivantara/uikit-react-core';
9
+ import { PolymorphicComponentRef } from '@hitachivantara/uikit-react-core';
10
+ import { PolymorphicRef } from '@hitachivantara/uikit-react-core';
11
+ import { PropsWithoutRef } from 'react';
12
+ import { ReactNode } from 'react';
8
13
  import { RefAttributes } from 'react';
9
14
  import { TabProps } from '@mui/base/Tab';
10
15
  import { TabsProps } from '@mui/base/Tabs';
@@ -14,6 +19,7 @@ export declare const canvasBottomPanelClasses: {
14
19
  root: "HvCanvasBottomPanel-root";
15
20
  tab: "HvCanvasBottomPanel-tab";
16
21
  closed: "HvCanvasBottomPanel-closed";
22
+ actionsDisabled: "HvCanvasBottomPanel-actionsDisabled";
17
23
  minimized: "HvCanvasBottomPanel-minimized";
18
24
  multipleTabs: "HvCanvasBottomPanel-multipleTabs";
19
25
  overflowing: "HvCanvasBottomPanel-overflowing";
@@ -39,7 +45,6 @@ export declare const canvasSidePanelClasses: {
39
45
  close: "HvCanvasSidePanel-close";
40
46
  handle: "HvCanvasSidePanel-handle";
41
47
  tabs: "HvCanvasSidePanel-tabs";
42
- handleButton: "HvCanvasSidePanel-handleButton";
43
48
  handleOpen: "HvCanvasSidePanel-handleOpen";
44
49
  handleClose: "HvCanvasSidePanel-handleClose";
45
50
  };
@@ -51,6 +56,34 @@ export declare const canvasToolbarClasses: {
51
56
  back: "HvCanvasToolbar-back";
52
57
  };
53
58
 
59
+ export declare const canvasToolbarTabsClasses: {
60
+ root: "HvCanvasToolbarTabs-root";
61
+ actionsContainer: "HvCanvasToolbarTabs-actionsContainer";
62
+ tab: "HvCanvasToolbarTabs-tab";
63
+ dropdownMenu: "HvCanvasToolbarTabs-dropdownMenu";
64
+ closeButton: "HvCanvasToolbarTabs-closeButton";
65
+ tabsContainer: "HvCanvasToolbarTabs-tabsContainer";
66
+ tabsList: "HvCanvasToolbarTabs-tabsList";
67
+ tabContent: "HvCanvasToolbarTabs-tabContent";
68
+ tabIcon: "HvCanvasToolbarTabs-tabIcon";
69
+ tabLabel: "HvCanvasToolbarTabs-tabLabel";
70
+ activeTabLabel: "HvCanvasToolbarTabs-activeTabLabel";
71
+ tabDivider: "HvCanvasToolbarTabs-tabDivider";
72
+ };
73
+
74
+ export declare const cardClasses: {
75
+ root: "HvCard-root";
76
+ };
77
+
78
+ export declare const cardMediaClasses: {
79
+ root: "HvCardMedia-root";
80
+ image: "HvCardMedia-image";
81
+ };
82
+
83
+ export declare const cardSectionClasses: {
84
+ root: "HvCardSection-root";
85
+ };
86
+
54
87
  declare const DEFAULT_LABELS: {
55
88
  open: string;
56
89
  close: string;
@@ -60,6 +93,13 @@ declare const DEFAULT_LABELS_2: {
60
93
  back: string;
61
94
  };
62
95
 
96
+ declare const DEFAULT_LABELS_3: {
97
+ create: string;
98
+ undefined: string;
99
+ close: string;
100
+ dropdownMenu: string;
101
+ };
102
+
63
103
  /**
64
104
  * A bottom panel component to use in a canvas context.
65
105
  */
@@ -75,17 +115,30 @@ export declare interface HvCanvasBottomPanelProps extends HvBaseProps {
75
115
  /** List of tabs visible on the panel. */
76
116
  tabs: {
77
117
  id: string | number;
78
- title: React.ReactNode;
118
+ title: React.ReactNode | ((overflowing: boolean) => React.ReactNode);
79
119
  }[];
80
120
  /** Id of the selected tab if it needs to be controlled. */
81
- tab?: string | number;
121
+ selectedTabId?: string | number;
82
122
  /** Callback triggered when a tab changes/is clicked. */
83
123
  onTabChange?: (event: React.SyntheticEvent | null, tabId: string | number | null) => void;
84
- /** Actions to be rendered in the left side of a tab. If more than one action is provided, a dropdown menu will be used. */
124
+ /**
125
+ * Actions to be rendered in the left side of a tab.
126
+ * If more than one action is provided, a dropdown menu will be used.
127
+ * These actions are not shown when the tab content is overflowing.
128
+ */
85
129
  leftActions?: HvActionsGenericProps["actions"];
86
- /** Actions to be rendered in the right side of a tab.If more than two actions are provided, a dropdown menu will be used to add the remaining actions. */
130
+ /**
131
+ * Actions to be rendered in the right side of a tab.
132
+ * If more than two actions are provided, a dropdown menu will be used to display the remaining actions.
133
+ * These actions are not shown when the tab content is overflowing.
134
+ */
87
135
  rightActions?: HvActionsGenericProps["actions"];
88
- /** Callback triggered when a right or left action is clicked. */
136
+ /**
137
+ * Actions to be rendered in the right side of a tab when the tab content is overflowing.
138
+ * These actions will replace both `leftActions` and `rightActions`.
139
+ */
140
+ overflowActions?: HvActionsGenericProps["actions"];
141
+ /** Callback triggered when an action is clicked. */
89
142
  onAction?: (event: React.SyntheticEvent, action: HvActionGeneric, tabId: string | number) => void;
90
143
  /** A Jss Object used to override or extend the styles applied. */
91
144
  classes?: HvCanvasBottomPanelClasses;
@@ -167,12 +220,96 @@ export declare interface HvCanvasToolbarProps extends HvBaseProps<HTMLDivElement
167
220
  classes?: HvCanvasToolbarClasses;
168
221
  }
169
222
 
170
- declare const useClasses: (classesProp?: Partial<Record<"content" | "root" | "tab" | "closed" | "minimized" | "multipleTabs" | "overflowing" | "tabTitle" | "tabsRoot" | "leftActions" | "rightActions", string>>, addStatic?: boolean) => {
223
+ /**
224
+ * A toolbar tabs component to use in a canvas context.
225
+ */
226
+ export declare const HvCanvasToolbarTabs: ForwardRefExoticComponent<HvCanvasToolbarTabsProps & RefAttributes<HTMLDivElement>>;
227
+
228
+ export declare type HvCanvasToolbarTabsClasses = ExtractNames<typeof useClasses_6>;
229
+
230
+ export declare interface HvCanvasToolbarTabsProps extends HvBaseProps<HTMLDivElement, "onChange"> {
231
+ /** When controlled, defines the tabs. */
232
+ tabs?: ToolbarTabsTab[];
233
+ /** When uncontrolled, defines the initial tabs. */
234
+ defaultTabs?: ToolbarTabsTab[];
235
+ /** Id of the selected tab if it needs to be controlled. */
236
+ selectedTabId?: string;
237
+ /** Defines the icon to be placed before the label when a new tab is created. If not defined, no icon is used. */
238
+ icon?: React.ReactNode;
239
+ /** Callback triggered when a tab changes/is clicked. */
240
+ onTabChange?: (event: React.SyntheticEvent | null, tabId: string | null) => void;
241
+ /** Callback triggered when the tabs change: new tab added, tab removed, tab reorder, and label updated. */
242
+ onChange?: (event: React.MouseEvent<HTMLButtonElement> | React.SyntheticEvent, tabs: ToolbarTabsTab[]) => void;
243
+ /** An object containing all the labels. */
244
+ labels?: Partial<typeof DEFAULT_LABELS_3>;
245
+ /** A Jss Object used to override or extend the styles applied. */
246
+ classes?: HvCanvasToolbarTabsClasses;
247
+ }
248
+
249
+ /**
250
+ * The Pentaho Card component.
251
+ */
252
+ export declare const HvCard: <C extends React.ElementType = "div">(props: {
253
+ /** A Jss Object used to override or extend the styles applied. */
254
+ classes?: HvCardClasses;
255
+ } & {
256
+ component?: C | undefined;
257
+ } & {
258
+ children?: ReactNode | undefined;
259
+ } & (Omit<PropsWithoutRef<ComponentProps<C>>, "classes" | "component"> extends infer T ? T extends Omit<PropsWithoutRef<ComponentProps<C>>, "classes" | "component"> ? T extends any ? T : never : never : never) & {
260
+ ref?: PolymorphicRef<C> | undefined;
261
+ } & RefAttributes<unknown>) => React.ReactElement | null;
262
+
263
+ export declare type HvCardClasses = ExtractNames<typeof useClasses_7>;
264
+
265
+ /**
266
+ * A subcomponent to be used within the `HvCard` component. This component is used to display an image within the card.
267
+ */
268
+ export declare const HvCardMedia: ForwardRefExoticComponent<HvCardMediaProps & RefAttributes<HTMLImageElement>>;
269
+
270
+ export declare type HvCardMediaClasses = ExtractNames<typeof useClasses_8>;
271
+
272
+ export declare interface HvCardMediaProps extends HvBaseProps<HTMLImageElement> {
273
+ /** The source for the image to use in the card. */
274
+ src: string;
275
+ /** The height of the image container. */
276
+ height?: number;
277
+ /** A text alternative to the image. */
278
+ alt?: string;
279
+ /** A Jss Object used to override or extend the styles applied. */
280
+ classes?: HvCardMediaClasses;
281
+ }
282
+
283
+ export declare type HvCardProps<C extends React.ElementType = "div"> = PolymorphicComponentRef<C, {
284
+ /** A Jss Object used to override or extend the styles applied. */
285
+ classes?: HvCardClasses;
286
+ }>;
287
+
288
+ /**
289
+ * A subcomponent to be used within the `HvCard` component. This component is used to display content on the card.
290
+ */
291
+ export declare const HvCardSection: ForwardRefExoticComponent<HvCardSectionProps & RefAttributes<HTMLDivElement>>;
292
+
293
+ export declare type HvCardSectionClasses = ExtractNames<typeof useClasses_9>;
294
+
295
+ export declare interface HvCardSectionProps extends HvBaseProps {
296
+ /** A Jss Object used to override or extend the styles applied. */
297
+ classes?: HvCardSectionClasses;
298
+ }
299
+
300
+ declare interface ToolbarTabsTab {
301
+ id: string;
302
+ label: string;
303
+ icon?: React.ReactNode;
304
+ }
305
+
306
+ declare const useClasses: (classesProp?: Partial<Record<"content" | "root" | "tab" | "closed" | "actionsDisabled" | "minimized" | "multipleTabs" | "overflowing" | "tabTitle" | "tabsRoot" | "leftActions" | "rightActions", string>>, addStatic?: boolean) => {
171
307
  classes: {
172
308
  content: string;
173
309
  root: string;
174
310
  tab: string;
175
311
  closed: string;
312
+ actionsDisabled: string;
176
313
  minimized: string;
177
314
  multipleTabs: string;
178
315
  overflowing: string;
@@ -211,7 +348,7 @@ declare const useClasses_3: (classesProp?: Partial<Record<"root" | "list", strin
211
348
  cx: (...args: any) => string;
212
349
  };
213
350
 
214
- declare const useClasses_4: (classesProp?: Partial<Record<"content" | "root" | "open" | "close" | "handle" | "tabs" | "handleButton" | "handleOpen" | "handleClose", string>>, addStatic?: boolean) => {
351
+ declare const useClasses_4: (classesProp?: Partial<Record<"content" | "root" | "open" | "close" | "handle" | "tabs" | "handleOpen" | "handleClose", string>>, addStatic?: boolean) => {
215
352
  classes: {
216
353
  content: string;
217
354
  root: string;
@@ -219,7 +356,6 @@ declare const useClasses_4: (classesProp?: Partial<Record<"content" | "root" | "
219
356
  close: string;
220
357
  handle: string;
221
358
  tabs: string;
222
- handleButton: string;
223
359
  handleOpen: string;
224
360
  handleClose: string;
225
361
  };
@@ -244,4 +380,60 @@ declare const useClasses_5: (classesProp?: Partial<Record<"root" | "title" | "ac
244
380
  cx: (...args: any) => string;
245
381
  };
246
382
 
383
+ declare const useClasses_6: (classesProp?: Partial<Record<"root" | "actionsContainer" | "tab" | "dropdownMenu" | "closeButton" | "tabsContainer" | "tabsList" | "tabContent" | "tabIcon" | "tabLabel" | "activeTabLabel" | "tabDivider", string>>, addStatic?: boolean) => {
384
+ classes: {
385
+ root: string;
386
+ actionsContainer: string;
387
+ tab: string;
388
+ dropdownMenu: string;
389
+ closeButton: string;
390
+ tabsContainer: string;
391
+ tabsList: string;
392
+ tabContent: string;
393
+ tabIcon: string;
394
+ tabLabel: string;
395
+ activeTabLabel: string;
396
+ tabDivider: string;
397
+ };
398
+ css: {
399
+ (template: TemplateStringsArray, ...args: CSSInterpolation[]): string;
400
+ (...args: CSSInterpolation[]): string;
401
+ };
402
+ cx: (...args: any) => string;
403
+ };
404
+
405
+ declare const useClasses_7: (classesProp?: Partial<Record<"root", string>>, addStatic?: boolean) => {
406
+ classes: {
407
+ root: string;
408
+ };
409
+ css: {
410
+ (template: TemplateStringsArray, ...args: CSSInterpolation[]): string;
411
+ (...args: CSSInterpolation[]): string;
412
+ };
413
+ cx: (...args: any) => string;
414
+ };
415
+
416
+ declare const useClasses_8: (classesProp?: Partial<Record<"root" | "image", string>>, addStatic?: boolean) => {
417
+ classes: {
418
+ root: string;
419
+ image: string;
420
+ };
421
+ css: {
422
+ (template: TemplateStringsArray, ...args: CSSInterpolation[]): string;
423
+ (...args: CSSInterpolation[]): string;
424
+ };
425
+ cx: (...args: any) => string;
426
+ };
427
+
428
+ declare const useClasses_9: (classesProp?: Partial<Record<"root", string>>, addStatic?: boolean) => {
429
+ classes: {
430
+ root: string;
431
+ };
432
+ css: {
433
+ (template: TemplateStringsArray, ...args: CSSInterpolation[]): string;
434
+ (...args: CSSInterpolation[]): string;
435
+ };
436
+ cx: (...args: any) => string;
437
+ };
438
+
247
439
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-pentaho",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "UI Kit Pentaho+ React components.",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@emotion/css": "^11.11.0",
33
- "@hitachivantara/uikit-react-core": "^5.66.14",
34
- "@hitachivantara/uikit-react-icons": "^5.10.5",
33
+ "@hitachivantara/uikit-react-core": "^5.67.0",
34
+ "@hitachivantara/uikit-react-icons": "^5.10.6",
35
35
  "@mui/base": "^5.0.0-beta.40",
36
36
  "react-resize-detector": "^8.1.0"
37
37
  },
@@ -42,7 +42,7 @@
42
42
  "access": "public",
43
43
  "directory": "package"
44
44
  },
45
- "gitHead": "143286b6fdeed50a3265683bebb09dba16ab0395",
45
+ "gitHead": "289001faba5169368b09237c91c3ea5adc9bf75b",
46
46
  "exports": {
47
47
  ".": {
48
48
  "require": "./dist/cjs/index.cjs",