@crewlethq/ui 0.17.1 → 0.18.0
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/README.md +36 -1
- package/dist/AccessDeniedCard/AccessDeniedCard.d.ts +39 -0
- package/dist/AccessDeniedCard/index.d.ts +3 -0
- package/dist/AccessDeniedCard/index.js +8 -0
- package/dist/AccessDeniedCard-WXM5DBDZ.css +8 -0
- package/dist/ArtifactCard/ArtifactCard.d.ts +61 -0
- package/dist/ArtifactCard/index.d.ts +3 -0
- package/dist/ArtifactCard/index.js +12 -0
- package/dist/ArtifactCard-EXVAEBV6.css +109 -0
- package/dist/AvatarPicker/index.js +4 -4
- package/dist/ChangeMark/ChangeMark.d.ts +26 -0
- package/dist/ChangeMark/index.d.ts +3 -0
- package/dist/ChangeMark/index.js +8 -0
- package/dist/ChangeMark-3VMTW7MT.css +22 -0
- package/dist/Combobox/index.js +1 -1
- package/dist/CommandPalette/index.js +3 -3
- package/dist/CursorFlag/CursorFlag.d.ts +34 -0
- package/dist/CursorFlag/index.d.ts +3 -0
- package/dist/CursorFlag/index.js +3 -0
- package/dist/CursorFlag-AJQJBUGY.css +61 -0
- package/dist/DataTable/index.js +6 -6
- package/dist/DataView/index.js +12 -12
- package/dist/DateTimePicker/index.js +2 -2
- package/dist/FollowBanner/FollowBanner.d.ts +35 -0
- package/dist/FollowBanner/index.d.ts +2 -0
- package/dist/FollowBanner/index.js +7 -0
- package/dist/FrameProtocol/index.d.ts +2 -0
- package/dist/FrameProtocol/index.js +2 -0
- package/dist/FrameProtocol/protocol.d.ts +164 -0
- package/dist/HuePicker/index.js +2 -2
- package/dist/LinkInterstitial/LinkInterstitial.d.ts +41 -0
- package/dist/LinkInterstitial/index.d.ts +3 -0
- package/dist/LinkInterstitial/index.js +11 -0
- package/dist/LinkInterstitial-ET4MSVSV.css +34 -0
- package/dist/ListInput/index.js +1 -1
- package/dist/LiveCursor/LiveCursor.d.ts +34 -0
- package/dist/LiveCursor/index.d.ts +3 -0
- package/dist/LiveCursor/index.js +4 -0
- package/dist/LiveCursor-DZHGIYWE.css +47 -0
- package/dist/MarkdownEditor/index.js +2 -2
- package/dist/Modal/index.js +2 -2
- package/dist/OrgTable/index.js +2 -2
- package/dist/PresenceModel/index.d.ts +2 -0
- package/dist/PresenceModel/index.js +3 -0
- package/dist/PresenceModel/presence.d.ts +80 -0
- package/dist/PresenceRing/PresenceRing.d.ts +31 -0
- package/dist/PresenceRing/index.d.ts +3 -0
- package/dist/PresenceRing/index.js +2 -0
- package/dist/PresenceRing-M4C22Q6U.css +68 -0
- package/dist/PresenceStack/PresenceStack.d.ts +36 -0
- package/dist/PresenceStack/index.d.ts +3 -0
- package/dist/PresenceStack/index.js +9 -0
- package/dist/PresenceStack-QSXQJND5.css +59 -0
- package/dist/PricingCard/index.js +2 -2
- package/dist/Principal/Principal.d.ts +35 -0
- package/dist/Principal/index.d.ts +2 -0
- package/dist/Principal/index.js +4 -0
- package/dist/PrincipalPicker/PrincipalPicker.d.ts +45 -0
- package/dist/PrincipalPicker/index.d.ts +3 -0
- package/dist/PrincipalPicker/index.js +12 -0
- package/dist/PrincipalPicker-7NNZTGUP.css +41 -0
- package/dist/SandboxedFrame/SandboxedFrame.d.ts +142 -0
- package/dist/SandboxedFrame/index.d.ts +3 -0
- package/dist/SandboxedFrame/index.js +8 -0
- package/dist/SandboxedFrame-L6HBQZCD.css +50 -0
- package/dist/ShareDialog/ShareDialog.d.ts +101 -0
- package/dist/ShareDialog/index.d.ts +5 -0
- package/dist/ShareDialog/index.js +19 -0
- package/dist/ShareDialog/roles.d.ts +10 -0
- package/dist/ShareDialog-YZ4F37MW.css +146 -0
- package/dist/SheetGrid/SheetGrid.d.ts +78 -0
- package/dist/SheetGrid/cells.d.ts +117 -0
- package/dist/SheetGrid/index.d.ts +5 -0
- package/dist/SheetGrid/index.js +18 -0
- package/dist/SheetGrid-4HOXDVIB.css +595 -0
- package/dist/SheetModel/clipboard.d.ts +37 -0
- package/dist/SheetModel/edits.d.ts +68 -0
- package/dist/SheetModel/index.d.ts +14 -0
- package/dist/SheetModel/index.js +3 -0
- package/dist/SheetModel/labels.d.ts +71 -0
- package/dist/SheetModel/navigation.d.ts +79 -0
- package/dist/SheetModel/options.d.ts +28 -0
- package/dist/SheetModel/types.d.ts +126 -0
- package/dist/SheetModel/values.d.ts +76 -0
- package/dist/SheetModel/view.d.ts +32 -0
- package/dist/Switcher/index.js +5 -5
- package/dist/Tag/Tag.d.ts +13 -0
- package/dist/Tag/index.js +1 -1
- package/dist/{Tag-4BRQS6GN.css → Tag-SRGTK5KI.css} +42 -0
- package/dist/TagsInput/index.js +2 -2
- package/dist/ThemeSwitcher/apply.d.ts +43 -0
- package/dist/ThemeSwitcher/index.d.ts +4 -2
- package/dist/ThemeSwitcher/index.js +3 -2
- package/dist/ThemeSwitcher/preferences.d.ts +2 -19
- package/dist/ThemeToggle/index.js +3 -2
- package/dist/TimeWindowPicker/index.js +3 -3
- package/dist/Timeline/Timeline.d.ts +7 -2
- package/dist/Timeline/index.js +1 -1
- package/dist/VersionTimeline/VersionTimeline.d.ts +76 -0
- package/dist/VersionTimeline/index.d.ts +3 -0
- package/dist/VersionTimeline/index.js +10 -0
- package/dist/VersionTimeline-EBJ6MIPJ.css +108 -0
- package/dist/{chunk-SBRE7IML.js → chunk-2ONWEDQT.js} +1 -1
- package/dist/chunk-2YR5ZPQ3.js +216 -0
- package/dist/chunk-3BYIWOTV.js +29 -0
- package/dist/chunk-3UAA4IWJ.js +98 -0
- package/dist/chunk-4KP4RC3O.js +25 -0
- package/dist/chunk-4U3GQ7D2.js +99 -0
- package/dist/chunk-5XACKNYR.js +53 -0
- package/dist/{chunk-FSKTOIYC.js → chunk-76FXDZAZ.js} +2 -2
- package/dist/chunk-A7EBCHEG.js +49 -0
- package/dist/{chunk-JCO3SIST.js → chunk-AQCV62K6.js} +1 -1
- package/dist/{chunk-O67VF5MS.js → chunk-AUQPBL4O.js} +2 -2
- package/dist/{chunk-HENOTGUV.js → chunk-BOW2VUCH.js} +2 -2
- package/dist/{chunk-UCYIRDND.js → chunk-DQSXWQMJ.js} +1 -1
- package/dist/chunk-ESKP3TXM.js +1 -0
- package/dist/chunk-F6V2PTN6.js +142 -0
- package/dist/chunk-FW7HN6AP.js +40 -0
- package/dist/chunk-FYXRWBJJ.js +1235 -0
- package/dist/{chunk-LOECRMHA.js → chunk-GFV4LJHH.js} +4 -3
- package/dist/chunk-I6POAB4V.js +20 -0
- package/dist/{chunk-PQ63NLFC.js → chunk-IFKBDRNJ.js} +1 -1
- package/dist/{chunk-6NN2F7GM.js → chunk-KVT3TJVG.js} +4 -4
- package/dist/chunk-LFZ45HV2.js +46 -0
- package/dist/{chunk-6TSZCBID.js → chunk-NP2C4Y4E.js} +1 -1
- package/dist/{chunk-FA2V2VT6.js → chunk-NZY77ZDU.js} +3 -3
- package/dist/chunk-PPAQFGS2.js +12 -0
- package/dist/chunk-S35G6PNC.js +80 -0
- package/dist/chunk-VYDFB6PJ.js +243 -0
- package/dist/chunk-WXAULPBH.js +135 -0
- package/dist/chunk-YM3GJHGW.js +69 -0
- package/dist/chunk-YYZRLLLY.js +822 -0
- package/dist/{chunk-K3OWD7BJ.js → chunk-Z24ZUSTX.js} +4 -19
- package/dist/chunk-ZXXDZJQN.js +36 -0
- package/dist/generated/index.d.ts +18 -0
- package/dist/generated/index.js +82 -62
- package/dist/index.js +82 -62
- package/dist/styles.css +1578 -149
- package/dist/utils/index.js +1 -1
- package/package.json +3 -3
- package/dist/{chunk-DEEVA6TV.js → chunk-2TZATTIU.js} +1 -1
- package/dist/{chunk-2UU5IGZI.js → chunk-5NVKTB6E.js} +1 -1
- package/dist/{chunk-CRVETI5L.js → chunk-CENOOTAV.js} +0 -0
- package/dist/{chunk-JF7X673Z.js → chunk-ERV5BUS3.js} +1 -1
- package/dist/{chunk-NXDEPUVG.js → chunk-PA4CYTBY.js} +1 -1
- package/dist/{chunk-77IEHFY4.js → chunk-QQGWES46.js} +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { presenceHueClass } from './chunk-I6POAB4V.js';
|
|
2
|
+
import { presenceLabels, presenceOrder } from './chunk-S35G6PNC.js';
|
|
3
|
+
import { AVATAR_SIZES, Avatar } from './chunk-5OM447RW.js';
|
|
4
|
+
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
5
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
|
+
import './PresenceStack-QSXQJND5.css';
|
|
7
|
+
import { isCrewletCharacter } from '@crewlethq/icons/characters';
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
function PresenceStack({ members, self = true, max = 4, size = "sm", onSelect, label, labels, className }) {
|
|
11
|
+
if (!Number.isInteger(max) || max < 1) {
|
|
12
|
+
throw new RangeError(`PresenceStack max must be a whole number of at least 1; it was ${max}`);
|
|
13
|
+
}
|
|
14
|
+
const text = presenceLabels(labels);
|
|
15
|
+
const ordered = presenceOrder(members);
|
|
16
|
+
if (ordered.length === 0 && !self) return null;
|
|
17
|
+
const shown = ordered.slice(0, max);
|
|
18
|
+
const hidden = ordered.slice(max);
|
|
19
|
+
const here = label ?? text.here(ordered.length, self);
|
|
20
|
+
const spoken = [here, ...ordered.map((member) => text.member(member))].join(". ");
|
|
21
|
+
const badge = (member) => /* @__PURE__ */ jsx(
|
|
22
|
+
Avatar,
|
|
23
|
+
{
|
|
24
|
+
name: member.name,
|
|
25
|
+
kind: member.kind,
|
|
26
|
+
src: member.src,
|
|
27
|
+
character: member.character !== void 0 && isCrewletCharacter(member.character) ? member.character : void 0,
|
|
28
|
+
hue: member.kind === "agent" ? member.hue : void 0,
|
|
29
|
+
size,
|
|
30
|
+
decorative: true,
|
|
31
|
+
className: cx(
|
|
32
|
+
"crewlet-presence-stack__badge",
|
|
33
|
+
member.hue !== void 0 && member.activity !== "idle" && presenceHueClass(member.hue),
|
|
34
|
+
member.hue !== void 0 && member.activity !== "idle" && "crewlet-presence-stack__badge--present",
|
|
35
|
+
member.activity === "idle" && "crewlet-presence-stack__badge--idle"
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
const more = hidden.length > 0 ? /* @__PURE__ */ jsxs("span", { className: "crewlet-avatar-stack__member crewlet-avatar-stack__more", "aria-hidden": "true", children: [
|
|
40
|
+
"+",
|
|
41
|
+
hidden.length
|
|
42
|
+
] }) : null;
|
|
43
|
+
const style = { "--crewlet-avatar-stack-size": `${AVATAR_SIZES[size]}px` };
|
|
44
|
+
if (onSelect === void 0) {
|
|
45
|
+
if (ordered.length === 0) return null;
|
|
46
|
+
return /* @__PURE__ */ jsxs("span", { className: cx("crewlet-avatar-stack", "crewlet-presence-stack", className), style, role: "img", "aria-label": spoken, children: [
|
|
47
|
+
shown.map((member) => /* @__PURE__ */ jsx("span", { className: cx("crewlet-avatar-stack__member", "crewlet-presence-stack__member", `crewlet-presence-stack__member--${member.kind}`), children: badge(member) }, member.id)),
|
|
48
|
+
more
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("crewlet-avatar-stack", "crewlet-presence-stack", className), style, role: "group", "aria-label": here, children: [
|
|
52
|
+
shown.map((member) => /* @__PURE__ */ jsx(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
className: cx("crewlet-avatar-stack__member", "crewlet-presence-stack__member", `crewlet-presence-stack__member--${member.kind}`),
|
|
57
|
+
"aria-label": text.member(member),
|
|
58
|
+
title: text.member(member),
|
|
59
|
+
onClick: () => onSelect(member),
|
|
60
|
+
children: badge(member)
|
|
61
|
+
},
|
|
62
|
+
member.id
|
|
63
|
+
)),
|
|
64
|
+
more,
|
|
65
|
+
hidden.length > 0 ? /* @__PURE__ */ jsx(VisuallyHidden, { children: `${text.more(hidden.length)}: ${hidden.map((member) => text.member(member)).join(", ")}` }) : null
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { PresenceStack };
|