@agilant/toga-blox 1.0.19 → 1.0.21

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,4 +1,6 @@
1
1
  import React from "react";
2
2
  import { BadgeTypes } from "./Badge.types";
3
- declare const Badge: React.FC<BadgeTypes>;
3
+ declare const Badge: React.FC<BadgeTypes & {
4
+ styles?: React.CSSProperties;
5
+ }>;
4
6
  export default Badge;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const Badge = ({ borderColor, borderWidth, borderRadius, backgroundColor, hasMobileStyle, mobileIcon, mobileIconLabel, iconSize, hasLeftIcon, hasRightIcon, icon, image, text, badgeContainerClasses, }) => {
2
+ const Badge = ({ borderColor, borderWidth, borderRadius, backgroundColor, hasMobileStyle, mobileIcon, mobileIconLabel, iconSize, hasLeftIcon, hasRightIcon, icon, image, text, badgeContainerClasses, styles, }) => {
3
3
  const iconClasses = `${iconSize}`;
4
4
  const badgeBackgroundClasses = `${backgroundColor}`;
5
5
  const badgeBorderClasses = `${borderWidth} ${borderColor} ${borderRadius}`;
6
6
  const badgeClasses = `inline-flex items-center ${badgeBorderClasses} ${badgeBackgroundClasses} ${badgeContainerClasses}`;
7
- return (_jsxs("span", { "data-testid": "badge-test-id", className: badgeClasses, children: [image && _jsx("span", { className: "mr-2", children: image }), icon && hasLeftIcon && (_jsx("span", { className: `${iconClasses} max-md:hidden mr-2`, children: icon })), mobileIcon && hasMobileStyle && (_jsx("span", { className: `${iconClasses} hidden max-md:flex max-md:p-0 mr-2`, "aria-hidden": "false", "aria-label": mobileIconLabel, children: mobileIcon })), _jsx("div", { className: `${hasMobileStyle ? "max-md:hidden" : ""}`, children: text }), icon && hasRightIcon && (_jsx("span", { className: `${iconClasses} max-md:hidden ml-2`, children: icon }))] }));
7
+ return (_jsxs("span", { "data-testid": "badge-test-id", className: badgeClasses, style: styles, children: [image && _jsx("span", { className: "mr-2", children: image }), icon && hasLeftIcon && (_jsx("span", { className: `${iconClasses} max-md:hidden mr-2`, children: icon })), mobileIcon && hasMobileStyle && (_jsx("span", { className: `${iconClasses} hidden max-md:flex max-md:p-0 mr-2`, "aria-hidden": "false", "aria-label": mobileIconLabel, children: mobileIcon })), _jsx("div", { className: `${hasMobileStyle ? "max-md:hidden" : ""}`, children: text }), icon && hasRightIcon && (_jsx("span", { className: `${iconClasses} max-md:hidden ml-2`, children: icon }))] }));
8
8
  };
9
9
  export default Badge;
@@ -7,3 +7,4 @@ export declare const BadgeWithRightIcon: any;
7
7
  export declare const CommerceBadge: any;
8
8
  export declare const DeskBadge: any;
9
9
  export declare const SupplyBadge: any;
10
+ export declare const StylesBadge: any;
@@ -118,6 +118,10 @@ export default {
118
118
  control: "none",
119
119
  description: "Sets the text color of the badge using Tailwind CSS classes. Example: `text-gray-800`.",
120
120
  },
121
+ styles: {
122
+ control: "none",
123
+ description: "Sets the inline styles of the badge using direct inline styles",
124
+ },
121
125
  },
122
126
  tags: ["autodocs"],
123
127
  parameters: {
@@ -226,3 +230,21 @@ SupplyBadge.parameters = {
226
230
  },
227
231
  },
228
232
  };
233
+ export const StylesBadge = Template.bind({});
234
+ StylesBadge.args = {
235
+ backgroundColor: "bg-gray-300",
236
+ borderRadius: "rounded-full",
237
+ badgeContainerClasses: "px-3 py-1",
238
+ mobileIcon: getFontAwesomeIcon("calculator"),
239
+ icon: getFontAwesomeIcon("calculator"),
240
+ hasLeftIcon: true,
241
+ styles: { background: "#F8F8F9", padding: "1.5rem" },
242
+ text: (_jsx(Text, { color: "text-black", fontFamily: "font-serif", text: "Closed", tag: "span", size: "text-sm" })),
243
+ };
244
+ StylesBadge.parameters = {
245
+ docs: {
246
+ description: {
247
+ story: "The badges using the styles prop",
248
+ },
249
+ },
250
+ };
@@ -22,4 +22,5 @@ export interface BadgeTypes {
22
22
  badgeContainerClasses?: string;
23
23
  iconSize?: string;
24
24
  testId?: string;
25
+ styles?: React.CSSProperties;
25
26
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agilant/toga-blox",
3
3
  "private": false,
4
- "version": "1.0.19",
4
+ "version": "1.0.21",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",