@hitachivantara/app-shell-events 0.1.0 → 0.1.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.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @hitachivantara/app-shell-events
2
+
3
+ Hitachi Vantara App Shell Events. Type definitions for App Shell events ecosystem.
4
+
5
+ ## Overview
6
+
7
+ App Shell events mechanism is based at the usage of javascript's CustomEvent (for more detail check [here](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent)).
8
+ This package defines the set of possible `type` values and `options.detail` type definition.
9
+
10
+ ## Installation
11
+
12
+ The App Shell Events is available as an NPM package, and can be installed with:
13
+
14
+ ```bash
15
+ npm install @hitachivantara/app-shell-events
16
+ ```
17
+
18
+ More info about App Shell events is available in https://github.com/lumada-design/hv-app-shell/blob/main/docs/notifications.md#notifications and https://github.com/lumada-design/hv-app-shell/blob/main/docs/theming.md#triggering-color-mode-change.
@@ -6,15 +6,15 @@ import { SyntheticEvent } from 'react';
6
6
 
7
7
  export declare type HvAppShellEventNotification = {
8
8
  type: HvAppShellEventNotificationType;
9
- variant?: HvBannerVariant | HvSnackbarVariant;
10
9
  message?: string;
10
+ variant?: HvBannerVariant | HvSnackbarVariant;
11
11
  actions?: ReactNode | HvActionGeneric[];
12
12
  actionsCallback?: (event: SyntheticEvent<Element, Event>, id: string, action: HvActionGeneric) => void;
13
13
  };
14
14
 
15
15
  export declare const HvAppShellEventNotificationTrigger = "@hv/app-shell:notifications:trigger";
16
16
 
17
- declare type HvAppShellEventNotificationType = NOTIFICATION_TYPE.SNACKBAR | NOTIFICATION_TYPE.BANNER;
17
+ export declare type HvAppShellEventNotificationType = "snackbar" | "banner";
18
18
 
19
19
  export declare type HvAppShellEventTheme = {
20
20
  theme?: string;
@@ -23,9 +23,4 @@ export declare type HvAppShellEventTheme = {
23
23
 
24
24
  export declare const HvAppShellEventThemeTrigger = "@hv/app-shell:theme:trigger";
25
25
 
26
- export declare enum NOTIFICATION_TYPE {
27
- SNACKBAR = "SNACKBAR",
28
- BANNER = "BANNER"
29
- }
30
-
31
26
  export { }
package/dist/esm/index.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { HvAppShellEventThemeTrigger as o } from "./lib/types/theming.js";
2
- import { HvAppShellEventNotificationTrigger as t, NOTIFICATION_TYPE as T } from "./lib/types/notifications.js";
2
+ import { HvAppShellEventNotificationTrigger as t } from "./lib/types/notifications.js";
3
3
  export {
4
4
  t as HvAppShellEventNotificationTrigger,
5
- o as HvAppShellEventThemeTrigger,
6
- T as NOTIFICATION_TYPE
5
+ o as HvAppShellEventThemeTrigger
7
6
  };
8
7
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,5 @@
1
- const r = "@hv/app-shell:notifications:trigger";
2
- var i = /* @__PURE__ */ ((t) => (t.SNACKBAR = "SNACKBAR", t.BANNER = "BANNER", t))(i || {});
1
+ const i = "@hv/app-shell:notifications:trigger";
3
2
  export {
4
- r as HvAppShellEventNotificationTrigger,
5
- i as NOTIFICATION_TYPE
3
+ i as HvAppShellEventNotificationTrigger
6
4
  };
7
5
  //# sourceMappingURL=notifications.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sources":["../../../../src/lib/types/notifications.ts"],"sourcesContent":["import {\n HvActionGeneric,\n HvBannerVariant,\n HvSnackbarVariant\n} from \"@hitachivantara/uikit-react-core\";\nimport { ReactNode, SyntheticEvent } from \"react\";\n\nexport const HvAppShellEventNotificationTrigger =\n \"@hv/app-shell:notifications:trigger\";\n\nexport enum NOTIFICATION_TYPE {\n SNACKBAR = \"SNACKBAR\",\n BANNER = \"BANNER\"\n}\n\ntype HvAppShellEventNotificationType =\n | NOTIFICATION_TYPE.SNACKBAR\n | NOTIFICATION_TYPE.BANNER;\n\nexport type HvAppShellEventNotification = {\n type: HvAppShellEventNotificationType;\n variant?: HvBannerVariant | HvSnackbarVariant;\n message?: string;\n actions?: ReactNode | HvActionGeneric[];\n actionsCallback?: (\n event: SyntheticEvent<Element, Event>,\n id: string,\n action: HvActionGeneric\n ) => void;\n};\n"],"names":["HvAppShellEventNotificationTrigger","NOTIFICATION_TYPE","SNACKBAR","BANNER"],"mappings":"AAOO,MAAMA,IACX;AAEUC,IAAAA,sBAAAA,OACVC,EAAAA,WAAW,YACXC,EAAAA,SAAS,UAFCF,IAAAA,KAAAA,CAAAA,CAAAA;"}
1
+ {"version":3,"file":"notifications.js","sources":["../../../../src/lib/types/notifications.ts"],"sourcesContent":["import {\n HvActionGeneric,\n HvBannerVariant,\n HvSnackbarVariant\n} from \"@hitachivantara/uikit-react-core\";\nimport { ReactNode, SyntheticEvent } from \"react\";\n\nexport const HvAppShellEventNotificationTrigger =\n \"@hv/app-shell:notifications:trigger\";\n\nexport type HvAppShellEventNotificationType = \"snackbar\" | \"banner\";\n\nexport type HvAppShellEventNotification = {\n type: HvAppShellEventNotificationType;\n message?: string;\n variant?: HvBannerVariant | HvSnackbarVariant;\n actions?: ReactNode | HvActionGeneric[];\n actionsCallback?: (\n event: SyntheticEvent<Element, Event>,\n id: string,\n action: HvActionGeneric\n ) => void;\n};\n"],"names":["HvAppShellEventNotificationTrigger"],"mappings":"AAOO,MAAMA,IACX;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/app-shell-events",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "AppShell Events",
5
5
  "author": "Hitachi Vantara - Boba Fett Team",
6
6
  "license": "Apache-2.0",
@@ -45,5 +45,5 @@
45
45
  "vite-plugin-dts": "^3.6.4",
46
46
  "vite-tsconfig-paths": "^4.0.5"
47
47
  },
48
- "gitHead": "851f27979a0cd393a55e664d6c025839803ecfd4"
48
+ "gitHead": "5065d46d465674c03d798b3b3c58bf77e54a3e09"
49
49
  }