storybook 9.0.0-rc.1 → 9.0.0-rc.3

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.
@@ -3,6 +3,14 @@ declare const REMOVE_HIGHLIGHT = "storybook/highlight/remove";
3
3
  declare const RESET_HIGHLIGHT = "storybook/highlight/reset";
4
4
  declare const SCROLL_INTO_VIEW = "storybook/highlight/scroll-into-view";
5
5
 
6
+ declare const iconPaths: {
7
+ chevronLeft: string[];
8
+ chevronRight: string[];
9
+ info: string[];
10
+ shareAlt: string[];
11
+ };
12
+ type IconName = keyof typeof iconPaths;
13
+
6
14
  interface HighlightParameters {
7
15
  /**
8
16
  * Highlight configuration
@@ -14,6 +22,22 @@ interface HighlightParameters {
14
22
  disable?: boolean;
15
23
  };
16
24
  }
25
+ interface HighlightMenuItem {
26
+ /** Unique identifier for the menu item */
27
+ id: string;
28
+ /** Title of the menu item */
29
+ title: string;
30
+ /** Description of the menu item */
31
+ description?: string;
32
+ /** Icon for the menu item, left side */
33
+ iconLeft?: IconName;
34
+ /** Icon for the menu item, right side */
35
+ iconRight?: IconName;
36
+ /** Name for a channel event to trigger when the menu item is clicked */
37
+ clickEvent?: string;
38
+ /** HTML selectors for which this menu item should show (subset of `selectors`) */
39
+ selectors?: HighlightOptions['selectors'];
40
+ }
17
41
  interface HighlightOptions {
18
42
  /** Unique identifier for the highlight, required if you want to remove the highlight later */
19
43
  id?: string;
@@ -29,19 +53,8 @@ interface HighlightOptions {
29
53
  focusStyles?: Record<string, string>;
30
54
  /** Keyframes required for animations */
31
55
  keyframes?: string;
32
- /** Menu items to show when the highlight is selected */
33
- menu?: {
34
- /** Unique identifier for the menu item */
35
- id: string;
36
- /** Title of the menu item */
37
- title: string;
38
- /** Description of the menu item */
39
- description?: string;
40
- /** Name for a channel event to trigger when the menu item is clicked */
41
- clickEvent?: string;
42
- /** HTML selectors for which this menu item should show (subset of `selectors`) */
43
- selectors?: string[];
44
- }[];
56
+ /** Groups of menu items to show when the highlight is selected */
57
+ menu?: HighlightMenuItem[][];
45
58
  }
46
59
  interface ClickEventDetails {
47
60
  top: number;
@@ -57,4 +70,4 @@ interface ClickEventDetails {
57
70
  };
58
71
  }
59
72
 
60
- export { type ClickEventDetails, HIGHLIGHT, type HighlightOptions, type HighlightParameters, REMOVE_HIGHLIGHT, RESET_HIGHLIGHT, SCROLL_INTO_VIEW };
73
+ export { type ClickEventDetails, HIGHLIGHT, type HighlightMenuItem, type HighlightOptions, type HighlightParameters, REMOVE_HIGHLIGHT, RESET_HIGHLIGHT, SCROLL_INTO_VIEW };
@@ -1,8 +1,8 @@
1
1
  // src/highlight/constants.ts
2
- var t = "storybook/highlight", o = `${t}/add`, H = `${t}/remove`, e = `${t}/reset`, I = `${t}/scroll-into-view`;
2
+ var t = "storybook/highlight", o = `${t}/add`, e = `${t}/remove`, H = `${t}/reset`, I = `${t}/scroll-into-view`;
3
3
  export {
4
4
  o as HIGHLIGHT,
5
- H as REMOVE_HIGHLIGHT,
6
- e as RESET_HIGHLIGHT,
5
+ e as REMOVE_HIGHLIGHT,
6
+ H as RESET_HIGHLIGHT,
7
7
  I as SCROLL_INTO_VIEW
8
8
  };