@devalok/shilp-sutra 0.20.1 → 0.22.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/dist/_chunks/primitives.js +2 -2
- package/dist/_chunks/use-calendar.js +115 -115
- package/dist/_chunks/vendor-utils.js +1230 -1178
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +78 -78
- package/dist/composed/avatar-group.d.ts +13 -1
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +127 -50
- package/dist/composed/command-palette.js +50 -50
- package/dist/composed/content-card.js +10 -10
- package/dist/composed/empty-state.d.ts.map +1 -1
- package/dist/composed/empty-state.js +58 -48
- package/dist/composed/global-loading.d.ts.map +1 -1
- package/dist/composed/global-loading.js +11 -10
- package/dist/composed/loading-skeleton.d.ts.map +1 -1
- package/dist/composed/loading-skeleton.js +32 -29
- package/dist/composed/member-picker.d.ts.map +1 -1
- package/dist/composed/member-picker.js +28 -17
- package/dist/composed/page-header.js +25 -25
- package/dist/composed/priority-indicator.d.ts.map +1 -1
- package/dist/composed/priority-indicator.js +60 -36
- package/dist/composed/rich-text-editor.js +104 -104
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/composed/schedule-view.js +53 -45
- package/dist/composed/status-badge.js +16 -16
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +35 -31
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +119 -111
- package/dist/shell/sidebar.js +2 -2
- package/dist/shell/top-bar.js +9 -9
- package/dist/tailwind/index.cjs +30 -3
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +30 -3
- package/dist/tokens/semantic.css +10 -10
- package/dist/tokens/typography-semantic.css +3 -3
- package/dist/ui/accordion.js +22 -22
- package/dist/ui/alert.js +8 -8
- package/dist/ui/avatar.d.ts +23 -1
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +124 -60
- package/dist/ui/badge.js +5 -5
- package/dist/ui/banner.js +18 -18
- package/dist/ui/breadcrumb.js +23 -23
- package/dist/ui/button.js +22 -22
- package/dist/ui/card.js +16 -16
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +72 -25
- package/dist/ui/chip.js +14 -14
- package/dist/ui/code.js +9 -9
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +46 -45
- package/dist/ui/dialog.js +17 -17
- package/dist/ui/dropdown-menu.js +22 -22
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +35 -29
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input.js +20 -20
- package/dist/ui/label.js +15 -15
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/motion.js +2 -2
- package/dist/ui/link.js +14 -14
- package/dist/ui/number-input.js +36 -36
- package/dist/ui/pagination.js +14 -14
- package/dist/ui/progress.js +6 -6
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +24 -12
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +25 -19
- package/dist/ui/select.js +15 -15
- package/dist/ui/separator.d.ts +10 -2
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js +16 -15
- package/dist/ui/sheet.js +7 -7
- package/dist/ui/sidebar.d.ts +1 -1
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +22 -22
- package/dist/ui/skeleton.js +5 -5
- package/dist/ui/slider.js +7 -7
- package/dist/ui/stat-card.js +19 -19
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +14 -13
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +60 -51
- package/dist/ui/textarea.js +15 -15
- package/dist/ui/toast.js +1 -1
- package/dist/ui/toggle.js +5 -5
- package/dist/ui/tooltip.d.ts +1 -1
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +49 -41
- package/docs/components/composed/avatar-group.md +29 -4
- package/docs/components/ui/avatar.md +23 -5
- package/docs/components/ui/button.md +5 -0
- package/docs/components/ui/checkbox.md +5 -0
- package/docs/components/ui/dropdown-menu.md +3 -0
- package/docs/components/ui/separator.md +3 -0
- package/docs/components/ui/tooltip.md +5 -0
- package/llms-full.txt +74 -10
- package/llms.txt +22 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-feed.d.ts","sourceRoot":"","sources":["../../src/composed/activity-feed.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAChC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAA;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC5D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAiBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EAAE,EACrB,MAAM,CAAC,EAAE,WAAW,GACnB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,EAAE,CA6C5C;AA8ID,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"activity-feed.d.ts","sourceRoot":"","sources":["../../src/composed/activity-feed.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAChC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAA;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC5D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAiBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EAAE,EACrB,MAAM,CAAC,EAAE,WAAW,GACnB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,EAAE,CA6C5C;AA8ID,QAAA,MAAM,YAAY,0FAqGjB,CAAA;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { IconChevronRight as
|
|
6
|
-
import { Avatar as
|
|
7
|
-
import { Button as
|
|
2
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import * as k from "react";
|
|
4
|
+
import { cn as i } from "../ui/lib/utils.js";
|
|
5
|
+
import { IconChevronRight as F } from "@tabler/icons-react";
|
|
6
|
+
import { Avatar as W, AvatarImage as j, AvatarFallback as E } from "../ui/avatar.js";
|
|
7
|
+
import { Button as S } from "../ui/button.js";
|
|
8
8
|
import { Skeleton as v } from "../ui/skeleton.js";
|
|
9
|
-
import { getInitials as
|
|
10
|
-
import { formatRelativeTime as
|
|
11
|
-
import { tweens as
|
|
12
|
-
import { m as
|
|
13
|
-
const
|
|
9
|
+
import { getInitials as R } from "./lib/string-utils.js";
|
|
10
|
+
import { formatRelativeTime as L } from "../ui/lib/date-utils.js";
|
|
11
|
+
import { tweens as D } from "../ui/lib/motion.js";
|
|
12
|
+
import { m as T } from "../_chunks/framer.js";
|
|
13
|
+
const z = {
|
|
14
14
|
default: "bg-surface-fg-subtle",
|
|
15
15
|
success: "bg-success-9",
|
|
16
16
|
warning: "bg-warning-9",
|
|
17
17
|
error: "bg-error-9",
|
|
18
18
|
info: "bg-info-9"
|
|
19
|
-
},
|
|
19
|
+
}, B = {
|
|
20
20
|
today: "Today",
|
|
21
21
|
yesterday: "Yesterday",
|
|
22
22
|
thisWeek: "This Week",
|
|
23
23
|
older: "Older"
|
|
24
24
|
};
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
c.getTime() -
|
|
28
|
-
), f = [], m = [], u = [],
|
|
29
|
-
for (const
|
|
30
|
-
const x = (typeof
|
|
31
|
-
x >= c.getTime() ? f.push(
|
|
25
|
+
function G(e, a) {
|
|
26
|
+
const d = { ...B, ...a }, o = /* @__PURE__ */ new Date(), c = new Date(o.getFullYear(), o.getMonth(), o.getDate()), n = new Date(c.getTime() - 24 * 60 * 60 * 1e3), r = o.getDay(), y = r === 0 ? 6 : r - 1, b = new Date(
|
|
27
|
+
c.getTime() - y * 24 * 60 * 60 * 1e3
|
|
28
|
+
), f = [], m = [], u = [], g = [];
|
|
29
|
+
for (const l of e) {
|
|
30
|
+
const x = (typeof l.timestamp == "string" ? new Date(l.timestamp) : l.timestamp).getTime();
|
|
31
|
+
x >= c.getTime() ? f.push(l) : x >= n.getTime() ? m.push(l) : x >= b.getTime() ? u.push(l) : g.push(l);
|
|
32
32
|
}
|
|
33
33
|
const h = [];
|
|
34
|
-
return f.length > 0 && h.push({ label:
|
|
34
|
+
return f.length > 0 && h.push({ label: d.today, items: f }), m.length > 0 && h.push({ label: d.yesterday, items: m }), u.length > 0 && h.push({ label: d.thisWeek, items: u }), g.length > 0 && h.push({ label: d.older, items: g }), h;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return /* @__PURE__ */ t("div", { className:
|
|
36
|
+
function I({ compact: e }) {
|
|
37
|
+
return /* @__PURE__ */ t("div", { className: i("flex flex-col", e ? "gap-1" : "gap-3"), children: [0, 1, 2].map((a) => /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
|
|
38
38
|
/* @__PURE__ */ t(v, { className: "h-2 w-2 shrink-0 rounded-ds-full" }),
|
|
39
39
|
!e && /* @__PURE__ */ t(v, { className: "h-4 w-4 shrink-0 rounded-ds-full" }),
|
|
40
|
-
/* @__PURE__ */ t(v, { className:
|
|
40
|
+
/* @__PURE__ */ t(v, { className: i("flex-1", e ? "h-3" : "h-4") }),
|
|
41
41
|
/* @__PURE__ */ t(v, { className: "h-3 w-12" })
|
|
42
|
-
] },
|
|
42
|
+
] }, a)) });
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function O({
|
|
45
45
|
item: e,
|
|
46
|
-
compact:
|
|
46
|
+
compact: a
|
|
47
47
|
}) {
|
|
48
|
-
const [
|
|
49
|
-
e.detail &&
|
|
48
|
+
const [d, o] = k.useState(!1), c = e.color ?? "default", n = () => {
|
|
49
|
+
e.detail && o((r) => !r);
|
|
50
50
|
};
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ s("div", { className: i("relative flex items-start", a ? "gap-ds-02" : "gap-ds-03"), children: [
|
|
52
52
|
/* @__PURE__ */ t(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
|
-
className:
|
|
55
|
+
className: i(
|
|
56
56
|
"relative z-10 mt-1.5 h-2 w-2 shrink-0 rounded-ds-full ring-2 ring-surface-1",
|
|
57
|
-
|
|
57
|
+
z[c]
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
!
|
|
62
|
-
e.actor.image && /* @__PURE__ */ t(
|
|
63
|
-
/* @__PURE__ */ t(
|
|
61
|
+
!a && e.actor && /* @__PURE__ */ s(W, { className: "h-5 w-5 shrink-0 text-[9px]", children: [
|
|
62
|
+
e.actor.image && /* @__PURE__ */ t(j, { src: e.actor.image, alt: e.actor.name }),
|
|
63
|
+
/* @__PURE__ */ t(E, { className: "text-[9px]", children: R(e.actor.name) })
|
|
64
64
|
] }),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
e.actor && /* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
66
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-ds-02", children: [
|
|
67
|
+
/* @__PURE__ */ s("div", { className: i("min-w-0 flex-1 flex items-center gap-ds-01 flex-wrap", a ? "text-ds-xs" : "text-ds-sm"), children: [
|
|
68
|
+
e.actor && /* @__PURE__ */ s("span", { className: "font-medium text-surface-fg", children: [
|
|
69
69
|
e.actor.name,
|
|
70
70
|
" "
|
|
71
71
|
] }),
|
|
72
|
-
e.detail && /* @__PURE__ */ t(
|
|
72
|
+
e.detail && /* @__PURE__ */ t(F, { className: i("h-3 w-3 shrink-0 text-surface-fg-subtle transition-transform duration-fast-02 ease-productive-standard", d && "rotate-90") }),
|
|
73
73
|
/* @__PURE__ */ t(
|
|
74
74
|
"span",
|
|
75
75
|
{
|
|
76
|
-
className:
|
|
76
|
+
className: i(
|
|
77
77
|
"text-surface-fg-muted",
|
|
78
|
-
e.detail && "cursor-pointer hover:underline"
|
|
78
|
+
e.detail && "cursor-pointer hover:underline hover:bg-surface-2 rounded-ds-md"
|
|
79
79
|
),
|
|
80
80
|
onClick: n,
|
|
81
81
|
role: e.detail ? "button" : void 0,
|
|
82
82
|
tabIndex: e.detail ? 0 : void 0,
|
|
83
|
-
onKeyDown: e.detail ? (
|
|
84
|
-
(
|
|
83
|
+
onKeyDown: e.detail ? (r) => {
|
|
84
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), n());
|
|
85
85
|
} : void 0,
|
|
86
86
|
children: e.action
|
|
87
87
|
}
|
|
@@ -90,32 +90,32 @@ function T({
|
|
|
90
90
|
/* @__PURE__ */ t(
|
|
91
91
|
"time",
|
|
92
92
|
{
|
|
93
|
-
className:
|
|
93
|
+
className: i(
|
|
94
94
|
"shrink-0 whitespace-nowrap text-surface-fg-subtle",
|
|
95
|
-
|
|
95
|
+
a ? "text-ds-xs" : "text-ds-sm"
|
|
96
96
|
),
|
|
97
97
|
dateTime: (typeof e.timestamp == "string" ? new Date(e.timestamp) : e.timestamp).toISOString(),
|
|
98
|
-
children:
|
|
98
|
+
children: L(e.timestamp)
|
|
99
99
|
}
|
|
100
100
|
)
|
|
101
101
|
] }),
|
|
102
|
-
|
|
102
|
+
d && e.detail && /* @__PURE__ */ t("div", { className: "mt-ds-02 animate-in fade-in slide-in-from-top-1 text-ds-sm text-surface-fg-muted", children: e.detail })
|
|
103
103
|
] })
|
|
104
104
|
] });
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Y({
|
|
107
107
|
label: e,
|
|
108
|
-
isFirst:
|
|
108
|
+
isFirst: a
|
|
109
109
|
}) {
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
-
|
|
110
|
+
return /* @__PURE__ */ s(
|
|
111
|
+
T.div,
|
|
112
112
|
{
|
|
113
113
|
initial: { opacity: 0 },
|
|
114
114
|
animate: { opacity: 1 },
|
|
115
|
-
transition:
|
|
116
|
-
className:
|
|
115
|
+
transition: D.fade,
|
|
116
|
+
className: i(
|
|
117
117
|
"flex items-center gap-ds-03",
|
|
118
|
-
|
|
118
|
+
a ? "" : "mt-ds-06",
|
|
119
119
|
"mb-ds-03"
|
|
120
120
|
),
|
|
121
121
|
children: [
|
|
@@ -126,39 +126,39 @@ function I({
|
|
|
126
126
|
}
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
|
-
const
|
|
129
|
+
const M = k.forwardRef(
|
|
130
130
|
({
|
|
131
131
|
items: e,
|
|
132
|
-
onLoadMore:
|
|
133
|
-
loading:
|
|
134
|
-
hasMore:
|
|
132
|
+
onLoadMore: a,
|
|
133
|
+
loading: d = !1,
|
|
134
|
+
hasMore: o = !1,
|
|
135
135
|
emptyState: c,
|
|
136
136
|
compact: n = !1,
|
|
137
|
-
maxInitialItems:
|
|
138
|
-
groupBy:
|
|
139
|
-
groupLabels:
|
|
137
|
+
maxInitialItems: r,
|
|
138
|
+
groupBy: y = "none",
|
|
139
|
+
groupLabels: b,
|
|
140
140
|
className: f,
|
|
141
141
|
...m
|
|
142
142
|
}, u) => {
|
|
143
|
-
const [
|
|
144
|
-
if (
|
|
145
|
-
return /* @__PURE__ */ t("div", { ref: u, className:
|
|
143
|
+
const [g, h] = k.useState(!1);
|
|
144
|
+
if (d)
|
|
145
|
+
return /* @__PURE__ */ t("div", { ref: u, className: i("relative", f), ...m, children: /* @__PURE__ */ t(I, { compact: n }) });
|
|
146
146
|
if (e.length === 0)
|
|
147
147
|
return c ? /* @__PURE__ */ t("div", { ref: u, className: f, ...m, children: c }) : null;
|
|
148
|
-
const
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
-
x ? /* @__PURE__ */ t("div", { children:
|
|
151
|
-
/* @__PURE__ */ t(
|
|
152
|
-
/* @__PURE__ */
|
|
148
|
+
const l = r != null && !g && e.length > r, w = l ? e.slice(0, r) : e, x = y === "time";
|
|
149
|
+
return /* @__PURE__ */ s("div", { ref: u, className: i("relative", f), ...m, children: [
|
|
150
|
+
x ? /* @__PURE__ */ t("div", { children: G(w, b).map((p, N) => /* @__PURE__ */ s("div", { children: [
|
|
151
|
+
/* @__PURE__ */ t(Y, { label: p.label, isFirst: N === 0 }),
|
|
152
|
+
/* @__PURE__ */ s("div", { className: i("relative flex flex-col", n ? "gap-1" : "gap-3"), children: [
|
|
153
153
|
/* @__PURE__ */ t("div", { className: "absolute bottom-0 left-[3px] top-0 w-px bg-surface-border" }),
|
|
154
|
-
|
|
154
|
+
p.items.map((A, C) => /* @__PURE__ */ t(T.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { ...D.fade, delay: C * 0.03 }, children: /* @__PURE__ */ t(O, { item: A, compact: n }) }, A.id))
|
|
155
155
|
] })
|
|
156
|
-
] },
|
|
156
|
+
] }, p.label)) }) : /* @__PURE__ */ s("div", { className: i("relative flex flex-col", n ? "gap-1" : "gap-3"), children: [
|
|
157
157
|
/* @__PURE__ */ t("div", { className: "absolute bottom-0 left-[3px] top-0 w-px bg-surface-border" }),
|
|
158
|
-
w.map((
|
|
158
|
+
w.map((p, N) => /* @__PURE__ */ t(T.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { ...D.fade, delay: N * 0.03 }, children: /* @__PURE__ */ t(O, { item: p, compact: n }) }, p.id))
|
|
159
159
|
] }),
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
l && /* @__PURE__ */ t("div", { className: "relative mt-ds-03 flex justify-center", children: /* @__PURE__ */ s(
|
|
161
|
+
S,
|
|
162
162
|
{
|
|
163
163
|
variant: "ghost",
|
|
164
164
|
size: "sm",
|
|
@@ -170,12 +170,12 @@ const Y = N.forwardRef(
|
|
|
170
170
|
]
|
|
171
171
|
}
|
|
172
172
|
) }),
|
|
173
|
-
|
|
173
|
+
o && a && !l && /* @__PURE__ */ t("div", { className: "relative mt-ds-03 flex justify-center", children: /* @__PURE__ */ t(S, { variant: "ghost", size: "sm", onClick: a, children: "Load more" }) })
|
|
174
174
|
] });
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
|
-
|
|
177
|
+
M.displayName = "ActivityFeed";
|
|
178
178
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
M as ActivityFeed,
|
|
180
|
+
G as groupItemsByTime
|
|
181
181
|
};
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { AvatarRing } from '../ui/avatar';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
declare const avatarSizeVariants: (props?: ({
|
|
5
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
8
|
export interface AvatarUser {
|
|
8
9
|
name: string;
|
|
9
10
|
image?: string | null;
|
|
11
|
+
ring?: AvatarRing;
|
|
10
12
|
}
|
|
11
13
|
export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof avatarSizeVariants> {
|
|
12
14
|
users: AvatarUser[];
|
|
13
15
|
max?: number;
|
|
14
16
|
showTooltip?: boolean;
|
|
17
|
+
/** Border color for the group avatars. @default 'surface-2' */
|
|
18
|
+
borderColor?: 'surface-1' | 'surface-2';
|
|
19
|
+
/** Callback when the "+N" overflow badge is clicked */
|
|
20
|
+
onOverflowClick?: () => void;
|
|
21
|
+
/** Custom render function for each avatar */
|
|
22
|
+
renderAvatar?: (user: AvatarUser, index: number) => React.ReactNode;
|
|
23
|
+
/** Direction avatars expand on hover. @default 'right' */
|
|
24
|
+
expandDirection?: 'left' | 'right';
|
|
25
|
+
/** How much avatars spread apart on hover. @default 'default' */
|
|
26
|
+
expandAmount?: 'compact' | 'default' | 'wide';
|
|
15
27
|
}
|
|
16
28
|
declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
29
|
export { AvatarGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-group.d.ts","sourceRoot":"","sources":["../../src/composed/avatar-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"avatar-group.d.ts","sourceRoot":"","sources":["../../src/composed/avatar-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAOjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAS9C,QAAA,MAAM,kBAAkB;;8EAgBvB,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACzC,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,WAAW,GAAG,WAAW,CAAA;IACvC,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;IACnE,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAClC,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;CAC9C;AAED,QAAA,MAAM,WAAW,yFAkLhB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,95 +1,172 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { ag as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Avatar as
|
|
7
|
-
import { TooltipProvider as
|
|
8
|
-
import { getInitials as
|
|
9
|
-
const
|
|
10
|
-
"shrink-0 overflow-hidden rounded-ds-full border-2
|
|
2
|
+
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
import * as b from "react";
|
|
4
|
+
import { ag as $ } from "../_chunks/vendor-utils.js";
|
|
5
|
+
import { cn as n } from "../ui/lib/utils.js";
|
|
6
|
+
import { Avatar as E, AvatarImage as F, AvatarFallback as G } from "../ui/avatar.js";
|
|
7
|
+
import { TooltipProvider as H, Tooltip as y, TooltipTrigger as N, TooltipContent as w } from "../ui/tooltip.js";
|
|
8
|
+
import { getInitials as R } from "./lib/string-utils.js";
|
|
9
|
+
const p = $(
|
|
10
|
+
"shrink-0 overflow-hidden rounded-ds-full border-2",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
size: {
|
|
14
|
+
xs: "h-ds-xs w-ds-xs text-[10px]",
|
|
14
15
|
sm: "h-ds-xs w-ds-xs text-ds-xs",
|
|
15
16
|
md: "h-ds-sm w-ds-sm text-ds-sm",
|
|
16
|
-
lg: "h-ds-md w-ds-md text-ds-md"
|
|
17
|
+
lg: "h-ds-md w-ds-md text-ds-md",
|
|
18
|
+
xl: "h-ds-lg w-ds-lg text-ds-lg"
|
|
17
19
|
}
|
|
18
20
|
},
|
|
19
21
|
defaultVariants: {
|
|
20
22
|
size: "md"
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
|
-
),
|
|
24
|
-
({
|
|
25
|
-
|
|
25
|
+
), B = b.forwardRef(
|
|
26
|
+
({
|
|
27
|
+
users: l,
|
|
28
|
+
max: g = 4,
|
|
29
|
+
size: s,
|
|
30
|
+
showTooltip: I = !0,
|
|
31
|
+
borderColor: T = "surface-2",
|
|
32
|
+
onOverflowClick: h,
|
|
33
|
+
renderAvatar: u,
|
|
34
|
+
expandDirection: M = "right",
|
|
35
|
+
expandAmount: C = "default",
|
|
36
|
+
className: z,
|
|
37
|
+
...S
|
|
38
|
+
}, j) => {
|
|
39
|
+
const a = l.slice(0, g), c = l.length - g, d = {
|
|
40
|
+
xs: "-ml-ds-02",
|
|
26
41
|
sm: "-ml-ds-02b",
|
|
27
42
|
md: "-ml-ds-03",
|
|
28
|
-
lg: "-ml-ds-04"
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
lg: "-ml-ds-04",
|
|
44
|
+
xl: "-ml-ds-05"
|
|
45
|
+
}[s ?? "md"], i = T === "surface-1" ? "border-surface-1" : "border-surface-2", [A, m] = b.useState(!1), P = {
|
|
46
|
+
xs: 8,
|
|
47
|
+
sm: 10,
|
|
48
|
+
md: 12,
|
|
49
|
+
lg: 16,
|
|
50
|
+
xl: 20
|
|
51
|
+
}[s ?? "md"], k = { compact: 0.5, default: 1, wide: 1.5 }[C], V = a.length + (c > 0 ? 1 : 0);
|
|
52
|
+
function f(e) {
|
|
53
|
+
if (!A) return "translateX(0)";
|
|
54
|
+
const t = P * k;
|
|
55
|
+
return M === "left" ? `translateX(-${(V - 1 - e) * t}px)` : `translateX(${e * t}px)`;
|
|
56
|
+
}
|
|
57
|
+
const x = "transition-[transform,opacity] duration-300 ease-out hover:z-50 hover:scale-105 group-hover:[&:not(:hover)]:opacity-85";
|
|
58
|
+
return /* @__PURE__ */ r(H, { children: /* @__PURE__ */ o(
|
|
31
59
|
"div",
|
|
32
60
|
{
|
|
33
|
-
ref:
|
|
34
|
-
|
|
35
|
-
|
|
61
|
+
ref: j,
|
|
62
|
+
role: "group",
|
|
63
|
+
"aria-label": `${l.length} team members`,
|
|
64
|
+
tabIndex: 0,
|
|
65
|
+
className: n("group flex items-center", z),
|
|
66
|
+
onMouseEnter: () => m(!0),
|
|
67
|
+
onMouseLeave: () => m(!1),
|
|
68
|
+
onFocus: () => m(!0),
|
|
69
|
+
onBlur: (e) => {
|
|
70
|
+
e.currentTarget.contains(e.relatedTarget) || m(!1);
|
|
71
|
+
},
|
|
72
|
+
...S,
|
|
36
73
|
children: [
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
74
|
+
a.map((e, t) => {
|
|
75
|
+
const X = R(e.name);
|
|
76
|
+
if (u)
|
|
77
|
+
return /* @__PURE__ */ r(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: n(
|
|
81
|
+
p({ size: s }),
|
|
82
|
+
i,
|
|
83
|
+
t > 0 && d,
|
|
84
|
+
x
|
|
85
|
+
),
|
|
86
|
+
style: { zIndex: a.length - t, transform: f(t) },
|
|
87
|
+
children: u(e, t)
|
|
88
|
+
},
|
|
89
|
+
e.name
|
|
90
|
+
);
|
|
91
|
+
const v = /* @__PURE__ */ o(
|
|
92
|
+
E,
|
|
40
93
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
94
|
+
ring: e.ring,
|
|
95
|
+
className: n(
|
|
96
|
+
p({ size: s }),
|
|
97
|
+
i,
|
|
98
|
+
t > 0 && d,
|
|
99
|
+
x
|
|
44
100
|
),
|
|
45
|
-
style: { zIndex:
|
|
101
|
+
style: { zIndex: a.length - t, transform: f(t) },
|
|
46
102
|
children: [
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
103
|
+
e.image && /* @__PURE__ */ r(F, { src: e.image, alt: e.name }),
|
|
104
|
+
/* @__PURE__ */ r(
|
|
105
|
+
G,
|
|
50
106
|
{
|
|
51
107
|
className: "font-body font-semibold",
|
|
52
|
-
|
|
108
|
+
colorSeed: e.name,
|
|
109
|
+
children: X
|
|
53
110
|
}
|
|
54
111
|
)
|
|
55
112
|
]
|
|
56
113
|
},
|
|
57
|
-
|
|
114
|
+
e.name
|
|
58
115
|
);
|
|
59
|
-
return
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
116
|
+
return I ? /* @__PURE__ */ o(y, { children: [
|
|
117
|
+
/* @__PURE__ */ r(N, { asChild: !0, children: v }),
|
|
118
|
+
/* @__PURE__ */ r(
|
|
119
|
+
w,
|
|
63
120
|
{
|
|
64
121
|
className: "border-surface-border-strong bg-surface-1 text-surface-fg",
|
|
65
122
|
sideOffset: 6,
|
|
66
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ r("p", { className: "text-ds-sm", children: e.name })
|
|
67
124
|
}
|
|
68
125
|
)
|
|
69
|
-
] },
|
|
126
|
+
] }, e.name) : v;
|
|
70
127
|
}),
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */
|
|
128
|
+
c > 0 && /* @__PURE__ */ o(y, { children: [
|
|
129
|
+
/* @__PURE__ */ r(N, { asChild: !0, children: h ? /* @__PURE__ */ o(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
type: "button",
|
|
133
|
+
onClick: h,
|
|
134
|
+
className: n(
|
|
135
|
+
p({ size: s }),
|
|
136
|
+
i,
|
|
137
|
+
d,
|
|
138
|
+
"flex cursor-pointer items-center justify-center bg-accent-2 font-body font-semibold text-accent-11",
|
|
139
|
+
"hover:scale-105 hover:bg-accent-3 transition-[transform,background-color] duration-300 ease-out"
|
|
140
|
+
),
|
|
141
|
+
style: { zIndex: 0, transform: f(a.length) },
|
|
142
|
+
children: [
|
|
143
|
+
"+",
|
|
144
|
+
c
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
) : /* @__PURE__ */ o(
|
|
73
148
|
"div",
|
|
74
149
|
{
|
|
75
|
-
className:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
150
|
+
className: n(
|
|
151
|
+
p({ size: s }),
|
|
152
|
+
i,
|
|
153
|
+
d,
|
|
154
|
+
"flex cursor-default items-center justify-center bg-accent-2 font-body font-semibold text-accent-11",
|
|
155
|
+
"transition-[transform,opacity] duration-300 ease-out"
|
|
79
156
|
),
|
|
80
|
-
style: { zIndex: 0 },
|
|
157
|
+
style: { zIndex: 0, transform: f(a.length) },
|
|
81
158
|
children: [
|
|
82
159
|
"+",
|
|
83
|
-
|
|
160
|
+
c
|
|
84
161
|
]
|
|
85
162
|
}
|
|
86
163
|
) }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
164
|
+
/* @__PURE__ */ r(
|
|
165
|
+
w,
|
|
89
166
|
{
|
|
90
167
|
className: "border-surface-border-strong bg-surface-1 text-surface-fg",
|
|
91
168
|
sideOffset: 6,
|
|
92
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-ds-01", children: l.slice(g).map((e, t) => /* @__PURE__ */ r("p", { className: "text-ds-sm", children: e.name }, t)) })
|
|
93
170
|
}
|
|
94
171
|
)
|
|
95
172
|
] })
|
|
@@ -98,7 +175,7 @@ const g = w(
|
|
|
98
175
|
) });
|
|
99
176
|
}
|
|
100
177
|
);
|
|
101
|
-
|
|
178
|
+
B.displayName = "AvatarGroup";
|
|
102
179
|
export {
|
|
103
|
-
|
|
180
|
+
B as AvatarGroup
|
|
104
181
|
};
|