@ceebee/ui 1.3.2 → 1.3.3
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/dist/client.js +13 -3
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -629,6 +629,16 @@ var STICKER_VARIANTS = {
|
|
|
629
629
|
still: { opacity: 1, x: 0, y: 0, rotate: 0, scale: 1 },
|
|
630
630
|
stillExit: { opacity: 0, x: 0, y: 0, rotate: 0, scale: 1 }
|
|
631
631
|
};
|
|
632
|
+
function stableChoice(id, salt, options) {
|
|
633
|
+
let hash = 2166136261;
|
|
634
|
+
for (const character of `${salt}:${id}`) {
|
|
635
|
+
hash ^= character.charCodeAt(0);
|
|
636
|
+
hash = Math.imul(hash, 16777619);
|
|
637
|
+
}
|
|
638
|
+
return (hash >>> 0) % options;
|
|
639
|
+
}
|
|
640
|
+
var TILTS = ["left", "right", "none"];
|
|
641
|
+
var EXITS = ["left", "right"];
|
|
632
642
|
function StickerGroupRoot({
|
|
633
643
|
items,
|
|
634
644
|
onDismiss,
|
|
@@ -639,9 +649,9 @@ function StickerGroupRoot({
|
|
|
639
649
|
}) {
|
|
640
650
|
const motionSettings = useMotionSettings();
|
|
641
651
|
const shouldMove = motionEnabled && motionSettings.enabled;
|
|
642
|
-
return /* @__PURE__ */ jsx("ul", { className: cn("cb-sticker-group", className), "aria-label": label, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: items.map((item
|
|
643
|
-
const tilt =
|
|
644
|
-
const exit =
|
|
652
|
+
return /* @__PURE__ */ jsx("ul", { className: cn("cb-sticker-group", className), "aria-label": label, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: items.map((item) => {
|
|
653
|
+
const tilt = TILTS[stableChoice(item.id, "tilt", TILTS.length)];
|
|
654
|
+
const exit = EXITS[stableChoice(item.id, "exit", EXITS.length)];
|
|
645
655
|
const itemLabel = item.ariaLabel ?? (typeof item.label === "string" ? item.label : "item");
|
|
646
656
|
const dismissLabel = getDismissLabel?.(item) ?? `Remove ${itemLabel}`;
|
|
647
657
|
return /* @__PURE__ */ jsx(
|