@brainfish-ai/components 0.22.8 → 0.22.9

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.
@@ -1433,30 +1433,31 @@ const generatingStarVariants = cva("min-w-5", {
1433
1433
  variant: "default"
1434
1434
  }
1435
1435
  });
1436
- const TRANSFORM_MATRIX = "matrix(0 0.0120051 -0.0120051 0 16.0051 16.0051)";
1437
- const FOREIGN_OBJECT_PROPS = {
1438
- x: "-1083.3",
1439
- y: "-1083.3",
1440
- width: "2166.6",
1441
- height: "2166.6"
1442
- };
1443
1436
  const STAR_OUTER_PATH = "M16.0127 3.5C16.5221 3.50002 17.0197 3.65584 17.4375 3.94727C17.8553 4.23871 18.1736 4.65182 18.3496 5.12988L20.6445 11.3652L26.876 13.6689L27.0283 13.7246L27.0391 13.7402C27.4497 13.9244 27.8038 14.2171 28.0625 14.5879C28.3539 15.0057 28.5098 15.5032 28.5098 16.0127C28.5097 16.5221 28.3539 17.0197 28.0625 17.4375C27.7711 17.8552 27.3579 18.1737 26.8799 18.3496L20.6426 20.6445L18.334 26.8809C18.158 27.3587 17.8396 27.7712 17.4219 28.0625C17.0042 28.3538 16.5073 28.5097 15.998 28.5098C15.4886 28.5098 14.9911 28.3539 14.5732 28.0625C14.1554 27.771 13.8371 27.358 13.6611 26.8799L11.3652 20.6436L5.12891 18.334V18.333C4.65135 18.1569 4.23846 17.8394 3.94727 17.4219C3.65606 17.0042 3.5001 16.5072 3.5 15.998C3.5 15.4887 3.65596 14.991 3.94727 14.5732C4.2387 14.1554 4.65182 13.8371 5.12988 13.6611L11.3652 11.3652L13.6758 5.12891C13.8518 4.65116 14.1703 4.23855 14.5879 3.94727C15.0057 3.65585 15.5033 3.5 16.0127 3.5ZM13.9463 13.0498L13.9473 13.0508C13.8723 13.2565 13.7535 13.4438 13.5986 13.5986C13.4438 13.7535 13.2565 13.8723 13.0508 13.9473L13.0498 13.9463L7.46875 16.0049L13.0498 18.0625H13.0508C13.2564 18.1374 13.4438 18.2564 13.5986 18.4111C13.7529 18.5654 13.8713 18.7521 13.9463 18.957L16.0049 24.541L18.0684 18.9521L18.1328 18.8027C18.2049 18.6578 18.3001 18.5251 18.415 18.4102C18.5684 18.2568 18.7535 18.1385 18.957 18.0635L24.541 16.0049L18.9521 13.9414C18.7486 13.8664 18.5636 13.7481 18.4102 13.5947C18.2568 13.4413 18.1385 13.2563 18.0635 13.0527L16.0049 7.46875L13.9463 13.0498Z";
1444
1437
  const STAR_INNER_PATH = "M13.9463 13.0498L13.9473 13.0508C13.8723 13.2565 13.7535 13.4438 13.5986 13.5986C13.4438 13.7535 13.2565 13.8723 13.0508 13.9473L13.0498 13.9463L7.46875 16.0049L13.0498 18.0625H13.0508C13.2564 18.1374 13.4438 18.2564 13.5986 18.4111C13.7529 18.5654 13.8713 18.7521 13.9463 18.957L16.0049 24.541L18.0684 18.9521L18.1328 18.8027C18.2049 18.6578 18.3001 18.5251 18.415 18.4102C18.5684 18.2568 18.7535 18.1385 18.957 18.0635L24.541 16.0049L18.9521 13.9414C18.7486 13.8664 18.5636 13.7481 18.4102 13.5947C18.2568 13.4413 18.1385 13.2563 18.0635 13.0527L16.0049 7.46875L13.9463 13.0498Z";
1445
1438
  const BLUE_STAR_PATH = "M31.7071 9.70711C31.8946 9.51957 32 9.26522 32 9C32 8.73478 31.8946 8.48043 31.7071 8.29289C31.5196 8.10536 31.2652 8 31 8H30V7C30 6.73478 29.8946 6.48043 29.7071 6.29289C29.5196 6.10536 29.2652 6 29 6C28.7348 6 28.4804 6.10536 28.2929 6.29289C28.1054 6.48043 28 6.73478 28 7V8H27C26.7348 8 26.4804 8.10536 26.2929 8.29289C26.1054 8.48043 26 8.73478 26 9C26 9.26522 26.1054 9.51957 26.2929 9.70711C26.4804 9.89464 26.7348 10 27 10H28V11C28 11.2652 28.1054 11.5196 28.2929 11.7071C28.4804 11.8946 28.7348 12 29 12C29.2652 12 29.5196 11.8946 29.7071 11.7071C29.8946 11.5196 30 11.2652 30 11V10H31C31.2652 10 31.5196 9.89464 31.7071 9.70711Z";
1446
1439
  const GREEN_STAR_PATH = "M19.2929 3.29289C19.1054 3.48043 19 3.73478 19 4C19 4.26522 19.1054 4.51957 19.2929 4.70711C19.4804 4.89464 19.7348 5 20 5H22V7C22 7.26522 22.1054 7.51957 22.2929 7.70711C22.4804 7.89464 22.7348 8 23 8C23.2652 8 23.5196 7.89464 23.7071 7.70711C23.8946 7.51957 24 7.26522 24 7V5H26C26.2652 5 26.5196 4.89464 26.7071 4.70711C26.8946 4.51957 27 4.26522 27 4C27 3.73478 26.8946 3.48043 26.7071 3.29289C26.5196 3.10536 26.2652 3 26 3H24V1C24 0.734784 23.8946 0.48043 23.7071 0.292893C23.5196 0.105357 23.2652 0 23 0C22.7348 0 22.4804 0.105357 22.2929 0.292893C22.1054 0.48043 22 0.734784 22 1V3H20C19.7348 3 19.4804 3.10536 19.2929 3.29289Z";
1447
- function ClippedBackground({
1448
- clipPathId,
1449
- className,
1450
- loading
1451
- }) {
1452
- return /* @__PURE__ */ React__default.createElement("g", { clipPath: `url(#${clipPathId})`, className: cn({ "animate-spin": loading }) }, /* @__PURE__ */ React__default.createElement("g", { transform: TRANSFORM_MATRIX }, /* @__PURE__ */ React__default.createElement("foreignObject", { ...FOREIGN_OBJECT_PROPS }, /* @__PURE__ */ React__default.createElement("div", { className: cn(className, loading && "animate-spin") }))));
1453
- }
1440
+ const GRADIENT_STOPS = [
1441
+ { offset: "0%", color: "rgba(232, 122, 249, 1)" },
1442
+ { offset: "14%", color: "rgba(251, 191, 37, 1)" },
1443
+ { offset: "33%", color: "rgba(251, 146, 61, 1)" },
1444
+ { offset: "51%", color: "rgba(244, 64, 94, 1)" },
1445
+ { offset: "68%", color: "rgba(140, 93, 246, 1)" },
1446
+ { offset: "83%", color: "rgba(60, 130, 246, 1)" },
1447
+ { offset: "100%", color: "rgba(232, 122, 249, 1)" }
1448
+ ];
1454
1449
  function GeneratingStar({ loading, variant, className, ...props }) {
1455
1450
  const strokeColor = useAccessibleColor("--bfc-primary", "--bfc-border");
1456
1451
  const isGradient = variant === "gradient" /* GRADIENT */;
1457
1452
  const isDisabled = variant === "disabled" /* DISABLED */;
1458
1453
  const isDefault = !isGradient && !isDisabled;
1459
- const clipPathId = useId();
1454
+ const gradientId = useId();
1455
+ const getBackgroundFill = () => {
1456
+ if (isGradient) return `url(#${gradientId})`;
1457
+ if (isDisabled) return "var(--bfc-v2-color-mono-600)";
1458
+ if (strokeColor !== "var(--bfc-primary)") return "var(--bfc-border)";
1459
+ return "var(--bfc-primary)";
1460
+ };
1460
1461
  const getDecorativeStarFill = (gradientColor) => {
1461
1462
  if (isGradient) return gradientColor;
1462
1463
  if (isDisabled) return "var(--bfc-v2-color-mono-600)";
@@ -1474,25 +1475,27 @@ function GeneratingStar({ loading, variant, className, ...props }) {
1474
1475
  ...props
1475
1476
  },
1476
1477
  /* @__PURE__ */ React__default.createElement(
1477
- ClippedBackground,
1478
+ "path",
1479
+ {
1480
+ d: STAR_OUTER_PATH,
1481
+ fill: getBackgroundFill(),
1482
+ className: cn({ "animate-spin [transform-box:fill-box]": loading })
1483
+ }
1484
+ ),
1485
+ /* @__PURE__ */ React__default.createElement(
1486
+ "path",
1478
1487
  {
1479
- clipPathId,
1480
- className: cn("sparkle", {
1481
- "gradient": isGradient,
1482
- "bg-dark-600": isDisabled,
1483
- "bg-border": isDefault && strokeColor !== "var(--bfc-primary)",
1484
- "bg-primary": isDefault && strokeColor === "var(--bfc-primary)"
1485
- }),
1486
- loading
1488
+ stroke: "var(--bfc-v2-color-mono-100)",
1489
+ className: cn({ "animate-spin [transform-box:fill-box]": loading }),
1490
+ d: STAR_OUTER_PATH
1487
1491
  }
1488
1492
  ),
1489
- /* @__PURE__ */ React__default.createElement("path", { stroke: "var(--bfc-v2-color-mono-100)", className: cn({ "animate-spin": loading }), d: STAR_OUTER_PATH }),
1490
- isDefault && /* @__PURE__ */ React__default.createElement("g", { className: "transform origin-center scale-125" }, /* @__PURE__ */ React__default.createElement("g", { className: cn({ "animate-spin": loading }) }, /* @__PURE__ */ React__default.createElement("path", { fill: "var(--bfc-primary)", d: STAR_INNER_PATH }))),
1493
+ isDefault && /* @__PURE__ */ React__default.createElement("g", { className: "transform origin-center scale-125" }, /* @__PURE__ */ React__default.createElement("g", { className: cn({ "animate-spin [transform-box:fill-box]": loading }) }, /* @__PURE__ */ React__default.createElement("path", { fill: "var(--bfc-primary)", d: STAR_INNER_PATH }))),
1491
1494
  /* @__PURE__ */ React__default.createElement("path", { fill: getDecorativeStarFill("#3C82F6"), d: BLUE_STAR_PATH }),
1492
1495
  /* @__PURE__ */ React__default.createElement("path", { fill: getDecorativeStarFill("#35D399"), d: GREEN_STAR_PATH }),
1493
- /* @__PURE__ */ React__default.createElement("defs", null, /* @__PURE__ */ React__default.createElement("clipPath", { id: clipPathId }, /* @__PURE__ */ React__default.createElement("path", { d: STAR_OUTER_PATH })))
1496
+ isGradient && /* @__PURE__ */ React__default.createElement("defs", null, /* @__PURE__ */ React__default.createElement("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%" }, GRADIENT_STOPS.map((stop) => /* @__PURE__ */ React__default.createElement("stop", { key: stop.offset, offset: stop.offset, stopColor: stop.color }))))
1494
1497
  );
1495
1498
  }
1496
1499
 
1497
1500
  export { GeneratingStar as G, generatingStarVariants as g };
1498
- //# sourceMappingURL=generating-star.BMQgTqs7.js.map
1501
+ //# sourceMappingURL=generating-star.DMDPNTaM.js.map