@devalok/shilp-sutra 0.6.2 → 0.8.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 (108) hide show
  1. package/dist/_virtual/client.js +5 -0
  2. package/dist/_virtual/index.js +5 -0
  3. package/dist/_virtual/react-dom-client.development.js +5 -0
  4. package/dist/_virtual/react-dom-client.production.js +5 -0
  5. package/dist/_virtual/scheduler.development.js +5 -0
  6. package/dist/_virtual/scheduler.production.js +5 -0
  7. package/dist/composed/command-palette.d.ts.map +1 -1
  8. package/dist/composed/command-palette.js +84 -73
  9. package/dist/composed/confirm-dialog.d.ts +27 -0
  10. package/dist/composed/confirm-dialog.d.ts.map +1 -0
  11. package/dist/composed/confirm-dialog.js +45 -0
  12. package/dist/composed/extensions/emoji-suggestion.d.ts +9 -0
  13. package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -0
  14. package/dist/composed/extensions/emoji-suggestion.js +119 -0
  15. package/dist/composed/extensions/file-attachment.d.ts +4 -0
  16. package/dist/composed/extensions/file-attachment.d.ts.map +1 -0
  17. package/dist/composed/extensions/file-attachment.js +55 -0
  18. package/dist/composed/extensions/mention-suggestion.d.ts +10 -0
  19. package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -0
  20. package/dist/composed/extensions/mention-suggestion.js +79 -0
  21. package/dist/composed/index.d.ts +3 -1
  22. package/dist/composed/index.d.ts.map +1 -1
  23. package/dist/composed/index.js +28 -26
  24. package/dist/composed/rich-text-editor.d.ts +19 -0
  25. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  26. package/dist/composed/rich-text-editor.js +347 -176
  27. package/dist/composed/status-badge.d.ts +11 -1
  28. package/dist/composed/status-badge.d.ts.map +1 -1
  29. package/dist/composed/status-badge.js +48 -20
  30. package/dist/hooks/use-color-mode.d.ts.map +1 -1
  31. package/dist/hooks/use-color-mode.js +8 -4
  32. package/dist/hooks/use-mobile.d.ts +5 -0
  33. package/dist/hooks/use-mobile.d.ts.map +1 -1
  34. package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +40141 -0
  35. package/dist/node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js +17 -0
  36. package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +2958 -0
  37. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +17062 -0
  38. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +9790 -0
  39. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +20 -0
  40. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +237 -0
  41. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +234 -0
  42. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +11 -0
  43. package/dist/primitives/_internal/react-arrow.js +8 -19
  44. package/dist/primitives/_internal/react-compose-refs.js +14 -14
  45. package/dist/primitives/_internal/react-context.js +41 -39
  46. package/dist/primitives/_internal/react-dismissable-layer.js +62 -90
  47. package/dist/primitives/_internal/react-popper.js +107 -169
  48. package/dist/primitives/_internal/react-portal.js +1 -1
  49. package/dist/primitives/_internal/react-primitive.js +1 -1
  50. package/dist/primitives/_internal/react-use-size.js +8 -8
  51. package/dist/primitives/react-slot.js +12 -12
  52. package/dist/shell/app-command-palette.d.ts +3 -1
  53. package/dist/shell/app-command-palette.d.ts.map +1 -1
  54. package/dist/shell/app-command-palette.js +35 -34
  55. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  56. package/dist/shell/bottom-navbar.js +31 -31
  57. package/dist/shell/index.d.ts +1 -1
  58. package/dist/shell/index.d.ts.map +1 -1
  59. package/dist/shell/notification-center.d.ts +10 -0
  60. package/dist/shell/notification-center.d.ts.map +1 -1
  61. package/dist/shell/notification-center.js +129 -117
  62. package/dist/shell/top-bar.d.ts +20 -0
  63. package/dist/shell/top-bar.d.ts.map +1 -1
  64. package/dist/shell/top-bar.js +100 -70
  65. package/dist/tailwind/index.cjs +3 -0
  66. package/dist/tailwind/preset.d.ts.map +1 -1
  67. package/dist/tailwind/preset.js +3 -0
  68. package/dist/tokens/semantic.css +10 -1
  69. package/dist/ui/alert.js +42 -63
  70. package/dist/ui/avatar.js +20 -62
  71. package/dist/ui/badge.d.ts +1 -1
  72. package/dist/ui/badge.d.ts.map +1 -1
  73. package/dist/ui/badge.js +89 -112
  74. package/dist/ui/banner.js +12 -12
  75. package/dist/ui/button-group.js +14 -29
  76. package/dist/ui/button.js +64 -108
  77. package/dist/ui/card.js +18 -62
  78. package/dist/ui/checkbox.js +1 -21
  79. package/dist/ui/chip.d.ts.map +1 -1
  80. package/dist/ui/chip.js +1 -1
  81. package/dist/ui/color-input.d.ts +17 -0
  82. package/dist/ui/color-input.d.ts.map +1 -0
  83. package/dist/ui/color-input.js +88 -0
  84. package/dist/ui/combobox.d.ts +20 -11
  85. package/dist/ui/combobox.d.ts.map +1 -1
  86. package/dist/ui/dialog.js +9 -9
  87. package/dist/ui/form.js +14 -35
  88. package/dist/ui/index.d.ts +1 -0
  89. package/dist/ui/index.d.ts.map +1 -1
  90. package/dist/ui/index.js +314 -312
  91. package/dist/ui/input.d.ts.map +1 -1
  92. package/dist/ui/input.js +31 -56
  93. package/dist/ui/label.js +1 -15
  94. package/dist/ui/number-input.d.ts.map +1 -1
  95. package/dist/ui/number-input.js +39 -35
  96. package/dist/ui/popover.js +6 -6
  97. package/dist/ui/separator.js +4 -19
  98. package/dist/ui/sheet.js +21 -21
  99. package/dist/ui/spinner.js +1 -36
  100. package/dist/ui/switch.js +1 -20
  101. package/dist/ui/tabs.js +20 -47
  102. package/dist/ui/textarea.d.ts.map +1 -1
  103. package/dist/ui/textarea.js +30 -24
  104. package/dist/ui/toast.js +18 -18
  105. package/dist/ui/tooltip.js +6 -17
  106. package/llms-full.txt +123 -13
  107. package/llms.txt +9 -6
  108. package/package.json +80 -11
@@ -1,225 +1,396 @@
1
1
  "use client";
2
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
3
- import * as n from "react";
4
- import { useEditor as x, EditorContent as h } from "@tiptap/react";
5
- import u from "@tiptap/starter-kit";
6
- import f from "@tiptap/extension-placeholder";
7
- import { cn as d } from "../ui/lib/utils.js";
8
- import { IconBold as _, IconItalic as g, IconStrikethrough as v, IconH2 as y, IconH3 as k, IconList as w, IconListNumbers as N, IconCode as A, IconArrowBackUp as I, IconArrowForwardUp as C } from "@tabler/icons-react";
9
- function s({
2
+ import { jsxs as b, jsx as e } from "react/jsx-runtime";
3
+ import * as c from "react";
4
+ import { useEditor as S, EditorContent as H } from "@tiptap/react";
5
+ import B from "@tiptap/starter-kit";
6
+ import G from "@tiptap/extension-placeholder";
7
+ import P from "@tiptap/extension-underline";
8
+ import M from "@tiptap/extension-highlight";
9
+ import j from "@tiptap/extension-task-list";
10
+ import D from "@tiptap/extension-task-item";
11
+ import z from "@tiptap/extension-text-align";
12
+ import q from "@tiptap/extension-link";
13
+ import U from "@tiptap/extension-image";
14
+ import O from "@tiptap/extension-mention";
15
+ import { FileAttachment as K } from "./extensions/file-attachment.js";
16
+ import { createSuggestionRenderer as J } from "./extensions/mention-suggestion.js";
17
+ import { EmojiSuggestion as Q } from "./extensions/emoji-suggestion.js";
18
+ import { useColorMode as X } from "../hooks/use-color-mode.js";
19
+ import { cn as k } from "../ui/lib/utils.js";
20
+ import { IconBold as Y, IconItalic as Z, IconUnderline as $, IconStrikethrough as F, IconHighlight as ee, IconH2 as te, IconH3 as ie, IconBlockquote as se, IconList as re, IconListNumbers as oe, IconListCheck as ne, IconCode as ce, IconPhoto as le, IconPaperclip as ae, IconLineDashed as de, IconAlignLeft as ue, IconAlignCenter as me, IconAlignRight as fe, IconMoodSmile as he, IconArrowBackUp as ge, IconArrowForwardUp as pe, IconLink as ke } from "@tabler/icons-react";
21
+ const V = [
22
+ "prose prose-sm max-w-none",
23
+ "font-body text-ds-md leading-relaxed text-text-primary",
24
+ "[&_h2]:text-ds-xl [&_h2]:mb-ds-03 [&_h2]:mt-ds-05 [&_h2]:text-text-primary",
25
+ "[&_h3]:text-ds-base [&_h3]:font-semibold [&_h3]:mb-ds-02b [&_h3]:mt-ds-04 [&_h3]:text-text-primary",
26
+ "[&_p]:mb-ds-02b [&_p]:text-text-secondary",
27
+ "[&_ul]:ml-ds-05 [&_ul]:list-disc [&_ol]:ml-ds-05 [&_ol]:list-decimal",
28
+ "[&_li]:text-text-secondary",
29
+ "[&_code]:rounded [&_code]:bg-layer-02 [&_code]:px-ds-02b [&_code]:py-ds-01 [&_code]:text-ds-md [&_code]:text-interactive",
30
+ "[&_pre]:rounded-ds-lg [&_pre]:bg-layer-02 [&_pre]:p-ds-04",
31
+ "[&_strong]:font-semibold [&_strong]:text-text-primary",
32
+ "[&_blockquote]:border-l-[3px] [&_blockquote]:border-interactive/30 [&_blockquote]:pl-ds-04 [&_blockquote]:italic [&_blockquote]:text-text-placeholder",
33
+ "[&_mark]:rounded-sm [&_mark]:bg-warning/20 [&_mark]:px-[2px]",
34
+ '[&_ul[data-type="taskList"]]:ml-0 [&_ul[data-type="taskList"]]:list-none [&_li[data-type="taskItem"]]:flex [&_li[data-type="taskItem"]]:items-start [&_li[data-type="taskItem"]]:gap-ds-02',
35
+ "[&_hr]:my-ds-04 [&_hr]:border-border",
36
+ "[&_a]:text-interactive [&_a]:underline [&_a]:decoration-interactive/40 hover:[&_a]:decoration-interactive",
37
+ "[&_img]:max-w-full [&_img]:rounded-ds-md [&_img]:my-ds-03",
38
+ "[&_.mention]:rounded-ds-sm [&_.mention]:bg-interactive/10 [&_.mention]:px-ds-02 [&_.mention]:py-[1px] [&_.mention]:font-medium [&_.mention]:text-interactive"
39
+ ];
40
+ function r({
10
41
  onClick: t,
11
- isActive: o = !1,
12
- disabled: l = !1,
13
- title: i,
14
- children: c
42
+ isActive: n = !1,
43
+ disabled: a = !1,
44
+ title: l,
45
+ children: d
15
46
  }) {
16
47
  return /* @__PURE__ */ e(
17
48
  "button",
18
49
  {
19
50
  type: "button",
20
51
  onClick: t,
21
- disabled: l,
22
- title: i,
23
- className: d(
52
+ disabled: a,
53
+ title: l,
54
+ "aria-pressed": n,
55
+ className: k(
24
56
  "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors",
25
57
  "hover:bg-field",
26
58
  "disabled:pointer-events-none disabled:opacity-[0.38]",
27
- o ? "bg-field text-interactive" : "text-text-placeholder"
59
+ n ? "bg-field text-interactive" : "text-text-placeholder"
28
60
  ),
29
- children: c
61
+ children: d
30
62
  }
31
63
  );
32
64
  }
33
- function R({ editor: t }) {
34
- return /* @__PURE__ */ m("div", { className: "flex flex-wrap items-center gap-ds-01 border-b border-border px-ds-04 py-ds-02b", children: [
35
- /* @__PURE__ */ e(
36
- s,
37
- {
38
- onClick: () => t.chain().focus().toggleBold().run(),
39
- isActive: t.isActive("bold"),
40
- title: "Bold",
41
- children: /* @__PURE__ */ e(_, { className: "h-ico-sm w-ico-sm", stroke: 2.5 })
42
- }
43
- ),
44
- /* @__PURE__ */ e(
45
- s,
46
- {
47
- onClick: () => t.chain().focus().toggleItalic().run(),
48
- isActive: t.isActive("italic"),
49
- title: "Italic",
50
- children: /* @__PURE__ */ e(g, { className: "h-ico-sm w-ico-sm", stroke: 2.5 })
51
- }
52
- ),
53
- /* @__PURE__ */ e(
54
- s,
55
- {
56
- onClick: () => t.chain().focus().toggleStrike().run(),
57
- isActive: t.isActive("strike"),
58
- title: "Strikethrough",
59
- children: /* @__PURE__ */ e(v, { className: "h-ico-sm w-ico-sm", stroke: 2.5 })
60
- }
61
- ),
62
- /* @__PURE__ */ e("div", { className: "mx-ds-02 h-[16px] w-px bg-border" }),
63
- /* @__PURE__ */ e(
64
- s,
65
- {
66
- onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
67
- isActive: t.isActive("heading", { level: 2 }),
68
- title: "Heading 2",
69
- children: /* @__PURE__ */ e(y, { className: "h-ico-sm w-ico-sm", stroke: 2.5 })
70
- }
71
- ),
72
- /* @__PURE__ */ e(
73
- s,
74
- {
75
- onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
76
- isActive: t.isActive("heading", { level: 3 }),
77
- title: "Heading 3",
78
- children: /* @__PURE__ */ e(k, { className: "h-ico-sm w-ico-sm", stroke: 2.5 })
79
- }
80
- ),
81
- /* @__PURE__ */ e("div", { className: "mx-ds-02 h-[16px] w-px bg-border" }),
82
- /* @__PURE__ */ e(
83
- s,
84
- {
85
- onClick: () => t.chain().focus().toggleBulletList().run(),
86
- isActive: t.isActive("bulletList"),
87
- title: "Bullet list",
88
- children: /* @__PURE__ */ e(w, { className: "h-ico-sm w-ico-sm", stroke: 2.5 })
89
- }
90
- ),
91
- /* @__PURE__ */ e(
92
- s,
93
- {
94
- onClick: () => t.chain().focus().toggleOrderedList().run(),
95
- isActive: t.isActive("orderedList"),
96
- title: "Ordered list",
97
- children: /* @__PURE__ */ e(N, { className: "h-ico-sm w-ico-sm", stroke: 2.5 })
98
- }
99
- ),
100
- /* @__PURE__ */ e(
101
- s,
102
- {
103
- onClick: () => t.chain().focus().toggleCodeBlock().run(),
104
- isActive: t.isActive("codeBlock"),
105
- title: "Code block",
106
- children: /* @__PURE__ */ e(A, { className: "h-ico-sm w-ico-sm", stroke: 2.5 })
107
- }
108
- ),
109
- /* @__PURE__ */ e("div", { className: "mx-ds-02 h-[16px] w-px bg-border" }),
110
- /* @__PURE__ */ e(
111
- s,
112
- {
113
- onClick: () => t.chain().focus().undo().run(),
114
- disabled: !t.can().undo(),
115
- title: "Undo",
116
- children: /* @__PURE__ */ e(I, { className: "h-ico-sm w-ico-sm", stroke: 2 })
117
- }
118
- ),
119
- /* @__PURE__ */ e(
120
- s,
65
+ function be({ editor: t }) {
66
+ const [n, a] = c.useState(!1), [l, d] = c.useState(""), u = c.useRef(null), x = () => {
67
+ if (t.isActive("link")) {
68
+ t.chain().focus().unsetLink().run();
69
+ return;
70
+ }
71
+ const m = t.getAttributes("link").href || "";
72
+ d(m), a(!0), setTimeout(() => {
73
+ var A;
74
+ return (A = u.current) == null ? void 0 : A.focus();
75
+ }, 0);
76
+ }, h = (m) => {
77
+ m.preventDefault(), l.trim() && t.chain().focus().setLink({ href: l.trim() }).run(), a(!1), d("");
78
+ }, g = (m) => {
79
+ m.key === "Escape" && (a(!1), d(""), t.commands.focus());
80
+ };
81
+ return /* @__PURE__ */ b("div", { className: "relative", children: [
82
+ /* @__PURE__ */ e(r, { onClick: x, isActive: t.isActive("link"), title: "Link", children: /* @__PURE__ */ e(ke, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
83
+ n && /* @__PURE__ */ b(
84
+ "form",
121
85
  {
122
- onClick: () => t.chain().focus().redo().run(),
123
- disabled: !t.can().redo(),
124
- title: "Redo",
125
- children: /* @__PURE__ */ e(C, { className: "h-ico-sm w-ico-sm", stroke: 2 })
86
+ onSubmit: h,
87
+ "aria-label": "Edit link URL",
88
+ className: "absolute left-0 top-full z-popover mt-ds-01 flex items-center gap-ds-02 rounded-ds-md border border-border bg-layer-01 p-ds-02 shadow-02",
89
+ children: [
90
+ /* @__PURE__ */ e(
91
+ "input",
92
+ {
93
+ ref: u,
94
+ type: "url",
95
+ value: l,
96
+ onChange: (m) => d(m.target.value),
97
+ onKeyDown: g,
98
+ placeholder: "https://...",
99
+ className: "h-ds-sm w-[240px] rounded-ds-sm border border-border bg-layer-01 px-ds-03 text-ds-sm text-text-primary focus:border-interactive focus:outline-none"
100
+ }
101
+ ),
102
+ /* @__PURE__ */ e("button", { type: "submit", className: "h-ds-sm rounded-ds-sm bg-interactive px-ds-03 text-ds-sm text-text-on-color hover:bg-interactive/90", children: "Apply" })
103
+ ]
126
104
  }
127
105
  )
128
106
  ] });
129
107
  }
130
- const T = n.forwardRef(
108
+ function p() {
109
+ return /* @__PURE__ */ e("div", { className: "mx-ds-02 h-[16px] w-px bg-border" });
110
+ }
111
+ function xe({ editor: t, onImageClick: n, onFileClick: a, onEmojiClick: l }) {
112
+ return /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center gap-ds-01 border-b border-border px-ds-04 py-ds-02b", children: [
113
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleBold().run(), isActive: t.isActive("bold"), title: "Bold", children: /* @__PURE__ */ e(Y, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
114
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleItalic().run(), isActive: t.isActive("italic"), title: "Italic", children: /* @__PURE__ */ e(Z, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
115
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleUnderline().run(), isActive: t.isActive("underline"), title: "Underline", children: /* @__PURE__ */ e($, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
116
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleStrike().run(), isActive: t.isActive("strike"), title: "Strikethrough", children: /* @__PURE__ */ e(F, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
117
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleHighlight().run(), isActive: t.isActive("highlight"), title: "Highlight", children: /* @__PURE__ */ e(ee, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
118
+ /* @__PURE__ */ e(p, {}),
119
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(), isActive: t.isActive("heading", { level: 2 }), title: "Heading 2", children: /* @__PURE__ */ e(te, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
120
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(), isActive: t.isActive("heading", { level: 3 }), title: "Heading 3", children: /* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
121
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleBlockquote().run(), isActive: t.isActive("blockquote"), title: "Blockquote", children: /* @__PURE__ */ e(se, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
122
+ /* @__PURE__ */ e(p, {}),
123
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleBulletList().run(), isActive: t.isActive("bulletList"), title: "Bullet list", children: /* @__PURE__ */ e(re, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
124
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleOrderedList().run(), isActive: t.isActive("orderedList"), title: "Ordered list", children: /* @__PURE__ */ e(oe, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
125
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleTaskList().run(), isActive: t.isActive("taskList"), title: "Task list", children: /* @__PURE__ */ e(ne, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
126
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleCodeBlock().run(), isActive: t.isActive("codeBlock"), title: "Code block", children: /* @__PURE__ */ e(ce, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
127
+ /* @__PURE__ */ e(p, {}),
128
+ /* @__PURE__ */ e(be, { editor: t }),
129
+ n && /* @__PURE__ */ e(r, { onClick: n, title: "Insert image", children: /* @__PURE__ */ e(le, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
130
+ a && /* @__PURE__ */ e(r, { onClick: a, title: "Attach file", children: /* @__PURE__ */ e(ae, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
131
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().setHorizontalRule().run(), title: "Horizontal rule", children: /* @__PURE__ */ e(de, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
132
+ /* @__PURE__ */ e(p, {}),
133
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().setTextAlign("left").run(), isActive: t.isActive({ textAlign: "left" }), title: "Align left", children: /* @__PURE__ */ e(ue, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
134
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().setTextAlign("center").run(), isActive: t.isActive({ textAlign: "center" }), title: "Align center", children: /* @__PURE__ */ e(me, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
135
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().setTextAlign("right").run(), isActive: t.isActive({ textAlign: "right" }), title: "Align right", children: /* @__PURE__ */ e(fe, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
136
+ /* @__PURE__ */ e(p, {}),
137
+ l && /* @__PURE__ */ e(r, { onClick: l, title: "Emoji", children: /* @__PURE__ */ e(he, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
138
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().undo().run(), disabled: !t.can().undo(), title: "Undo", children: /* @__PURE__ */ e(ge, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
139
+ /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().redo().run(), disabled: !t.can().redo(), title: "Redo", children: /* @__PURE__ */ e(pe, { className: "h-ico-sm w-ico-sm", stroke: 2 }) })
140
+ ] });
141
+ }
142
+ const ve = c.lazy(() => import("../node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js"));
143
+ function we({ onSelect: t }) {
144
+ const [n, a] = c.useState(null), { colorMode: l } = X();
145
+ c.useEffect(() => {
146
+ import("../node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js").then((u) => a(u.default));
147
+ }, []);
148
+ const d = /* @__PURE__ */ e("div", { className: "flex h-[350px] w-[352px] items-center justify-center rounded-ds-lg border border-border bg-layer-01 shadow-02", children: /* @__PURE__ */ e("span", { className: "text-ds-sm text-text-placeholder", children: "Loading..." }) });
149
+ return n ? /* @__PURE__ */ e(c.Suspense, { fallback: d, children: /* @__PURE__ */ e(
150
+ ve,
151
+ {
152
+ data: n,
153
+ onEmojiSelect: (u) => t(u.native),
154
+ theme: l === "dark" ? "dark" : "light",
155
+ previewPosition: "none",
156
+ skinTonePosition: "none"
157
+ }
158
+ ) }) : d;
159
+ }
160
+ const _e = c.forwardRef(
131
161
  function({
132
- content: o = "",
133
- placeholder: l = "Start writing...",
134
- onChange: i,
135
- className: c,
136
- editable: a = !0
137
- }, p) {
138
- const r = x({
162
+ content: n = "",
163
+ placeholder: a = "Start writing...",
164
+ onChange: l,
165
+ className: d,
166
+ editable: u = !0,
167
+ onImageUpload: x,
168
+ onFileUpload: h,
169
+ mentions: g,
170
+ onMentionSearch: m,
171
+ onMentionSelect: A
172
+ }, W) {
173
+ const y = c.useRef(null), [I, v] = c.useState(!1), N = c.useRef(null), T = c.useRef(null), R = c.useRef(null), C = async (i) => {
174
+ const o = y.current;
175
+ if (o)
176
+ if (x) {
177
+ const s = await x(i);
178
+ s && /^https?:\/\//i.test(s) && o.chain().focus().setImage({ src: s }).run();
179
+ } else {
180
+ const s = new FileReader();
181
+ s.onload = () => {
182
+ o.chain().focus().setImage({ src: s.result }).run();
183
+ }, s.readAsDataURL(i);
184
+ }
185
+ }, L = async (i) => {
186
+ const o = y.current;
187
+ if (!o || !h) return;
188
+ const s = await h(i);
189
+ o.chain().focus().insertContent({
190
+ type: "fileAttachment",
191
+ attrs: { url: s.url, name: s.name, size: s.size }
192
+ }).run();
193
+ }, f = S({
139
194
  extensions: [
140
- u.configure({
195
+ B.configure({
141
196
  heading: { levels: [2, 3] }
142
197
  }),
143
- f.configure({
144
- placeholder: l,
198
+ G.configure({
199
+ placeholder: a,
145
200
  emptyEditorClass: "before:content-[attr(data-placeholder)] before:text-text-placeholder before:float-left before:h-0 before:pointer-events-none"
146
- })
201
+ }),
202
+ P,
203
+ M.configure({ multicolor: !1 }),
204
+ j,
205
+ D.configure({ nested: !0 }),
206
+ z.configure({ types: ["heading", "paragraph"] }),
207
+ q.configure({
208
+ openOnClick: !1,
209
+ protocols: ["http", "https", "mailto"],
210
+ validate: (i) => /^(https?:\/\/|mailto:)/i.test(i),
211
+ HTMLAttributes: {
212
+ rel: "noopener noreferrer",
213
+ target: "_blank"
214
+ }
215
+ }),
216
+ U.configure({
217
+ allowBase64: !0,
218
+ HTMLAttributes: {
219
+ class: "max-w-full rounded-ds-md"
220
+ }
221
+ }),
222
+ K,
223
+ ...g || m ? [
224
+ O.configure({
225
+ HTMLAttributes: { class: "mention" },
226
+ suggestion: {
227
+ items: async ({ query: i }) => m ? await m(i) : g ? g.filter((o) => o.label.toLowerCase().includes(i.toLowerCase())).slice(0, 8) : [],
228
+ render: J()
229
+ }
230
+ })
231
+ ] : [],
232
+ Q
147
233
  ],
148
- content: o,
149
- editable: a,
234
+ content: n,
235
+ editable: u,
150
236
  editorProps: {
237
+ handleDrop: (i, o, s, w) => {
238
+ var E;
239
+ if (w || !((E = o.dataTransfer) != null && E.files.length)) return !1;
240
+ const _ = o.dataTransfer.files[0];
241
+ return _ ? _.type.startsWith("image/") ? (C(_), !0) : h ? (L(_), !0) : !1 : !1;
242
+ },
243
+ handlePaste: (i, o) => {
244
+ var w;
245
+ const s = (w = o.clipboardData) == null ? void 0 : w.files[0];
246
+ return s ? s.type.startsWith("image/") ? (C(s), !0) : h ? (L(s), !0) : !1 : !1;
247
+ },
151
248
  attributes: {
152
- class: d(
153
- "prose prose-sm max-w-none focus:outline-none",
154
- "min-h-[120px] px-ds-04 py-ds-04",
155
- "font-body text-ds-md leading-relaxed text-text-primary",
156
- "[&_h2]:text-ds-xl [&_h2]:mb-ds-03 [&_h2]:mt-ds-05 [&_h2]:text-text-primary",
157
- "[&_h3]:text-ds-base [&_h3]:font-semibold [&_h3]:mb-ds-02b [&_h3]:mt-ds-04 [&_h3]:text-text-primary",
158
- "[&_p]:mb-ds-02b [&_p]:text-text-secondary",
159
- "[&_ul]:ml-ds-05 [&_ul]:list-disc [&_ol]:ml-ds-05 [&_ol]:list-decimal",
160
- "[&_li]:text-text-secondary",
161
- "[&_code]:rounded [&_code]:bg-layer-02 [&_code]:px-ds-02b [&_code]:py-ds-01 [&_code]:text-ds-md [&_code]:text-interactive",
162
- "[&_pre]:rounded-ds-lg [&_pre]:bg-layer-02 [&_pre]:p-ds-04",
163
- "[&_strong]:font-semibold [&_strong]:text-text-primary"
249
+ class: k(
250
+ ...V,
251
+ "focus:outline-none",
252
+ "min-h-[120px] px-ds-04 py-ds-04"
164
253
  )
165
254
  }
166
255
  },
167
- onUpdate: ({ editor: b }) => {
168
- i == null || i(b.getHTML());
256
+ onUpdate: ({ editor: i }) => {
257
+ l == null || l(i.getHTML());
169
258
  }
170
259
  });
171
- return n.useEffect(() => {
172
- r && o !== r.getHTML() && r.commands.setContent(o, !1);
173
- }, [r, o]), r ? /* @__PURE__ */ m(
174
- "div",
175
- {
176
- ref: p,
177
- className: d(
178
- "overflow-hidden rounded-ds-lg border border-border bg-layer-01",
179
- "transition-colors focus-within:border-border-strong",
180
- c
181
- ),
182
- children: [
183
- a && /* @__PURE__ */ e(R, { editor: r }),
184
- /* @__PURE__ */ e(h, { editor: r })
185
- ]
186
- }
187
- ) : null;
260
+ return c.useEffect(() => {
261
+ y.current = f;
262
+ }, [f]), c.useEffect(() => {
263
+ if (!I) return;
264
+ const i = (o) => {
265
+ N.current && !N.current.contains(o.target) && v(!1);
266
+ };
267
+ return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
268
+ }, [I]), c.useEffect(() => {
269
+ f && n !== f.getHTML() && f.commands.setContent(n, !1);
270
+ }, [f, n]), f ? /* @__PURE__ */ b("div", { ref: W, className: k("relative", d), children: [
271
+ I && /* @__PURE__ */ e(
272
+ "div",
273
+ {
274
+ ref: N,
275
+ className: "absolute bottom-full right-0 z-popover mb-ds-02",
276
+ onKeyDown: (i) => {
277
+ i.key === "Escape" && (i.stopPropagation(), v(!1));
278
+ },
279
+ children: /* @__PURE__ */ e(
280
+ we,
281
+ {
282
+ onSelect: (i) => {
283
+ f.chain().focus().insertContent(i).run(), v(!1);
284
+ }
285
+ }
286
+ )
287
+ }
288
+ ),
289
+ /* @__PURE__ */ b(
290
+ "div",
291
+ {
292
+ className: k(
293
+ "overflow-hidden rounded-ds-lg border border-border bg-layer-01",
294
+ "transition-colors focus-within:border-border-strong"
295
+ ),
296
+ children: [
297
+ /* @__PURE__ */ e(
298
+ "input",
299
+ {
300
+ ref: T,
301
+ type: "file",
302
+ accept: "image/*",
303
+ "aria-label": "Upload image",
304
+ className: "hidden",
305
+ onChange: (i) => {
306
+ var s;
307
+ const o = (s = i.target.files) == null ? void 0 : s[0];
308
+ o && C(o), i.target.value = "";
309
+ }
310
+ }
311
+ ),
312
+ h && /* @__PURE__ */ e(
313
+ "input",
314
+ {
315
+ ref: R,
316
+ type: "file",
317
+ "aria-label": "Upload file",
318
+ className: "hidden",
319
+ onChange: (i) => {
320
+ var s;
321
+ const o = (s = i.target.files) == null ? void 0 : s[0];
322
+ o && L(o), i.target.value = "";
323
+ }
324
+ }
325
+ ),
326
+ u && /* @__PURE__ */ e(
327
+ xe,
328
+ {
329
+ editor: f,
330
+ onImageClick: () => {
331
+ var i;
332
+ return (i = T.current) == null ? void 0 : i.click();
333
+ },
334
+ onFileClick: h ? () => {
335
+ var i;
336
+ return (i = R.current) == null ? void 0 : i.click();
337
+ } : void 0,
338
+ onEmojiClick: () => v((i) => !i)
339
+ }
340
+ ),
341
+ /* @__PURE__ */ e(H, { editor: f })
342
+ ]
343
+ }
344
+ )
345
+ ] }) : null;
188
346
  }
189
347
  );
190
- T.displayName = "RichTextEditor";
191
- const B = n.forwardRef(
192
- function({ content: o, className: l }, i) {
193
- const c = x({
348
+ _e.displayName = "RichTextEditor";
349
+ const Ae = c.forwardRef(
350
+ function({ content: n, className: a }, l) {
351
+ const d = S({
194
352
  extensions: [
195
- u.configure({
353
+ B.configure({
196
354
  heading: { levels: [2, 3] }
355
+ }),
356
+ P,
357
+ M.configure({ multicolor: !1 }),
358
+ j,
359
+ D.configure({ nested: !0 }),
360
+ z.configure({ types: ["heading", "paragraph"] }),
361
+ q.configure({
362
+ openOnClick: !0,
363
+ protocols: ["http", "https", "mailto"],
364
+ validate: (u) => /^(https?:\/\/|mailto:)/i.test(u),
365
+ HTMLAttributes: {
366
+ rel: "noopener noreferrer",
367
+ target: "_blank"
368
+ }
369
+ }),
370
+ U.configure({
371
+ allowBase64: !0,
372
+ HTMLAttributes: {
373
+ class: "max-w-full rounded-ds-md"
374
+ }
375
+ }),
376
+ K,
377
+ O.configure({
378
+ HTMLAttributes: { class: "mention" }
197
379
  })
198
380
  ],
199
- content: o,
381
+ content: n,
200
382
  editable: !1,
201
383
  editorProps: {
202
384
  attributes: {
203
- class: d(
204
- "prose prose-sm max-w-none",
205
- "font-body text-ds-md leading-relaxed text-text-primary",
206
- "[&_h2]:text-ds-xl [&_h2]:mb-ds-03 [&_h2]:mt-ds-05 [&_h2]:text-text-primary",
207
- "[&_h3]:text-ds-base [&_h3]:font-semibold [&_h3]:mb-ds-02b [&_h3]:mt-ds-04 [&_h3]:text-text-primary",
208
- "[&_p]:mb-ds-02b [&_p]:text-text-secondary",
209
- "[&_ul]:ml-ds-05 [&_ul]:list-disc [&_ol]:ml-ds-05 [&_ol]:list-decimal",
210
- "[&_li]:text-text-secondary",
211
- "[&_code]:rounded [&_code]:bg-layer-02 [&_code]:px-ds-02b [&_code]:py-ds-01 [&_code]:text-ds-md [&_code]:text-interactive",
212
- "[&_pre]:rounded-ds-lg [&_pre]:bg-layer-02 [&_pre]:p-ds-04",
213
- "[&_strong]:font-semibold [&_strong]:text-text-primary"
214
- )
385
+ class: k(...V)
215
386
  }
216
387
  }
217
388
  });
218
- return c ? /* @__PURE__ */ e("div", { ref: i, className: l, children: /* @__PURE__ */ e(h, { editor: c }) }) : null;
389
+ return d ? /* @__PURE__ */ e("div", { ref: l, className: a, children: /* @__PURE__ */ e(H, { editor: d }) }) : null;
219
390
  }
220
391
  );
221
- B.displayName = "RichTextViewer";
392
+ Ae.displayName = "RichTextViewer";
222
393
  export {
223
- T as RichTextEditor,
224
- B as RichTextViewer
394
+ _e as RichTextEditor,
395
+ Ae as RichTextViewer
225
396
  };
@@ -5,10 +5,20 @@ declare const statusBadgeVariants: (props?: ({
5
5
  color?: "error" | "warning" | "success" | "neutral" | "info" | null | undefined;
6
6
  size?: "sm" | "md" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
- export interface StatusBadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children' | 'color'>, VariantProps<typeof statusBadgeVariants> {
8
+ interface StatusBadgeBaseProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children' | 'color'> {
9
9
  label?: string;
10
10
  hideDot?: boolean;
11
+ size?: VariantProps<typeof statusBadgeVariants>['size'];
11
12
  }
13
+ interface StatusBadgeWithStatus extends StatusBadgeBaseProps {
14
+ status?: VariantProps<typeof statusBadgeVariants>['status'];
15
+ color?: never;
16
+ }
17
+ interface StatusBadgeWithColor extends StatusBadgeBaseProps {
18
+ status?: never;
19
+ color: 'success' | 'warning' | 'error' | 'info' | 'neutral';
20
+ }
21
+ export type StatusBadgeProps = StatusBadgeWithStatus | StatusBadgeWithColor;
12
22
  declare const StatusBadge: React.ForwardRefExoticComponent<StatusBadgeProps & React.RefAttributes<HTMLSpanElement>>;
13
23
  export { StatusBadge, statusBadgeVariants };
14
24
  //# sourceMappingURL=status-badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"status-badge.d.ts","sourceRoot":"","sources":["../../src/composed/status-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,mBAAmB;;;;8EA8BxB,CAAA;AAqBD,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,EACvE,YAAY,CAAC,OAAO,mBAAmB,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,WAAW,0FAwChB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"status-badge.d.ts","sourceRoot":"","sources":["../../src/composed/status-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,mBAAmB;;;;8EA8BxB,CAAA;AAqBD,UAAU,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IACtG,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;CACxD;AAED,UAAU,qBAAsB,SAAQ,oBAAoB;IAC1D,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC,QAAQ,CAAC,CAAA;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,UAAU,oBAAqB,SAAQ,oBAAoB;IACzD,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;CAC5D;AAED,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,oBAAoB,CAAA;AAE3E,QAAA,MAAM,WAAW,0FA2DhB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAA"}