@devalok/shilp-sutra 0.25.0 → 0.26.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.
Files changed (103) hide show
  1. package/dist/_chunks/framer.js +2 -2
  2. package/dist/_chunks/primitives.js +39 -39
  3. package/dist/_chunks/vendor-client.js +1 -1
  4. package/dist/_chunks/vendor-utils.js +83484 -3535
  5. package/dist/ai/index.js +1 -1
  6. package/dist/composed/bulk-action-bar.d.ts +29 -0
  7. package/dist/composed/bulk-action-bar.d.ts.map +1 -0
  8. package/dist/composed/bulk-action-bar.js +123 -0
  9. package/dist/composed/deadline-indicator.d.ts +18 -0
  10. package/dist/composed/deadline-indicator.d.ts.map +1 -0
  11. package/dist/composed/deadline-indicator.js +75 -0
  12. package/dist/composed/emoji-picker.d.ts +26 -0
  13. package/dist/composed/emoji-picker.d.ts.map +1 -0
  14. package/dist/composed/emoji-picker.js +104 -0
  15. package/dist/composed/file-preview.d.ts +22 -0
  16. package/dist/composed/file-preview.d.ts.map +1 -0
  17. package/dist/composed/file-preview.js +675 -0
  18. package/dist/composed/filter-bar.d.ts +38 -0
  19. package/dist/composed/filter-bar.d.ts.map +1 -0
  20. package/dist/composed/filter-bar.js +133 -0
  21. package/dist/composed/form-section.d.ts +12 -0
  22. package/dist/composed/form-section.d.ts.map +1 -0
  23. package/dist/composed/form-section.js +45 -0
  24. package/dist/composed/index.d.ts +22 -0
  25. package/dist/composed/index.d.ts.map +1 -1
  26. package/dist/composed/index.js +61 -36
  27. package/dist/composed/inline-edit.d.ts +16 -0
  28. package/dist/composed/inline-edit.d.ts.map +1 -0
  29. package/dist/composed/inline-edit.js +107 -0
  30. package/dist/composed/markdown-viewer.d.ts +14 -0
  31. package/dist/composed/markdown-viewer.d.ts.map +1 -0
  32. package/dist/composed/markdown-viewer.js +143 -0
  33. package/dist/composed/master-detail.d.ts +35 -0
  34. package/dist/composed/master-detail.d.ts.map +1 -0
  35. package/dist/composed/master-detail.js +124 -0
  36. package/dist/composed/member-picker.d.ts.map +1 -1
  37. package/dist/composed/member-picker.js +41 -88
  38. package/dist/composed/multi-select-popover.d.ts +44 -0
  39. package/dist/composed/multi-select-popover.d.ts.map +1 -0
  40. package/dist/composed/multi-select-popover.js +185 -0
  41. package/dist/composed/responsive-overlay.d.ts +15 -0
  42. package/dist/composed/responsive-overlay.d.ts.map +1 -0
  43. package/dist/composed/responsive-overlay.js +45 -0
  44. package/dist/ui/alert-dialog.js +10 -10
  45. package/dist/ui/avatar.js +1 -1
  46. package/dist/ui/button.d.ts +1 -1
  47. package/dist/ui/button.d.ts.map +1 -1
  48. package/dist/ui/button.js +42 -36
  49. package/dist/ui/card.d.ts +6 -48
  50. package/dist/ui/card.d.ts.map +1 -1
  51. package/dist/ui/card.js +92 -49
  52. package/dist/ui/checkbox.js +1 -1
  53. package/dist/ui/collapsible.js +1 -1
  54. package/dist/ui/color-swatch.d.ts +27 -0
  55. package/dist/ui/color-swatch.d.ts.map +1 -0
  56. package/dist/ui/color-swatch.js +91 -0
  57. package/dist/ui/data-table.d.ts +7 -1
  58. package/dist/ui/data-table.d.ts.map +1 -1
  59. package/dist/ui/data-table.js +221 -215
  60. package/dist/ui/dialog.js +4 -4
  61. package/dist/ui/dropdown-menu.js +31 -31
  62. package/dist/ui/index.d.ts +3 -0
  63. package/dist/ui/index.d.ts.map +1 -1
  64. package/dist/ui/index.js +187 -180
  65. package/dist/ui/input.d.ts +1 -1
  66. package/dist/ui/input.d.ts.map +1 -1
  67. package/dist/ui/input.js +10 -9
  68. package/dist/ui/label.js +1 -1
  69. package/dist/ui/progress-ring.d.ts +46 -0
  70. package/dist/ui/progress-ring.d.ts.map +1 -0
  71. package/dist/ui/progress-ring.js +144 -0
  72. package/dist/ui/search-input.d.ts +1 -1
  73. package/dist/ui/search-input.d.ts.map +1 -1
  74. package/dist/ui/search-input.js +9 -8
  75. package/dist/ui/select.d.ts +1 -1
  76. package/dist/ui/select.d.ts.map +1 -1
  77. package/dist/ui/select.js +28 -27
  78. package/dist/ui/sheet.js +1 -1
  79. package/dist/ui/sidebar.d.ts.map +1 -1
  80. package/dist/ui/sidebar.js +15 -15
  81. package/dist/ui/status-dot.d.ts +27 -0
  82. package/dist/ui/status-dot.d.ts.map +1 -0
  83. package/dist/ui/status-dot.js +64 -0
  84. package/dist/ui/textarea.d.ts +1 -1
  85. package/dist/ui/textarea.d.ts.map +1 -1
  86. package/dist/ui/textarea.js +13 -12
  87. package/docs/components/composed/bulk-action-bar.md +40 -0
  88. package/docs/components/composed/deadline-indicator.md +27 -0
  89. package/docs/components/composed/emoji-picker.md +43 -0
  90. package/docs/components/composed/file-preview.md +40 -0
  91. package/docs/components/composed/filter-bar.md +57 -0
  92. package/docs/components/composed/form-section.md +31 -0
  93. package/docs/components/composed/inline-edit.md +35 -0
  94. package/docs/components/composed/markdown-viewer.md +27 -0
  95. package/docs/components/composed/master-detail.md +48 -0
  96. package/docs/components/composed/multi-select-popover.md +53 -0
  97. package/docs/components/composed/responsive-overlay.md +34 -0
  98. package/docs/components/ui/color-swatch.md +25 -0
  99. package/docs/components/ui/progress-ring.md +41 -0
  100. package/docs/components/ui/status-dot.md +26 -0
  101. package/llms-full.txt +528 -1
  102. package/llms.txt +37 -9
  103. package/package.json +808 -733
@@ -0,0 +1,143 @@
1
+ "use client";
2
+ import { jsx as t, Fragment as v, jsxs as c } from "react/jsx-runtime";
3
+ import * as u from "react";
4
+ import k from "react-markdown";
5
+ import w from "remark-gfm";
6
+ import { IconCheck as C, IconCopy as S } from "@tabler/icons-react";
7
+ import { cn as o } from "../ui/lib/utils.js";
8
+ import { Button as $ } from "../ui/button.js";
9
+ function g(r) {
10
+ return r.toLowerCase().replace(/[^\w]+/g, "-").replace(/(^-|-$)/g, "");
11
+ }
12
+ function m(r) {
13
+ return typeof r == "string" ? r : typeof r == "number" ? String(r) : r ? Array.isArray(r) ? r.map(m).join("") : typeof r == "object" && "props" in r ? m(r.props.children) : "" : "";
14
+ }
15
+ function b({ code: r }) {
16
+ const [a, d] = u.useState(!1), n = u.useRef();
17
+ u.useEffect(() => () => clearTimeout(n.current), []);
18
+ function i() {
19
+ navigator.clipboard.writeText(r).then(() => {
20
+ d(!0), n.current = setTimeout(() => d(!1), 2e3);
21
+ });
22
+ }
23
+ return /* @__PURE__ */ t(
24
+ $,
25
+ {
26
+ variant: "ghost",
27
+ size: "icon-xs",
28
+ className: "absolute top-ds-02 right-ds-02 opacity-0 group-hover:opacity-100 transition-opacity",
29
+ onClick: i,
30
+ "aria-label": a ? "Copied" : "Copy code",
31
+ children: a ? /* @__PURE__ */ t(C, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(S, { className: "h-3.5 w-3.5" })
32
+ }
33
+ );
34
+ }
35
+ function j({ language: r, code: a, mb: d }) {
36
+ const [n, i] = u.useState(null);
37
+ if (u.useEffect(() => {
38
+ let f = !1;
39
+ return Promise.all([
40
+ import("../_chunks/vendor-utils.js").then((e) => e.aE),
41
+ import("../_chunks/vendor-utils.js").then((e) => e.aF)
42
+ ]).then(([e, s]) => {
43
+ f || i({ Highlighter: e.Prism ?? e.default, style: s.default });
44
+ }).catch(() => {
45
+ }), () => {
46
+ f = !0;
47
+ };
48
+ }, []), !n)
49
+ return /* @__PURE__ */ c("div", { className: o("group relative", d), children: [
50
+ /* @__PURE__ */ t("pre", { className: "bg-surface-sunken rounded-ds-md p-ds-04 overflow-x-auto text-ds-sm font-mono", children: /* @__PURE__ */ t("code", { children: a }) }),
51
+ /* @__PURE__ */ t(b, { code: a })
52
+ ] });
53
+ const { Highlighter: p, style: l } = n;
54
+ return /* @__PURE__ */ c("div", { className: o("group relative", d), children: [
55
+ /* @__PURE__ */ t(
56
+ p,
57
+ {
58
+ language: r,
59
+ style: l,
60
+ customStyle: {
61
+ margin: 0,
62
+ borderRadius: "var(--radius-md)",
63
+ fontSize: "var(--font-size-sm)",
64
+ padding: "var(--spacing-04)"
65
+ },
66
+ children: a
67
+ }
68
+ ),
69
+ /* @__PURE__ */ t(b, { code: a })
70
+ ] });
71
+ }
72
+ function P({
73
+ content: r,
74
+ compact: a = !1,
75
+ allowHtml: d = !1,
76
+ linkTarget: n = "_blank",
77
+ className: i,
78
+ ...p
79
+ }) {
80
+ const l = a ? "mb-ds-02" : "mb-ds-03", f = a ? "mt-ds-03" : "mt-ds-05";
81
+ return /* @__PURE__ */ t("div", { className: o("font-sans text-surface-fg", i), ...p, children: /* @__PURE__ */ t(
82
+ k,
83
+ {
84
+ remarkPlugins: [w],
85
+ skipHtml: !d,
86
+ components: {
87
+ h1: ({ children: e }) => {
88
+ const s = g(m(e));
89
+ return /* @__PURE__ */ c("h1", { id: s, className: o("group", a ? "text-ds-md" : "text-ds-lg", "font-semibold text-surface-fg", f, l), children: [
90
+ /* @__PURE__ */ t("a", { href: `#${s}`, className: "opacity-0 group-hover:opacity-100 text-surface-fg-subtle mr-ds-02 no-underline", "aria-hidden": "true", children: "#" }),
91
+ e
92
+ ] });
93
+ },
94
+ h2: ({ children: e }) => {
95
+ const s = g(m(e));
96
+ return /* @__PURE__ */ c("h2", { id: s, className: o("group", "text-ds-md font-semibold text-surface-fg", a ? "mt-ds-03" : "mt-ds-04", l), children: [
97
+ /* @__PURE__ */ t("a", { href: `#${s}`, className: "opacity-0 group-hover:opacity-100 text-surface-fg-subtle mr-ds-02 no-underline", "aria-hidden": "true", children: "#" }),
98
+ e
99
+ ] });
100
+ },
101
+ h3: ({ children: e }) => {
102
+ const s = g(m(e));
103
+ return /* @__PURE__ */ c("h3", { id: s, className: o("group", "text-ds-md font-semibold text-surface-fg", "mt-ds-03", l), children: [
104
+ /* @__PURE__ */ t("a", { href: `#${s}`, className: "opacity-0 group-hover:opacity-100 text-surface-fg-subtle mr-ds-02 no-underline", "aria-hidden": "true", children: "#" }),
105
+ e
106
+ ] });
107
+ },
108
+ p: ({ children: e }) => /* @__PURE__ */ t("p", { className: o("text-ds-md text-surface-fg leading-ds-relaxed", l), children: e }),
109
+ a: ({ href: e, children: s }) => /* @__PURE__ */ t(
110
+ "a",
111
+ {
112
+ href: e,
113
+ target: n,
114
+ rel: n === "_blank" ? "noopener noreferrer" : void 0,
115
+ className: "text-accent-11 hover:underline",
116
+ children: s
117
+ }
118
+ ),
119
+ code: ({ className: e, children: s, ...x }) => {
120
+ const h = e ? /language-(\w+)/.exec(e) : null;
121
+ if (h) {
122
+ const y = h[1], N = String(s).replace(/\n$/, "");
123
+ return /* @__PURE__ */ t(j, { language: y, code: N, mb: l });
124
+ }
125
+ return /* @__PURE__ */ t("code", { className: "bg-surface-sunken rounded-ds-sm px-1.5 py-0.5 text-ds-sm font-mono text-surface-fg", ...x, children: s });
126
+ },
127
+ pre: ({ children: e }) => /* @__PURE__ */ t(v, { children: e }),
128
+ blockquote: ({ children: e }) => /* @__PURE__ */ t("blockquote", { className: o("border-l-2 border-surface-border-subtle pl-ds-04 text-surface-fg-muted italic", l), children: e }),
129
+ ul: ({ children: e }) => /* @__PURE__ */ t("ul", { className: o("list-disc pl-ds-06 text-ds-md text-surface-fg space-y-ds-01", l), children: e }),
130
+ ol: ({ children: e }) => /* @__PURE__ */ t("ol", { className: o("list-decimal pl-ds-06 text-ds-md text-surface-fg space-y-ds-01", l), children: e }),
131
+ table: ({ children: e }) => /* @__PURE__ */ t("div", { className: o("overflow-x-auto", l), children: /* @__PURE__ */ t("table", { className: "w-full border-collapse", children: e }) }),
132
+ th: ({ children: e }) => /* @__PURE__ */ t("th", { className: "border border-surface-border-subtle px-ds-03 py-ds-02 text-left text-ds-sm font-semibold bg-surface-sunken", children: e }),
133
+ td: ({ children: e }) => /* @__PURE__ */ t("td", { className: "border border-surface-border-subtle px-ds-03 py-ds-02 text-ds-sm", children: e }),
134
+ hr: () => /* @__PURE__ */ t("hr", { className: o("border-surface-border-subtle", a ? "my-ds-03" : "my-ds-04") }),
135
+ img: ({ src: e, alt: s }) => /* @__PURE__ */ t("img", { src: e, alt: s ?? "", className: "rounded-ds-md max-w-full", loading: "lazy" })
136
+ },
137
+ children: r
138
+ }
139
+ ) });
140
+ }
141
+ export {
142
+ P as MarkdownViewer
143
+ };
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ export interface MasterDetailProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** ID of currently selected item. null = no selection (show list on mobile). */
5
+ selected?: string | null;
6
+ /** Called when mobile back button is pressed */
7
+ onBack?: () => void;
8
+ /** Master panel width on desktop @default '280px' */
9
+ masterWidth?: string;
10
+ /** Breakpoint below which stacked mode activates @default 'md' */
11
+ breakpoint?: 'sm' | 'md' | 'lg';
12
+ /** Content to show in the detail pane when nothing is selected */
13
+ emptyState?: React.ReactNode;
14
+ /** Called when user presses ArrowUp/ArrowDown while the list has focus */
15
+ onNavigate?: (direction: 'up' | 'down') => void;
16
+ }
17
+ interface MasterDetailListProps extends React.HTMLAttributes<HTMLDivElement> {
18
+ }
19
+ interface MasterDetailDetailProps extends React.HTMLAttributes<HTMLDivElement> {
20
+ }
21
+ interface MasterDetailListItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
22
+ active?: boolean;
23
+ }
24
+ declare function MasterDetailList({ children, className, ...props }: MasterDetailListProps): import("react/jsx-runtime").JSX.Element | null;
25
+ declare function MasterDetailDetail({ children, className, ...props }: MasterDetailDetailProps): import("react/jsx-runtime").JSX.Element | null;
26
+ declare function MasterDetailListItem({ active, children, className, ...props }: MasterDetailListItemProps): import("react/jsx-runtime").JSX.Element;
27
+ declare function MasterDetailRoot({ selected, onBack, masterWidth, breakpoint, emptyState, onNavigate, children, className, style, ...props }: MasterDetailProps): import("react/jsx-runtime").JSX.Element;
28
+ declare const MasterDetail: typeof MasterDetailRoot & {
29
+ List: typeof MasterDetailList;
30
+ Detail: typeof MasterDetailDetail;
31
+ ListItem: typeof MasterDetailListItem;
32
+ };
33
+ export { MasterDetail };
34
+ export type { MasterDetailListItemProps };
35
+ //# sourceMappingURL=master-detail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"master-detail.d.ts","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UAAU,EACV,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,iBAAiB,2CAqBnB;AAED,QAAA,MAAM,YAAY;;;;CAIhB,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
@@ -0,0 +1,124 @@
1
+ "use client";
2
+ import { jsx as i, jsxs as x } from "react/jsx-runtime";
3
+ import * as c from "react";
4
+ import { IconArrowLeft as b } from "@tabler/icons-react";
5
+ import { cn as d } from "../ui/lib/utils.js";
6
+ import { Button as h } from "../ui/button.js";
7
+ import { springs as v } from "../ui/lib/motion.js";
8
+ import { A as w, m as y } from "../_chunks/framer.js";
9
+ const D = {
10
+ sm: "640px",
11
+ md: "768px",
12
+ lg: "1024px"
13
+ };
14
+ function M(e) {
15
+ const [n, s] = c.useState(!1);
16
+ return c.useEffect(() => {
17
+ if (typeof window > "u") return;
18
+ const t = window.matchMedia(e);
19
+ s(t.matches);
20
+ const o = (r) => s(r.matches);
21
+ return t.addEventListener("change", o), () => t.removeEventListener("change", o);
22
+ }, [e]), n;
23
+ }
24
+ const m = c.createContext({
25
+ selected: null,
26
+ isMobile: !1
27
+ });
28
+ function g({ children: e, className: n, ...s }) {
29
+ const { selected: t, isMobile: o, onNavigate: r } = c.useContext(m);
30
+ if (o && t) return null;
31
+ function l(a) {
32
+ a.key === "ArrowDown" ? (a.preventDefault(), r == null || r("down")) : a.key === "ArrowUp" && (a.preventDefault(), r == null || r("up"));
33
+ }
34
+ return /* @__PURE__ */ i(
35
+ "div",
36
+ {
37
+ role: "listbox",
38
+ tabIndex: 0,
39
+ className: d(
40
+ "overflow-y-auto focus-visible:outline-none",
41
+ !o && "border-r border-surface-border",
42
+ n
43
+ ),
44
+ onKeyDown: l,
45
+ ...s,
46
+ children: e
47
+ }
48
+ );
49
+ }
50
+ function L({ children: e, className: n, ...s }) {
51
+ const { selected: t, isMobile: o, onBack: r, emptyState: l } = c.useContext(m);
52
+ return o && !t ? null : /* @__PURE__ */ x("div", { className: d("flex-1 overflow-y-auto", n), ...s, children: [
53
+ o && r && /* @__PURE__ */ i("div", { className: "border-b border-surface-border px-ds-04 py-ds-03", children: /* @__PURE__ */ i(h, { variant: "ghost", size: "xs", onClick: r, startIcon: /* @__PURE__ */ i(b, { className: "h-ico-sm w-ico-sm" }), children: "Back" }) }),
54
+ /* @__PURE__ */ i(w, { mode: "wait", children: /* @__PURE__ */ i(
55
+ y.div,
56
+ {
57
+ initial: o ? { x: 20, opacity: 0 } : !1,
58
+ animate: { x: 0, opacity: 1 },
59
+ exit: o ? { x: -20, opacity: 0 } : void 0,
60
+ transition: v.snappy,
61
+ children: t ? e : l ?? e
62
+ },
63
+ t ?? "empty"
64
+ ) })
65
+ ] });
66
+ }
67
+ function k({ active: e = !1, children: n, className: s, ...t }) {
68
+ return /* @__PURE__ */ i(
69
+ "button",
70
+ {
71
+ type: "button",
72
+ role: "option",
73
+ "aria-selected": e,
74
+ "data-active": e || void 0,
75
+ className: d(
76
+ "flex w-full items-center px-ds-04 py-ds-03 text-left text-ds-md font-sans text-surface-fg",
77
+ "transition-colors duration-fast-01 ease-productive-standard",
78
+ "hover:bg-surface-raised-hover",
79
+ e && "bg-accent-2 text-accent-11 border-l-2 border-accent-9",
80
+ s
81
+ ),
82
+ ...t,
83
+ children: n
84
+ }
85
+ );
86
+ }
87
+ function C({
88
+ selected: e = null,
89
+ onBack: n,
90
+ masterWidth: s = "280px",
91
+ breakpoint: t = "md",
92
+ emptyState: o,
93
+ onNavigate: r,
94
+ children: l,
95
+ className: a,
96
+ style: u,
97
+ ...p
98
+ }) {
99
+ const f = M(`(max-width: ${D[t]})`);
100
+ return /* @__PURE__ */ i(m.Provider, { value: { selected: e, isMobile: f, onBack: n, emptyState: o, onNavigate: r }, children: /* @__PURE__ */ i(
101
+ "div",
102
+ {
103
+ className: d(
104
+ "flex h-full",
105
+ !f && "grid",
106
+ a
107
+ ),
108
+ style: {
109
+ ...u,
110
+ ...f ? {} : { gridTemplateColumns: `${s} 1fr` }
111
+ },
112
+ ...p,
113
+ children: l
114
+ }
115
+ ) });
116
+ }
117
+ const K = Object.assign(C, {
118
+ List: g,
119
+ Detail: L,
120
+ ListItem: k
121
+ });
122
+ export {
123
+ K as MasterDetail
124
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"member-picker.d.ts","sourceRoot":"","sources":["../../src/composed/member-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAqB9B,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAChG,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAMD,QAAA,MAAM,YAAY,0FA6FjB,CAAA;AAID,OAAO,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"member-picker.d.ts","sourceRoot":"","sources":["../../src/composed/member-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAa9B,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAChG,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAMD,QAAA,MAAM,YAAY,0FAqDjB,CAAA;AAID,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -1,97 +1,50 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
3
- import * as a from "react";
4
- import { cn as i } from "../ui/lib/utils.js";
5
- import { Popover as N, PopoverTrigger as y, PopoverContent as w } from "../ui/popover.js";
6
- import { Avatar as k, AvatarImage as C, AvatarFallback as S } from "../ui/avatar.js";
7
- import { IconSearch as P, IconCheck as I } from "@tabler/icons-react";
8
- import { springs as A } from "../ui/lib/motion.js";
9
- import { getInitials as O } from "./lib/string-utils.js";
10
- import { m as j } from "../_chunks/framer.js";
11
- const L = a.forwardRef(
2
+ import { jsx as a, jsxs as s } from "react/jsx-runtime";
3
+ import * as c from "react";
4
+ import { Avatar as b, AvatarImage as v, AvatarFallback as N } from "../ui/avatar.js";
5
+ import { MultiSelectPopover as M } from "./multi-select-popover.js";
6
+ import { getInitials as P } from "./lib/string-utils.js";
7
+ const k = c.forwardRef(
12
8
  ({
13
9
  members: l,
14
- selectedIds: d,
15
- onSelect: f,
16
- children: m,
17
- multiple: p = !1,
18
- placeholder: u = "Search members...",
19
- className: h,
20
- ...x
10
+ selectedIds: r,
11
+ onSelect: i,
12
+ children: n,
13
+ multiple: m = !1,
14
+ placeholder: d = "Search members...",
15
+ ...f
21
16
  }, g) => {
22
- const [b, r] = a.useState(!1), [o, v] = a.useState(""), c = l.filter(
23
- (e) => e.name.toLowerCase().includes(o.toLowerCase())
17
+ const h = c.useMemo(
18
+ () => l.map((e) => ({ id: e.id, label: e.name, image: e.avatar })),
19
+ [l]
20
+ );
21
+ function u(e) {
22
+ const p = e.find((t) => !r.includes(t)), x = r.find((t) => !e.includes(t)), o = p ?? x;
23
+ o && i(o);
24
+ }
25
+ return /* @__PURE__ */ a(
26
+ M,
27
+ {
28
+ ref: g,
29
+ items: h,
30
+ value: r,
31
+ onValueChange: u,
32
+ searchPlaceholder: d,
33
+ maxSelections: m ? void 0 : 1,
34
+ renderItem: (e) => /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
35
+ /* @__PURE__ */ s(b, { className: "h-ico-md w-ico-md", children: [
36
+ e.image && /* @__PURE__ */ a(v, { src: e.image, alt: e.label }),
37
+ /* @__PURE__ */ a(N, { className: "bg-surface-raised-hover text-ds-xs font-semibold text-surface-fg", children: P(e.label) })
38
+ ] }),
39
+ /* @__PURE__ */ a("span", { className: "flex-1 truncate text-ds-md font-body text-surface-fg", children: e.label })
40
+ ] }),
41
+ ...f,
42
+ children: n
43
+ }
24
44
  );
25
- return /* @__PURE__ */ s(N, { open: b, onOpenChange: r, children: [
26
- /* @__PURE__ */ t(y, { asChild: !0, children: m }),
27
- /* @__PURE__ */ s(
28
- w,
29
- {
30
- ref: g,
31
- ...x,
32
- className: i("w-[220px] border-surface-border-strong bg-surface-overlay p-0", h),
33
- align: "start",
34
- sideOffset: 4,
35
- children: [
36
- /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03 border-b border-surface-border-strong px-ds-04 py-ds-03", children: [
37
- /* @__PURE__ */ t(P, { className: "h-ico-sm w-ico-sm shrink-0 text-surface-fg-subtle", stroke: 1.5 }),
38
- /* @__PURE__ */ t(
39
- "input",
40
- {
41
- type: "text",
42
- placeholder: u,
43
- value: o,
44
- onChange: (e) => v(e.target.value),
45
- "aria-label": "Search members",
46
- className: "w-full bg-transparent text-ds-md font-body text-surface-fg placeholder:text-surface-fg-subtle outline-none focus-visible:ring-1 focus-visible:ring-accent-7"
47
- }
48
- )
49
- ] }),
50
- /* @__PURE__ */ s("div", { className: "max-h-[200px] overflow-y-auto py-ds-02", children: [
51
- c.map((e) => {
52
- const n = d.includes(e.id);
53
- return /* @__PURE__ */ s(
54
- "button",
55
- {
56
- type: "button",
57
- onClick: () => {
58
- f(e.id), p || r(!1);
59
- },
60
- className: i(
61
- "flex w-full items-center gap-ds-03 px-ds-04 py-ds-02b text-left transition-colors duration-fast-01 ease-productive-standard",
62
- "hover:bg-surface-raised-hover",
63
- n && "bg-accent-2 text-accent-11"
64
- ),
65
- children: [
66
- /* @__PURE__ */ s(k, { className: "h-ico-md w-ico-md", children: [
67
- e.avatar && /* @__PURE__ */ t(C, { src: e.avatar, alt: e.name }),
68
- /* @__PURE__ */ t(S, { className: "bg-surface-raised-hover text-ds-xs font-semibold text-surface-fg", children: O(e.name) })
69
- ] }),
70
- /* @__PURE__ */ t("span", { className: "flex-1 truncate text-ds-md font-body text-surface-fg", children: e.name }),
71
- n && /* @__PURE__ */ t(
72
- j.span,
73
- {
74
- initial: { scale: 0 },
75
- animate: { scale: 1 },
76
- transition: A.bouncy,
77
- className: "inline-flex shrink-0",
78
- children: /* @__PURE__ */ t(I, { className: "h-ico-sm w-ico-sm text-accent-11" })
79
- }
80
- )
81
- ]
82
- },
83
- e.id
84
- );
85
- }),
86
- c.length === 0 && /* @__PURE__ */ t("p", { className: "px-ds-04 py-ds-05 text-center text-ds-sm font-body text-surface-fg-subtle", children: "No members found" })
87
- ] })
88
- ]
89
- }
90
- )
91
- ] });
92
45
  }
93
46
  );
94
- L.displayName = "MemberPicker";
47
+ k.displayName = "MemberPicker";
95
48
  export {
96
- L as MemberPicker
49
+ k as MemberPicker
97
50
  };
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ export interface MultiSelectItem {
4
+ id: string;
5
+ label: string;
6
+ image?: string;
7
+ description?: string;
8
+ disabled?: boolean;
9
+ }
10
+ export interface MultiSelectGroup {
11
+ label: string;
12
+ items: MultiSelectItem[];
13
+ }
14
+ export interface MultiSelectPopoverProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onSelect'> {
15
+ /** Flat list of items (use `groups` for grouped rendering) */
16
+ items?: MultiSelectItem[];
17
+ /** Grouped items with section headers */
18
+ groups?: MultiSelectGroup[];
19
+ /** Currently selected item IDs */
20
+ value: string[];
21
+ /** Called when selection changes */
22
+ onValueChange: (ids: string[]) => void;
23
+ /** @default 'Search...' */
24
+ searchPlaceholder?: string;
25
+ /** Async search — replaces local filter with server results */
26
+ onSearch?: (query: string) => Promise<MultiSelectItem[]>;
27
+ /** Debounce for async search in ms @default 300 */
28
+ searchDebounce?: number;
29
+ /** Custom item renderer */
30
+ renderItem?: (item: MultiSelectItem, selected: boolean) => React.ReactNode;
31
+ /** Message when no items match filter @default 'No results found' */
32
+ emptyMessage?: string;
33
+ /** Maximum number of selections */
34
+ maxSelections?: number;
35
+ /** Popover alignment @default 'start' */
36
+ align?: 'start' | 'center' | 'end';
37
+ /** Popover width */
38
+ width?: string | number;
39
+ /** Trigger element */
40
+ children: React.ReactNode;
41
+ }
42
+ declare const MultiSelectPopover: React.ForwardRefExoticComponent<MultiSelectPopoverProps & React.RefAttributes<HTMLDivElement>>;
43
+ export { MultiSelectPopover };
44
+ //# sourceMappingURL=multi-select-popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-select-popover.d.ts","sourceRoot":"","sources":["../../src/composed/multi-select-popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAgB9B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,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