@appcorp/app-corp-vista 0.0.62 → 0.0.63

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.
@@ -9,8 +9,24 @@ var react_1 = __importDefault(require("react"));
9
9
  var react_2 = require("@headlessui/react");
10
10
  var outline_1 = require("@heroicons/react/24/outline");
11
11
  var solid_1 = require("@heroicons/react/20/solid");
12
+ var vista_notification_type_1 = require("../../type/vista-notification-type");
12
13
  var VistaNotificationV1 = function (_a) {
13
- var description = _a.description, handleIsVisible = _a.handleIsVisible, heading = _a.heading, isVisible = _a.isVisible;
14
+ var _b, _c;
15
+ var description = _a.description, handleIsVisible = _a.handleIsVisible, heading = _a.heading, isVisible = _a.isVisible, _d = _a.variant, variant = _d === void 0 ? vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.DEFAULT : _d;
16
+ var iconMap = (_b = {},
17
+ _b[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.DEFAULT] = react_1.default.createElement(outline_1.BellAlertIcon, { className: "size-6 text-purple-400" }),
18
+ _b[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.ERROR] = react_1.default.createElement(solid_1.XMarkIcon, { className: "size-6 text-red-400" }),
19
+ _b[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.INFO] = react_1.default.createElement(outline_1.InformationCircleIcon, { className: "size-6 text-sky-400" }),
20
+ _b[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.SUCCESS] = react_1.default.createElement(outline_1.CheckCircleIcon, { className: "size-6 text-green-400" }),
21
+ _b[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.WARNING] = react_1.default.createElement(outline_1.ExclamationTriangleIcon, { className: "size-6 text-amber-400" }),
22
+ _b);
23
+ var headingMap = (_c = {},
24
+ _c[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.DEFAULT] = 'Done',
25
+ _c[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.ERROR] = 'Error',
26
+ _c[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.INFO] = 'Info',
27
+ _c[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.SUCCESS] = 'Success',
28
+ _c[vista_notification_type_1.VISTA_NOTIFICATION_V1_VARIANT.WARNING] = 'Warning',
29
+ _c);
14
30
  return (react_1.default.createElement(react_1.default.Fragment, null,
15
31
  react_1.default.createElement("div", { "aria-live": "assertive", className: "pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6" },
16
32
  react_1.default.createElement("div", { className: "flex w-full flex-col items-center space-y-4 sm:items-end" },
@@ -18,10 +34,9 @@ var VistaNotificationV1 = function (_a) {
18
34
  react_1.default.createElement("div", { className: "pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow-lg ring-1 ring-black/5 transition data-[closed]:data-[enter]:translate-y-2 data-[enter]:transform data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-100 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:data-[enter]:sm:translate-x-2 data-[closed]:data-[enter]:sm:translate-y-0" },
19
35
  react_1.default.createElement("div", { className: "p-4" },
20
36
  react_1.default.createElement("div", { className: "flex items-start" },
21
- react_1.default.createElement("div", { className: "shrink-0" },
22
- react_1.default.createElement(outline_1.CheckCircleIcon, { "aria-hidden": "true", className: "size-6 text-green-400" })),
37
+ react_1.default.createElement("div", { className: "shrink-0" }, iconMap[variant]),
23
38
  react_1.default.createElement("div", { className: "ml-3 w-0 flex-1 pt-0.5" },
24
- react_1.default.createElement("p", { className: "text-sm font-medium text-gray-900 dark:text-white" }, heading),
39
+ react_1.default.createElement("p", { className: "text-sm font-medium text-gray-900 dark:text-white" }, heading || headingMap[variant]),
25
40
  react_1.default.createElement("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-200" }, description)),
26
41
  react_1.default.createElement("div", { className: "ml-4 flex shrink-0" },
27
42
  react_1.default.createElement("button", { type: "button", onClick: handleIsVisible, className: "inline-flex rounded-md bg-white dark:bg-gray-700 text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/app-corp-vista",
3
- "version": "0.0.62",
3
+ "version": "0.0.63",
4
4
  "scripts": {
5
5
  "build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib",
6
6
  "build:next": "next build",
@@ -6,11 +6,19 @@ export interface VistaNotificationV3ActionItemProps {
6
6
  handleOnClick: () => void;
7
7
  enabled: true;
8
8
  }
9
+ export declare enum VISTA_NOTIFICATION_V1_VARIANT {
10
+ DEFAULT = "DEFAULT",
11
+ ERROR = "ERROR",
12
+ INFO = "INFO",
13
+ SUCCESS = "SUCCESS",
14
+ WARNING = "WARNING"
15
+ }
9
16
  export interface VistaNotificationV1Props {
10
17
  description: string;
11
18
  handleIsVisible: () => void;
12
- heading: string;
19
+ heading?: string;
13
20
  isVisible: boolean;
21
+ variant?: VISTA_NOTIFICATION_V1_VARIANT;
14
22
  }
15
23
  export interface VistaNotificationV2Props {
16
24
  actionLabel: string;
@@ -1,2 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VISTA_NOTIFICATION_V1_VARIANT = void 0;
4
+ var VISTA_NOTIFICATION_V1_VARIANT;
5
+ (function (VISTA_NOTIFICATION_V1_VARIANT) {
6
+ VISTA_NOTIFICATION_V1_VARIANT["DEFAULT"] = "DEFAULT";
7
+ VISTA_NOTIFICATION_V1_VARIANT["ERROR"] = "ERROR";
8
+ VISTA_NOTIFICATION_V1_VARIANT["INFO"] = "INFO";
9
+ VISTA_NOTIFICATION_V1_VARIANT["SUCCESS"] = "SUCCESS";
10
+ VISTA_NOTIFICATION_V1_VARIANT["WARNING"] = "WARNING";
11
+ })(VISTA_NOTIFICATION_V1_VARIANT || (exports.VISTA_NOTIFICATION_V1_VARIANT = VISTA_NOTIFICATION_V1_VARIANT = {}));