@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.
- package/dist/_chunks/framer.js +2 -2
- package/dist/_chunks/primitives.js +39 -39
- package/dist/_chunks/vendor-client.js +1 -1
- package/dist/_chunks/vendor-utils.js +83484 -3535
- package/dist/ai/index.js +1 -1
- package/dist/composed/bulk-action-bar.d.ts +29 -0
- package/dist/composed/bulk-action-bar.d.ts.map +1 -0
- package/dist/composed/bulk-action-bar.js +123 -0
- package/dist/composed/deadline-indicator.d.ts +18 -0
- package/dist/composed/deadline-indicator.d.ts.map +1 -0
- package/dist/composed/deadline-indicator.js +75 -0
- package/dist/composed/emoji-picker.d.ts +26 -0
- package/dist/composed/emoji-picker.d.ts.map +1 -0
- package/dist/composed/emoji-picker.js +104 -0
- package/dist/composed/file-preview.d.ts +22 -0
- package/dist/composed/file-preview.d.ts.map +1 -0
- package/dist/composed/file-preview.js +675 -0
- package/dist/composed/filter-bar.d.ts +38 -0
- package/dist/composed/filter-bar.d.ts.map +1 -0
- package/dist/composed/filter-bar.js +133 -0
- package/dist/composed/form-section.d.ts +12 -0
- package/dist/composed/form-section.d.ts.map +1 -0
- package/dist/composed/form-section.js +45 -0
- package/dist/composed/index.d.ts +22 -0
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +61 -36
- package/dist/composed/inline-edit.d.ts +16 -0
- package/dist/composed/inline-edit.d.ts.map +1 -0
- package/dist/composed/inline-edit.js +107 -0
- package/dist/composed/markdown-viewer.d.ts +14 -0
- package/dist/composed/markdown-viewer.d.ts.map +1 -0
- package/dist/composed/markdown-viewer.js +143 -0
- package/dist/composed/master-detail.d.ts +35 -0
- package/dist/composed/master-detail.d.ts.map +1 -0
- package/dist/composed/master-detail.js +124 -0
- package/dist/composed/member-picker.d.ts.map +1 -1
- package/dist/composed/member-picker.js +41 -88
- package/dist/composed/multi-select-popover.d.ts +44 -0
- package/dist/composed/multi-select-popover.d.ts.map +1 -0
- package/dist/composed/multi-select-popover.js +185 -0
- package/dist/composed/responsive-overlay.d.ts +15 -0
- package/dist/composed/responsive-overlay.d.ts.map +1 -0
- package/dist/composed/responsive-overlay.js +45 -0
- package/dist/ui/alert-dialog.js +10 -10
- package/dist/ui/avatar.js +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +42 -36
- package/dist/ui/card.d.ts +6 -48
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +92 -49
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/color-swatch.d.ts +27 -0
- package/dist/ui/color-swatch.d.ts.map +1 -0
- package/dist/ui/color-swatch.js +91 -0
- package/dist/ui/data-table.d.ts +7 -1
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +221 -215
- package/dist/ui/dialog.js +4 -4
- package/dist/ui/dropdown-menu.js +31 -31
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +187 -180
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +10 -9
- package/dist/ui/label.js +1 -1
- package/dist/ui/progress-ring.d.ts +46 -0
- package/dist/ui/progress-ring.d.ts.map +1 -0
- package/dist/ui/progress-ring.js +144 -0
- package/dist/ui/search-input.d.ts +1 -1
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +9 -8
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +28 -27
- package/dist/ui/sheet.js +1 -1
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +15 -15
- package/dist/ui/status-dot.d.ts +27 -0
- package/dist/ui/status-dot.d.ts.map +1 -0
- package/dist/ui/status-dot.js +64 -0
- package/dist/ui/textarea.d.ts +1 -1
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +13 -12
- package/docs/components/composed/bulk-action-bar.md +40 -0
- package/docs/components/composed/deadline-indicator.md +27 -0
- package/docs/components/composed/emoji-picker.md +43 -0
- package/docs/components/composed/file-preview.md +40 -0
- package/docs/components/composed/filter-bar.md +57 -0
- package/docs/components/composed/form-section.md +31 -0
- package/docs/components/composed/inline-edit.md +35 -0
- package/docs/components/composed/markdown-viewer.md +27 -0
- package/docs/components/composed/master-detail.md +48 -0
- package/docs/components/composed/multi-select-popover.md +53 -0
- package/docs/components/composed/responsive-overlay.md +34 -0
- package/docs/components/ui/color-swatch.md +25 -0
- package/docs/components/ui/progress-ring.md +41 -0
- package/docs/components/ui/status-dot.md +26 -0
- package/llms-full.txt +528 -1
- package/llms.txt +37 -9
- package/package.json +808 -733
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type FilterBarSize = 'xs' | 'sm' | 'md';
|
|
4
|
+
export interface FilterBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
searchValue?: string;
|
|
6
|
+
onSearchChange?: (value: string) => void;
|
|
7
|
+
searchPlaceholder?: string;
|
|
8
|
+
onClearAll?: () => void;
|
|
9
|
+
/** Size propagated to all child controls @default 'sm' */
|
|
10
|
+
size?: FilterBarSize;
|
|
11
|
+
}
|
|
12
|
+
declare function FilterBar({ searchValue, onSearchChange, searchPlaceholder, onClearAll, size, children, className, ...props }: FilterBarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export interface FilterSelectProps {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
onValueChange: (value: string) => void;
|
|
17
|
+
options: {
|
|
18
|
+
value: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}[];
|
|
21
|
+
/** Label for the "all" option @default 'All' */
|
|
22
|
+
allLabel?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
declare function FilterSelect({ label, value, onValueChange, options, allLabel, className, }: FilterSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export interface FilterMultiSelectProps {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string[];
|
|
29
|
+
onValueChange: (values: string[]) => void;
|
|
30
|
+
options: {
|
|
31
|
+
value: string;
|
|
32
|
+
label: string;
|
|
33
|
+
}[];
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
declare function FilterMultiSelect({ label, value, onValueChange, options, className, }: FilterMultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export { FilterBar, FilterSelect, FilterMultiSelect };
|
|
38
|
+
//# sourceMappingURL=filter-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-bar.d.ts","sourceRoot":"","sources":["../../src/composed/filter-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAqB9B,KAAK,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAQvC,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,aAAa,CAAA;CACrB;AAED,iBAAS,SAAS,CAAC,EACjB,WAAW,EACX,cAAc,EACd,iBAA+B,EAC/B,UAAU,EACV,IAAW,EACX,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,2CA4BhB;AAMD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC3C,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,KAAK,EACL,aAAa,EACb,OAAO,EACP,QAAgB,EAChB,SAAS,GACV,EAAE,iBAAiB,2CAsBnB;AAMD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACzC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,iBAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,KAAK,EACL,aAAa,EACb,OAAO,EACP,SAAS,GACV,EAAE,sBAAsB,2CAsDxB;AAED,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import * as m from "react";
|
|
4
|
+
import { IconChevronDown as x } from "@tabler/icons-react";
|
|
5
|
+
import { cn as p } from "../ui/lib/utils.js";
|
|
6
|
+
import { springs as v } from "../ui/lib/motion.js";
|
|
7
|
+
import { SearchInput as b } from "../ui/search-input.js";
|
|
8
|
+
import { Button as g } from "../ui/button.js";
|
|
9
|
+
import { Badge as w } from "../ui/badge.js";
|
|
10
|
+
import { Select as S, SelectTrigger as C, SelectValue as N, SelectContent as F, SelectItem as f } from "../ui/select.js";
|
|
11
|
+
import { MultiSelectPopover as y } from "./multi-select-popover.js";
|
|
12
|
+
import { m as B } from "../_chunks/framer.js";
|
|
13
|
+
const u = m.createContext({ size: "sm" });
|
|
14
|
+
function $({
|
|
15
|
+
searchValue: s,
|
|
16
|
+
onSearchChange: t,
|
|
17
|
+
searchPlaceholder: o = "Search...",
|
|
18
|
+
onClearAll: a,
|
|
19
|
+
size: l = "sm",
|
|
20
|
+
children: n,
|
|
21
|
+
className: r,
|
|
22
|
+
...d
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ e(u.Provider, { value: { size: l }, children: /* @__PURE__ */ c(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: p("flex flex-wrap items-center gap-ds-03", r),
|
|
28
|
+
role: "toolbar",
|
|
29
|
+
"aria-label": "Filters",
|
|
30
|
+
...d,
|
|
31
|
+
children: [
|
|
32
|
+
t && /* @__PURE__ */ e(
|
|
33
|
+
b,
|
|
34
|
+
{
|
|
35
|
+
size: l,
|
|
36
|
+
value: s,
|
|
37
|
+
onChange: (i) => t(i.target.value),
|
|
38
|
+
onClear: s ? () => t("") : void 0,
|
|
39
|
+
placeholder: o,
|
|
40
|
+
className: "w-48"
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
n,
|
|
44
|
+
a && /* @__PURE__ */ e(g, { variant: "ghost", size: l, onClick: a, children: "Clear all" })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
) });
|
|
48
|
+
}
|
|
49
|
+
function q({
|
|
50
|
+
label: s,
|
|
51
|
+
value: t,
|
|
52
|
+
onValueChange: o,
|
|
53
|
+
options: a,
|
|
54
|
+
allLabel: l = "All",
|
|
55
|
+
className: n
|
|
56
|
+
}) {
|
|
57
|
+
const { size: r } = m.useContext(u);
|
|
58
|
+
return /* @__PURE__ */ c(S, { value: t, onValueChange: o, children: [
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
C,
|
|
61
|
+
{
|
|
62
|
+
size: r,
|
|
63
|
+
className: p("w-40", t !== "" && t !== "all" && "border-accent-7", n),
|
|
64
|
+
children: /* @__PURE__ */ e(N, { placeholder: s })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ c(F, { children: [
|
|
68
|
+
/* @__PURE__ */ e(f, { value: "all", children: l }),
|
|
69
|
+
a.map((i) => /* @__PURE__ */ e(f, { value: i.value, children: i.label }, i.value))
|
|
70
|
+
] })
|
|
71
|
+
] });
|
|
72
|
+
}
|
|
73
|
+
function A({
|
|
74
|
+
label: s,
|
|
75
|
+
value: t,
|
|
76
|
+
onValueChange: o,
|
|
77
|
+
options: a,
|
|
78
|
+
className: l
|
|
79
|
+
}) {
|
|
80
|
+
const { size: n } = m.useContext(u), r = t.length, d = m.useMemo(
|
|
81
|
+
() => a.map((h) => ({ id: h.value, label: h.label })),
|
|
82
|
+
[a]
|
|
83
|
+
), i = {
|
|
84
|
+
xs: "h-ds-xs-plus text-ds-sm px-ds-02",
|
|
85
|
+
sm: "h-ds-sm text-ds-sm px-ds-03",
|
|
86
|
+
md: "h-ds-md text-ds-md px-ds-04"
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ e(
|
|
89
|
+
y,
|
|
90
|
+
{
|
|
91
|
+
items: d,
|
|
92
|
+
value: t,
|
|
93
|
+
onValueChange: o,
|
|
94
|
+
searchPlaceholder: `Search ${s.toLowerCase()}...`,
|
|
95
|
+
children: /* @__PURE__ */ c(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
type: "button",
|
|
99
|
+
className: p(
|
|
100
|
+
"flex items-center justify-between gap-ds-02 whitespace-nowrap rounded-ds-md border bg-surface-raised-hover text-surface-fg",
|
|
101
|
+
"hover:bg-surface-raised-active transition-colors duration-fast-01 ease-productive-standard",
|
|
102
|
+
i[n],
|
|
103
|
+
r > 0 ? "border-accent-7" : "border-surface-border-strong",
|
|
104
|
+
"w-40",
|
|
105
|
+
l
|
|
106
|
+
),
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ c("span", { className: "flex items-center gap-ds-02 truncate", children: [
|
|
109
|
+
/* @__PURE__ */ e("span", { children: s }),
|
|
110
|
+
r > 0 && /* @__PURE__ */ e(
|
|
111
|
+
B.span,
|
|
112
|
+
{
|
|
113
|
+
initial: { scale: 0.8 },
|
|
114
|
+
animate: { scale: 1 },
|
|
115
|
+
transition: v.bouncy,
|
|
116
|
+
className: "inline-flex",
|
|
117
|
+
children: /* @__PURE__ */ e(w, { size: "xs", variant: "solid", className: "ml-ds-01", children: r })
|
|
118
|
+
},
|
|
119
|
+
r
|
|
120
|
+
)
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ e(x, { className: "h-3.5 w-3.5 opacity-50 shrink-0" })
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
$ as FilterBar,
|
|
131
|
+
A as FilterMultiSelect,
|
|
132
|
+
q as FilterSelect
|
|
133
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface FormSectionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
collapsible?: boolean;
|
|
7
|
+
/** @default true */
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function FormSection({ title, description, collapsible, defaultOpen, children, className, ...props }: FormSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { FormSection };
|
|
12
|
+
//# sourceMappingURL=form-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-section.d.ts","sourceRoot":"","sources":["../../src/composed/form-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAMD,iBAAS,WAAW,CAAC,EACnB,KAAK,EACL,WAAW,EACX,WAAmB,EACnB,WAAkB,EAClB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAgDlB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as p from "react";
|
|
4
|
+
import { cn as l } from "../ui/lib/utils.js";
|
|
5
|
+
import { springs as u } from "../ui/lib/motion.js";
|
|
6
|
+
import { IconChevronDown as b } from "@tabler/icons-react";
|
|
7
|
+
import { Collapsible as x, CollapsibleTrigger as h, CollapsibleContent as N } from "../ui/collapsible.js";
|
|
8
|
+
import { m as g } from "../_chunks/framer.js";
|
|
9
|
+
function O({
|
|
10
|
+
title: c,
|
|
11
|
+
description: r,
|
|
12
|
+
collapsible: m = !1,
|
|
13
|
+
defaultOpen: a = !0,
|
|
14
|
+
children: t,
|
|
15
|
+
className: o,
|
|
16
|
+
...n
|
|
17
|
+
}) {
|
|
18
|
+
const i = /* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-01", children: [
|
|
19
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md font-semibold text-surface-fg font-sans", children: c }),
|
|
20
|
+
r && /* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-muted font-sans", children: r })
|
|
21
|
+
] }), [d, f] = p.useState(a);
|
|
22
|
+
return m ? /* @__PURE__ */ s(x, { defaultOpen: a, onOpenChange: f, className: l("space-y-ds-04", o), ...n, children: [
|
|
23
|
+
/* @__PURE__ */ s(h, { className: "flex w-full items-center justify-between py-ds-02 group", children: [
|
|
24
|
+
i,
|
|
25
|
+
/* @__PURE__ */ e(
|
|
26
|
+
g.span,
|
|
27
|
+
{
|
|
28
|
+
animate: { rotate: d ? 180 : 0 },
|
|
29
|
+
transition: u.snappy,
|
|
30
|
+
className: "inline-flex",
|
|
31
|
+
children: /* @__PURE__ */ e(b, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" })
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ e("div", { className: "border-b border-surface-border-subtle" }),
|
|
36
|
+
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ e("div", { className: "space-y-ds-04 pt-ds-02", children: t }) })
|
|
37
|
+
] }) : /* @__PURE__ */ s("div", { className: l("space-y-ds-04", o), ...n, children: [
|
|
38
|
+
i,
|
|
39
|
+
/* @__PURE__ */ e("div", { className: "border-b border-surface-border-subtle" }),
|
|
40
|
+
/* @__PURE__ */ e("div", { className: "space-y-ds-04", children: t })
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
O as FormSection
|
|
45
|
+
};
|
package/dist/composed/index.d.ts
CHANGED
|
@@ -48,5 +48,27 @@ export { ConfirmDialog } from './confirm-dialog';
|
|
|
48
48
|
export type { ConfirmDialogProps } from './confirm-dialog';
|
|
49
49
|
export { ActivityFeed, groupItemsByTime } from './activity-feed';
|
|
50
50
|
export type { ActivityItem, ActivityFeedProps, GroupLabels } from './activity-feed';
|
|
51
|
+
export { MultiSelectPopover } from './multi-select-popover';
|
|
52
|
+
export type { MultiSelectPopoverProps, MultiSelectItem, MultiSelectGroup } from './multi-select-popover';
|
|
53
|
+
export { FilterBar, FilterSelect, FilterMultiSelect } from './filter-bar';
|
|
54
|
+
export type { FilterBarProps, FilterSelectProps, FilterMultiSelectProps } from './filter-bar';
|
|
55
|
+
export { InlineEdit } from './inline-edit';
|
|
56
|
+
export type { InlineEditProps } from './inline-edit';
|
|
57
|
+
export { FormSection } from './form-section';
|
|
58
|
+
export type { FormSectionProps } from './form-section';
|
|
59
|
+
export { BulkActionBar } from './bulk-action-bar';
|
|
60
|
+
export type { BulkActionBarProps, BulkActionBarAction } from './bulk-action-bar';
|
|
61
|
+
export { DeadlineIndicator } from './deadline-indicator';
|
|
62
|
+
export type { DeadlineIndicatorProps } from './deadline-indicator';
|
|
63
|
+
export { MasterDetail } from './master-detail';
|
|
64
|
+
export type { MasterDetailProps } from './master-detail';
|
|
65
|
+
export { ResponsiveOverlay } from './responsive-overlay';
|
|
66
|
+
export type { ResponsiveOverlayProps } from './responsive-overlay';
|
|
67
|
+
export { MarkdownViewer } from './markdown-viewer';
|
|
68
|
+
export type { MarkdownViewerProps } from './markdown-viewer';
|
|
69
|
+
export { EmojiPicker, EmojiPickerPopover } from './emoji-picker';
|
|
70
|
+
export type { EmojiPickerProps, EmojiPickerPopoverProps, EmojiData } from './emoji-picker';
|
|
71
|
+
export { FilePreview } from './file-preview';
|
|
72
|
+
export type { FilePreviewProps } from './file-preview';
|
|
51
73
|
export { getInitials } from './lib/string-utils';
|
|
52
74
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composed/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAEhE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAA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AAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAChE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/composed/index.js
CHANGED
|
@@ -1,58 +1,83 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { PageHeader as o } from "./page-header.js";
|
|
3
3
|
import { ContentCard as a, contentCardVariants as i } from "./content-card.js";
|
|
4
|
-
import { StatusBadge as p, statusBadgeVariants as
|
|
5
|
-
import { EmptyState as
|
|
6
|
-
import { AvatarGroup as
|
|
7
|
-
import { PriorityIndicator as
|
|
4
|
+
import { StatusBadge as p, statusBadgeVariants as l } from "./status-badge.js";
|
|
5
|
+
import { EmptyState as f } from "./empty-state.js";
|
|
6
|
+
import { AvatarGroup as s } from "./avatar-group.js";
|
|
7
|
+
import { PriorityIndicator as d } from "./priority-indicator.js";
|
|
8
8
|
import { RichTextEditor as P, RichTextViewer as S } from "./rich-text-editor.js";
|
|
9
|
-
import { C as
|
|
10
|
-
import { BoardSkeleton as
|
|
11
|
-
import { DashboardSkeleton as
|
|
12
|
-
import { ErrorDisplay as
|
|
9
|
+
import { C as D, D as C, a as T, b as g, M as v, P as B, T as M, Y as y, u as E } from "../_chunks/use-calendar.js";
|
|
10
|
+
import { BoardSkeleton as b, CardSkeleton as h, ListSkeleton as w, TableSkeleton as I } from "./loading-skeleton.js";
|
|
11
|
+
import { DashboardSkeleton as R, ProjectListSkeleton as j, TaskDetailSkeleton as A } from "./page-skeletons.js";
|
|
12
|
+
import { ErrorDisplay as L } from "./error-boundary.js";
|
|
13
13
|
import { GlobalLoading as H } from "./global-loading.js";
|
|
14
|
-
import { CommandPalette as
|
|
15
|
-
import { MemberPicker as
|
|
16
|
-
import { SimpleTooltip as
|
|
14
|
+
import { CommandPalette as q } from "./command-palette.js";
|
|
15
|
+
import { MemberPicker as J } from "./member-picker.js";
|
|
16
|
+
import { SimpleTooltip as N } from "./simple-tooltip.js";
|
|
17
17
|
import { ScheduleView as U } from "./schedule-view.js";
|
|
18
18
|
import { ConfirmDialog as X } from "./confirm-dialog.js";
|
|
19
19
|
import { ActivityFeed as _, groupItemsByTime as $ } from "./activity-feed.js";
|
|
20
|
-
import {
|
|
20
|
+
import { MultiSelectPopover as re } from "./multi-select-popover.js";
|
|
21
|
+
import { FilterBar as te, FilterMultiSelect as ae, FilterSelect as ie } from "./filter-bar.js";
|
|
22
|
+
import { InlineEdit as pe } from "./inline-edit.js";
|
|
23
|
+
import { FormSection as xe } from "./form-section.js";
|
|
24
|
+
import { BulkActionBar as ne } from "./bulk-action-bar.js";
|
|
25
|
+
import { DeadlineIndicator as ce } from "./deadline-indicator.js";
|
|
26
|
+
import { MasterDetail as ke } from "./master-detail.js";
|
|
27
|
+
import { ResponsiveOverlay as Se } from "./responsive-overlay.js";
|
|
28
|
+
import { MarkdownViewer as De } from "./markdown-viewer.js";
|
|
29
|
+
import { EmojiPicker as Te, EmojiPickerPopover as ge } from "./emoji-picker.js";
|
|
30
|
+
import { FilePreview as Be } from "./file-preview.js";
|
|
31
|
+
import { getInitials as ye } from "./lib/string-utils.js";
|
|
21
32
|
export {
|
|
22
33
|
_ as ActivityFeed,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
s as AvatarGroup,
|
|
35
|
+
b as BoardSkeleton,
|
|
36
|
+
ne as BulkActionBar,
|
|
37
|
+
D as CalendarGrid,
|
|
38
|
+
h as CardSkeleton,
|
|
39
|
+
q as CommandPalette,
|
|
28
40
|
X as ConfirmDialog,
|
|
29
41
|
a as ContentCard,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
R as DashboardSkeleton,
|
|
43
|
+
C as DatePicker,
|
|
44
|
+
T as DateRangePicker,
|
|
45
|
+
g as DateTimePicker,
|
|
46
|
+
ce as DeadlineIndicator,
|
|
47
|
+
Te as EmojiPicker,
|
|
48
|
+
ge as EmojiPickerPopover,
|
|
49
|
+
f as EmptyState,
|
|
50
|
+
L as ErrorDisplay,
|
|
51
|
+
Be as FilePreview,
|
|
52
|
+
te as FilterBar,
|
|
53
|
+
ae as FilterMultiSelect,
|
|
54
|
+
ie as FilterSelect,
|
|
55
|
+
xe as FormSection,
|
|
36
56
|
H as GlobalLoading,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
57
|
+
pe as InlineEdit,
|
|
58
|
+
w as ListSkeleton,
|
|
59
|
+
De as MarkdownViewer,
|
|
60
|
+
ke as MasterDetail,
|
|
61
|
+
J as MemberPicker,
|
|
62
|
+
v as MonthPicker,
|
|
63
|
+
re as MultiSelectPopover,
|
|
40
64
|
o as PageHeader,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
65
|
+
B as Presets,
|
|
66
|
+
d as PriorityIndicator,
|
|
67
|
+
j as ProjectListSkeleton,
|
|
68
|
+
Se as ResponsiveOverlay,
|
|
44
69
|
P as RichTextEditor,
|
|
45
70
|
S as RichTextViewer,
|
|
46
71
|
U as ScheduleView,
|
|
47
|
-
|
|
72
|
+
N as SimpleTooltip,
|
|
48
73
|
p as StatusBadge,
|
|
49
|
-
|
|
74
|
+
I as TableSkeleton,
|
|
50
75
|
A as TaskDetailSkeleton,
|
|
51
|
-
|
|
52
|
-
|
|
76
|
+
M as TimePicker,
|
|
77
|
+
y as YearPicker,
|
|
53
78
|
i as contentCardVariants,
|
|
54
|
-
|
|
79
|
+
ye as getInitials,
|
|
55
80
|
$ as groupItemsByTime,
|
|
56
|
-
|
|
57
|
-
|
|
81
|
+
l as statusBadgeVariants,
|
|
82
|
+
E as useCalendar
|
|
58
83
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSave'> {
|
|
4
|
+
value: string;
|
|
5
|
+
onSave: (newValue: string) => void | Promise<void>;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
/** CSS class applied to the editable text (e.g. 'text-ds-lg font-semibold') */
|
|
8
|
+
textClassName?: string;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
maxLength?: number;
|
|
11
|
+
/** External saving state — shows spinner */
|
|
12
|
+
saving?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function InlineEdit({ value, onSave, placeholder, textClassName, readOnly, maxLength, saving: savingProp, className, ...props }: InlineEditProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { InlineEdit };
|
|
16
|
+
//# sourceMappingURL=inline-edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-edit.d.ts","sourceRoot":"","sources":["../../src/composed/inline-edit.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC3F,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAUD,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,MAAM,EACN,WAA6B,EAC7B,aAAa,EACb,QAAgB,EAChB,SAAS,EACT,MAAM,EAAE,UAAkB,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,2CAsIjB;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as F, jsx as d } from "react/jsx-runtime";
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import { IconPencil as P } from "@tabler/icons-react";
|
|
5
|
+
import { cn as h } from "../ui/lib/utils.js";
|
|
6
|
+
import { Spinner as A } from "../ui/spinner.js";
|
|
7
|
+
function B({
|
|
8
|
+
value: o,
|
|
9
|
+
onSave: C,
|
|
10
|
+
placeholder: l = "Click to edit",
|
|
11
|
+
textClassName: R,
|
|
12
|
+
readOnly: c = !1,
|
|
13
|
+
maxLength: i,
|
|
14
|
+
saving: b = !1,
|
|
15
|
+
className: w,
|
|
16
|
+
...v
|
|
17
|
+
}) {
|
|
18
|
+
const [D, m] = a.useState(!1), [s, f] = a.useState(!1), t = a.useRef(null), p = a.useRef(o), u = b || D, E = !o;
|
|
19
|
+
a.useEffect(() => {
|
|
20
|
+
!s && t.current && (t.current.textContent = o);
|
|
21
|
+
}, [o, s]);
|
|
22
|
+
function S() {
|
|
23
|
+
c || u || (f(!0), p.current = o, requestAnimationFrame(() => {
|
|
24
|
+
if (!t.current) return;
|
|
25
|
+
const n = document.createRange();
|
|
26
|
+
n.selectNodeContents(t.current);
|
|
27
|
+
const e = window.getSelection();
|
|
28
|
+
e == null || e.removeAllRanges(), e == null || e.addRange(n);
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
async function g() {
|
|
32
|
+
if (!t.current) return;
|
|
33
|
+
f(!1);
|
|
34
|
+
const e = (t.current.textContent ?? "").trim(), r = i ? e.slice(0, i) : e;
|
|
35
|
+
if (t.current.textContent = r || o, r === o) return;
|
|
36
|
+
const x = C(r);
|
|
37
|
+
if (x instanceof Promise) {
|
|
38
|
+
m(!0);
|
|
39
|
+
try {
|
|
40
|
+
await x;
|
|
41
|
+
} catch {
|
|
42
|
+
t.current && (t.current.textContent = o);
|
|
43
|
+
} finally {
|
|
44
|
+
m(!1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function k() {
|
|
49
|
+
t.current && (t.current.textContent = p.current, f(!1), t.current.blur());
|
|
50
|
+
}
|
|
51
|
+
function y(n) {
|
|
52
|
+
n.key === "Escape" ? (n.preventDefault(), k()) : n.key === "Enter" && (n.preventDefault(), g());
|
|
53
|
+
}
|
|
54
|
+
function I() {
|
|
55
|
+
if (!t.current || !i) return;
|
|
56
|
+
const n = t.current.textContent ?? "";
|
|
57
|
+
if (n.length > i) {
|
|
58
|
+
t.current.textContent = n.slice(0, i);
|
|
59
|
+
const e = document.createRange();
|
|
60
|
+
e.selectNodeContents(t.current), e.collapse(!1);
|
|
61
|
+
const r = window.getSelection();
|
|
62
|
+
r == null || r.removeAllRanges(), r == null || r.addRange(e);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function N(n) {
|
|
66
|
+
n.preventDefault();
|
|
67
|
+
const e = n.clipboardData.getData("text/plain");
|
|
68
|
+
document.execCommand("insertText", !1, e);
|
|
69
|
+
}
|
|
70
|
+
return /* @__PURE__ */ F("div", { className: h("group inline-flex items-center gap-ds-02", w), ...v, children: [
|
|
71
|
+
/* @__PURE__ */ d(
|
|
72
|
+
"span",
|
|
73
|
+
{
|
|
74
|
+
ref: t,
|
|
75
|
+
role: c ? void 0 : "textbox",
|
|
76
|
+
contentEditable: !c && !u,
|
|
77
|
+
suppressContentEditableWarning: !0,
|
|
78
|
+
tabIndex: c ? void 0 : 0,
|
|
79
|
+
onFocus: S,
|
|
80
|
+
onBlur: g,
|
|
81
|
+
onKeyDown: y,
|
|
82
|
+
onInput: I,
|
|
83
|
+
onPaste: N,
|
|
84
|
+
spellCheck: s,
|
|
85
|
+
className: h(
|
|
86
|
+
"font-sans text-surface-fg outline-none",
|
|
87
|
+
R,
|
|
88
|
+
// Idle: subtle hover hint
|
|
89
|
+
!c && !s && "cursor-text rounded-ds-sm -mx-ds-01 px-ds-01 hover:bg-surface-raised-hover transition-colors duration-fast-01",
|
|
90
|
+
// Focused: subtle underline to indicate editing
|
|
91
|
+
s && "rounded-ds-sm -mx-ds-01 px-ds-01 bg-surface-raised-hover ring-1 ring-accent-7",
|
|
92
|
+
// Empty: show placeholder styling
|
|
93
|
+
E && !s && "text-surface-fg-subtle italic",
|
|
94
|
+
// Read-only
|
|
95
|
+
c && "cursor-default"
|
|
96
|
+
),
|
|
97
|
+
"data-placeholder": l,
|
|
98
|
+
children: o || (s ? "" : l)
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
!c && !s && !u && /* @__PURE__ */ d(P, { className: "h-3 w-3 text-surface-fg-subtle opacity-0 group-hover:opacity-100 transition-opacity duration-fast-01 shrink-0", "aria-hidden": "true" }),
|
|
102
|
+
u && /* @__PURE__ */ d(A, { size: "sm" })
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
B as InlineEdit
|
|
107
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface MarkdownViewerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
content: string;
|
|
5
|
+
/** Tighter spacing for inline use */
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
/** Allow raw HTML in markdown @default false */
|
|
8
|
+
allowHtml?: boolean;
|
|
9
|
+
/** Link target @default '_blank' */
|
|
10
|
+
linkTarget?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function MarkdownViewer({ content, compact, allowHtml, linkTarget, className, ...props }: MarkdownViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { MarkdownViewer };
|
|
14
|
+
//# sourceMappingURL=markdown-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-viewer.d.ts","sourceRoot":"","sources":["../../src/composed/markdown-viewer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiC9B,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/E,OAAO,EAAE,MAAM,CAAA;IACf,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAiFD,iBAAS,cAAc,CAAC,EACtB,OAAO,EACP,OAAe,EACf,SAAiB,EACjB,UAAqB,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAoHrB;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
|