@agilant/toga-blox 1.0.13 → 1.0.15

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.
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
3
3
  const Toaster = ({ message, additionalClasses, clearMessage, hasClearButton, statusProps = {
4
- colorClass: "bg-gray-100 border border-gray-500 text-gay-800",
4
+ colorClass: "bg-gray-100 border border-gray-500 text-gray-800",
5
5
  icon: { icon: "circleCheck", type: "solid" },
6
6
  }, }) => {
7
7
  const handleClearMessage = () => {
@@ -10,13 +10,13 @@ const Toaster = ({ message, additionalClasses, clearMessage, hasClearButton, sta
10
10
  clearMessage(true);
11
11
  }
12
12
  };
13
- // Pull out colorClass and icon from statusProps
14
13
  const { colorClass, icon: maybeIcon } = statusProps;
15
- // We'll combine colorClass with other container styles
16
14
  const containerClasses = colorClass ?? "";
17
- // Your existing custom classes
18
15
  const shadowClasses = `shadow-lg shadow-boxShadow rounded-lg`;
19
- const closeButtonClasses = `cursor-pointer text-xs ml-4`;
20
- return (_jsx("div", { "data-testid": "toaster-test-id", role: "alert", "aria-live": "polite", className: `${shadowClasses} ${containerClasses} ${additionalClasses}`, children: message.map((msg, index) => (_jsxs("div", { className: "flex items-center", children: [maybeIcon && (_jsx("div", { className: "mr-4", children: getFontAwesomeIcon(maybeIcon.icon, maybeIcon.type) })), _jsx("p", { className: index === 0 ? "font-semibold ml-2" : "ml-2", children: msg }), hasClearButton && (_jsx("div", { "data-testid": "clear-button", className: `${closeButtonClasses}`, onClick: handleClearMessage, children: getFontAwesomeIcon("x", "solid") }))] }, index))) }));
16
+ const closeButtonClasses = `cursor-pointer text-xs`;
17
+ const messageClasses = `grid grid-cols-[24px_1fr_24px] items-center gap-x-2`;
18
+ return (_jsx("div", { "data-testid": "toaster-test-id", role: "alert", "aria-live": "polite", className: `${shadowClasses} ${containerClasses} ${additionalClasses}`, children: message.map((msg, index) => (_jsxs("div", { className: messageClasses, children: [_jsx("div", { children: index === 0 && maybeIcon
19
+ ? getFontAwesomeIcon(maybeIcon.icon, maybeIcon.type)
20
+ : null }), _jsx("p", { className: index === 0 && "font-semibold", children: msg }), _jsx("div", { children: index === 0 && hasClearButton && (_jsx("div", { "data-testid": "clear-button", className: closeButtonClasses, onClick: handleClearMessage, children: getFontAwesomeIcon("x", "solid") })) })] }, index))) }));
21
21
  };
22
22
  export default Toaster;
@@ -21,3 +21,4 @@ export declare const WithIconAlert: any;
21
21
  * HasClearMessage
22
22
  */
23
23
  export declare const HasClearMessage: any;
24
+ export declare const hasMultipleMessages: any;
@@ -98,5 +98,19 @@ HasClearMessage.args = {
98
98
  colorClass: "bg-orange-100 border border-orange-500 text-orange-800",
99
99
  icon: { icon: "circleCheck", type: "solid" },
100
100
  },
101
- additionalClasses: "py-2 px-5",
101
+ additionalClasses: "py-2 px-5 min-w-96",
102
+ };
103
+ export const hasMultipleMessages = Template.bind({});
104
+ hasMultipleMessages.args = {
105
+ message: ["Message One", "Message Two", "Message Three"],
106
+ hasClearButton: true,
107
+ clearMessage: () => {
108
+ alert("Message Cleared!");
109
+ },
110
+ statusProps: {
111
+ // Orange variant
112
+ colorClass: "bg-orange-100 border border-orange-500 text-orange-800",
113
+ icon: { icon: "circleCheck", type: "solid" },
114
+ },
115
+ additionalClasses: "py-2 px-5 min-w-96",
102
116
  };
@@ -1,7 +1,7 @@
1
1
  interface StatusProps {
2
2
  icon?: {
3
3
  icon: string;
4
- type: "solid" | "regular";
4
+ type: "solid" | "regular" | "light" | "duotone";
5
5
  };
6
6
  colorClass?: string;
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agilant/toga-blox",
3
3
  "private": false,
4
- "version": "1.0.13",
4
+ "version": "1.0.15",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",