@burdenoff/fe-libs 2026.527.2 → 2026.527.4

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 (161) hide show
  1. package/dist/button/Button.js +18 -16
  2. package/dist/chrome/AccountSwitcher.js +10 -7
  3. package/dist/chrome/AutoBreadcrumbs.js +2 -0
  4. package/dist/chrome/Breadcrumbs.js +2 -0
  5. package/dist/chrome/CommandPalette.js +5 -3
  6. package/dist/chrome/ContextSwitcher.js +90 -338
  7. package/dist/chrome/DynamicFooter.js +7 -7
  8. package/dist/chrome/Footer.js +5 -5
  9. package/dist/chrome/GeographySwitcher.js +3 -3
  10. package/dist/chrome/GlobalSearch.js +73 -448
  11. package/dist/chrome/HeaderBar.js +6 -1
  12. package/dist/chrome/LanguagePickerSheet.js +1 -1
  13. package/dist/chrome/LanguageSwitcher.js +2 -2
  14. package/dist/chrome/NotificationCenter.js +69 -694
  15. package/dist/chrome/PanelTabs.js +7 -4
  16. package/dist/chrome/PluginContextMenuTarget.js +1 -1
  17. package/dist/chrome/ProductPickerSheet.js +4 -4
  18. package/dist/chrome/ProductSideNav.js +1 -1
  19. package/dist/chrome/ProductSwitcher.js +3 -3
  20. package/dist/chrome/ProfileSwitcher.js +13 -8
  21. package/dist/chrome/ShortcutHelpDialog.js +2 -1
  22. package/dist/chrome/SideNavigation.js +75 -239
  23. package/dist/chrome/Sidebar.js +1 -0
  24. package/dist/chrome/contextSwitcher/EmptyState.js +32 -0
  25. package/dist/chrome/contextSwitcher/OrganizationList.js +34 -0
  26. package/dist/chrome/contextSwitcher/ProjectList.js +34 -0
  27. package/dist/chrome/contextSwitcher/SearchInput.js +50 -0
  28. package/dist/chrome/contextSwitcher/TabButton.js +9 -0
  29. package/dist/chrome/contextSwitcher/TriggerButton.js +38 -0
  30. package/dist/chrome/contextSwitcher/WorkspaceList.js +34 -0
  31. package/dist/chrome/contextSwitcher/icons.js +58 -0
  32. package/dist/chrome/contextSwitcher/useIsMobile.js +11 -0
  33. package/dist/chrome/globalSearch/AdvancedFiltersPanel.js +253 -0
  34. package/dist/chrome/globalSearch/CategoryTabs.js +28 -0
  35. package/dist/chrome/globalSearch/ResultsList.js +58 -0
  36. package/dist/chrome/globalSearch/SearchInput.js +28 -0
  37. package/dist/chrome/globalSearch/SearchModeBar.js +36 -0
  38. package/dist/chrome/globalSearch/useAdvancedFilters.js +78 -0
  39. package/dist/chrome/globalSearch/utils.js +22 -0
  40. package/dist/chrome/notificationCenter/BellButton.js +27 -0
  41. package/dist/chrome/notificationCenter/NotificationCardItem.js +129 -0
  42. package/dist/chrome/notificationCenter/NotificationFilters.js +67 -0
  43. package/dist/chrome/notificationCenter/NotificationFooter.js +23 -0
  44. package/dist/chrome/notificationCenter/NotificationHeader.js +75 -0
  45. package/dist/chrome/notificationCenter/NotificationList.js +75 -0
  46. package/dist/chrome/notificationCenter/NotificationPanel.js +19 -0
  47. package/dist/chrome/notificationCenter/SkeletonCard.js +18 -0
  48. package/dist/chrome/notificationCenter/constants.js +93 -0
  49. package/dist/chrome/notificationCenter/gql.js +58 -0
  50. package/dist/chrome/notificationCenter/useNotificationCenter.js +149 -0
  51. package/dist/chrome/notificationCenter/usePanelChrome.js +36 -0
  52. package/dist/chrome/sideNavigation/CollapseToggle.js +29 -0
  53. package/dist/chrome/sideNavigation/MobileActionsBar.js +25 -0
  54. package/dist/chrome/sideNavigation/NavItemRenderer.js +79 -0
  55. package/dist/chrome/sideNavigation/SidebarHeader.js +29 -0
  56. package/dist/chrome/sideNavigation/helpers.js +19 -0
  57. package/dist/chrome/sideNavigation/useSideNavigationState.js +45 -0
  58. package/dist/form/Checkbox.js +17 -15
  59. package/dist/form/FormDescription.js +9 -10
  60. package/dist/form/FormField.js +11 -12
  61. package/dist/form/FormLabel.js +13 -13
  62. package/dist/form/FormMessage.js +10 -11
  63. package/dist/form/Input.js +11 -10
  64. package/dist/form/Radio.js +25 -21
  65. package/dist/form/Select.js +81 -66
  66. package/dist/form/Textarea.js +10 -9
  67. package/dist/shared/components/AccessDenied.js +8 -4
  68. package/dist/shared/components/AppErrorBoundary.js +2 -0
  69. package/dist/shared/components/ContextConversationWidget.js +173 -767
  70. package/dist/shared/components/ErrorFallback.js +3 -0
  71. package/dist/shared/components/PWAInstallBanner.js +8 -4
  72. package/dist/shared/components/RequireAuth.js +4 -4
  73. package/dist/shared/components/SSORedirectGuard.js +1 -1
  74. package/dist/shared/components/contextConversationWidget/Composer.js +66 -0
  75. package/dist/shared/components/contextConversationWidget/MessageItem.js +124 -0
  76. package/dist/shared/components/contextConversationWidget/MessageList.js +32 -0
  77. package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +19 -0
  78. package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +28 -0
  79. package/dist/shared/components/contextConversationWidget/ReplyBanner.js +32 -0
  80. package/dist/shared/components/contextConversationWidget/WidgetHeader.js +70 -0
  81. package/dist/shared/components/contextConversationWidget/queries.js +197 -0
  82. package/dist/shared/components/contextConversationWidget/types.js +10 -0
  83. package/dist/shared/components/contextConversationWidget/useAttachmentUpload.js +57 -0
  84. package/dist/shared/components/contextConversationWidget/useConversationSubscriptions.js +26 -0
  85. package/dist/shared/components/contextConversationWidget/useMessageActions.js +34 -0
  86. package/dist/shared/components/contextConversationWidget/useSendMessage.js +45 -0
  87. package/dist/shared/components/contextConversationWidget/useWidgetMessages.js +44 -0
  88. package/dist/shared/components/contextConversationWidget/utils.js +56 -0
  89. package/dist/shared/feature-flags/FeatureFlagProvider.js +21 -21
  90. package/dist/shared/geography/GeographyProvider.js +20 -20
  91. package/dist/shared/graphql/GatewayContext.js +1 -1
  92. package/dist/shared/motion/MotionList.js +1 -1
  93. package/dist/shared/pages/AiPage.js +3 -3
  94. package/dist/shared/pages/SearchPage.js +293 -1071
  95. package/dist/shared/pages/searchPage/ActiveFilterChips.js +176 -0
  96. package/dist/shared/pages/searchPage/FiltersPanel.js +329 -0
  97. package/dist/shared/pages/searchPage/ResultsList.js +119 -0
  98. package/dist/shared/pages/searchPage/ResultsStatus.js +32 -0
  99. package/dist/shared/pages/searchPage/SearchInput.js +31 -0
  100. package/dist/shared/pages/searchPage/SearchPagination.js +37 -0
  101. package/dist/shared/pages/searchPage/SearchToolbar.js +58 -0
  102. package/dist/shared/pages/searchPage/constants.js +155 -0
  103. package/dist/shared/pages/searchPage/utils.js +24 -0
  104. package/dist/shared/plugins/PluginRuntimeProvider.js +1 -1
  105. package/dist/shared/providers/shell/ActiveContextProvider.js +12 -12
  106. package/dist/shared/providers/shell/AppShellContext.js +1 -1
  107. package/dist/shared/providers/shell/AuthProvider.js +130 -384
  108. package/dist/shared/providers/shell/AuthTokenProvider.js +6 -6
  109. package/dist/shared/providers/shell/ContextManagerProvider.js +1 -1
  110. package/dist/shared/providers/shell/FeatureFlagsProvider.js +5 -5
  111. package/dist/shared/providers/shell/GlobalUiProvider.js +17 -17
  112. package/dist/shared/providers/shell/I18nProvider.js +15 -15
  113. package/dist/shared/providers/shell/PageConversationContextProvider.js +14 -14
  114. package/dist/shared/providers/shell/PermissionProvider.js +16 -16
  115. package/dist/shared/providers/shell/ShellUiProvider.js +13 -13
  116. package/dist/shared/providers/shell/ThemeProvider.js +9 -9
  117. package/dist/shared/providers/shell/authProvider/bridgeStateSync.js +34 -0
  118. package/dist/shared/providers/shell/authProvider/jwt.js +13 -0
  119. package/dist/shared/providers/shell/authProvider/ssoRelay.js +38 -0
  120. package/dist/shared/providers/shell/authProvider/useAuthActions.js +170 -0
  121. package/dist/shared/providers/shell/authProvider/useBridgeInitialization.js +86 -0
  122. package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +32 -0
  123. package/dist/shared/providers/shell/authProvider/useStorageSync.js +35 -0
  124. package/dist/shared/providers/shell/authProvider/useTokenExpiryTimer.js +37 -0
  125. package/dist/shared/tours/TourPlayer.js +1 -0
  126. package/dist/shared/tours/TourPlayerProvider.js +1 -1
  127. package/dist/shared/tours/TourTooltip.js +3 -0
  128. package/dist/shared/tours/TourTrigger.js +86 -259
  129. package/dist/shared/tours/ToursContext.js +108 -398
  130. package/dist/shared/tours/tourTrigger/DesktopTourDropdown.js +48 -0
  131. package/dist/shared/tours/tourTrigger/MobileTourSheet.js +68 -0
  132. package/dist/shared/tours/tourTrigger/TourListItemDesktop.js +36 -0
  133. package/dist/shared/tours/tourTrigger/TourListItemMobile.js +47 -0
  134. package/dist/shared/tours/tourTrigger/TourStatusChip.js +30 -0
  135. package/dist/shared/tours/tourTrigger/TourTriggerButton.js +22 -0
  136. package/dist/shared/tours/toursContext/errors.js +18 -0
  137. package/dist/shared/tours/toursContext/gql.js +152 -0
  138. package/dist/shared/tours/toursContext/route.js +20 -0
  139. package/dist/shared/tours/toursContext/session.js +19 -0
  140. package/dist/shared/tours/toursContext/useIdleReady.js +18 -0
  141. package/dist/shared/tours/toursContext/useTourMutations.js +118 -0
  142. package/dist/shared-events.js +3 -3
  143. package/dist/shared-hooks.js +1 -1
  144. package/dist/storage/SaveToFilesButton.js +3 -3
  145. package/dist/storage/SaveToFilesDialog.js +1 -1
  146. package/dist/tag/TagBadge.js +1 -1
  147. package/dist/tag/TagsWidget.js +81 -226
  148. package/dist/tag/tagsWidget/AddTagTrigger.js +14 -0
  149. package/dist/tag/tagsWidget/TagBadgeList.js +17 -0
  150. package/dist/tag/tagsWidget/TagSearchPopover.js +80 -0
  151. package/dist/tag/tagsWidget/operations.js +64 -0
  152. package/dist/tag/tagsWidget/useVocabResolver.js +30 -0
  153. package/dist/ui/card.js +44 -39
  154. package/dist/ui/dropdown-menu.js +82 -66
  155. package/dist/ui/input.js +10 -10
  156. package/dist/ui/label.js +13 -11
  157. package/dist/ui/select.js +80 -66
  158. package/dist/ui/table.js +61 -54
  159. package/dist/ui/textarea.js +9 -9
  160. package/dist/ui/tooltip.js +13 -11
  161. package/package.json +1 -1
@@ -1,279 +1,134 @@
1
1
  import { useGatewayClient as e } from "../shared/graphql/GatewayContext.js";
2
2
  import { cn as t } from "../shared-utils.js";
3
- import { Command as n, CommandEmpty as r, CommandGroup as i, CommandInput as a, CommandItem as o, CommandList as ee } from "../ui/command.js";
4
- import { Popover as te, PopoverContent as ne, PopoverTrigger as re } from "../ui/popover.js";
5
- import { TagBadge as ie } from "./TagBadge.js";
6
- import { useCallback as s, useEffect as ae, useRef as oe, useState as c } from "react";
7
- import { Loader2 as l, Plus as u, Search as d, Tag as f, X as p } from "lucide-react";
8
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
- import { gql as g } from "@apollo/client";
3
+ import { Popover as n, PopoverContent as r, PopoverTrigger as i } from "../ui/popover.js";
4
+ import { CREATE_TAG as a, NOTIFY_TAG_ASSIGNED as ee, NOTIFY_TAG_REMOVED as o, SEARCH_TAGS as s } from "./tagsWidget/operations.js";
5
+ import { useVocabResolver as c } from "./tagsWidget/useVocabResolver.js";
6
+ import { TagBadgeList as l } from "./tagsWidget/TagBadgeList.js";
7
+ import { AddTagTrigger as te } from "./tagsWidget/AddTagTrigger.js";
8
+ import { TagSearchPopover as u } from "./tagsWidget/TagSearchPopover.js";
9
+ import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
10
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
10
11
  import { useLazyQuery as _, useMutation as v } from "@apollo/client/react";
11
12
  //#region src/tag/TagsWidget.tsx
12
- var se = g`
13
- query TagsWidget_SearchTags($query: String!, $vocabularyId: ID, $limit: Int) {
14
- searchTags(query: $query, vocabularyId: $vocabularyId, limit: $limit) {
15
- id
16
- key
17
- label
18
- value
19
- vocabularyId
20
- parentId
21
- hierarchyPath
22
- color
23
- icon
24
- description
25
- vocabulary {
26
- key
27
- }
28
- }
29
- }
30
- `, ce = g`
31
- query TagsWidget_GetVocabularyByKey($key: String!) {
32
- getVocabularyByKey(key: $key) {
33
- id
34
- key
35
- name
36
- }
37
- }
38
- `, y = g`
39
- mutation TagsWidget_CreateVocabulary($input: CreateVocabularyInput!) {
40
- createVocabulary(input: $input) {
41
- id
42
- key
43
- name
44
- }
45
- }
46
- `, le = g`
47
- mutation TagsWidget_CreateTag($input: CreateTagInput!) {
48
- createTag(input: $input) {
49
- id
50
- key
51
- label
52
- value
53
- vocabularyId
54
- parentId
55
- hierarchyPath
56
- color
57
- icon
58
- vocabulary {
59
- key
60
- }
61
- }
62
- }
63
- `, b = g`
64
- mutation TagsWidget_NotifyTagAssigned($input: NotifyTagAssignedInput!) {
65
- notifyTagAssigned(input: $input)
66
- }
67
- `, ue = g`
68
- mutation TagsWidget_NotifyTagRemoved($key: String!, $entityType: String!, $entityId: ID!) {
69
- notifyTagRemoved(key: $key, entityType: $entityType, entityId: $entityId)
70
- }
71
- `, x = "general";
72
- function S({ entityType: g, entityId: S, workspaceId: de, tags: C, onAdd: w, onRemove: T, vocabularyId: fe, allowCreate: E = !0, syncGraphNotifications: D = !0, maxTags: O = 20, className: pe }) {
73
- let [me, k] = c(!1), [A, j] = c(""), [M, N] = c(null), [P, F] = c(fe), I = oe(null), L = e("workspace"), R = !de || !S, he = new Set(C.map((e) => e.id)), z = C.length < O, [B, { data: ge, loading: V }] = _(se, { client: L }), H = (ge?.searchTags ?? []).filter((e) => !he.has(e.id)), [U] = _(ce, { client: L }), [W] = v(y, { client: L }), [G, { loading: K }] = v(le, { client: L }), [q, J] = c(!1), [Y] = v(b, { client: L }), [X] = v(ue, { client: L }), Z = s(async () => {
74
- if (P) return P;
75
- let e = (await U({ variables: { key: x } })).data?.getVocabularyByKey;
76
- if (e) return F(e.id), e.id;
77
- let t = (await W({ variables: { input: {
78
- key: x,
79
- name: "General",
80
- description: "Default vocabulary for general-purpose tags",
81
- scope: "WORKSPACE",
82
- allowCustomTags: !0
83
- } } })).data?.createVocabulary;
84
- if (!t) throw Error("Failed to create default vocabulary");
85
- return F(t.id), t.id;
86
- }, [
87
- P,
88
- U,
89
- W
90
- ]), _e = s((e) => {
91
- j(e), M && N(null), I.current && clearTimeout(I.current), e.trim() && (I.current = setTimeout(() => {
92
- B({ variables: {
13
+ function y({ entityType: y, entityId: b, workspaceId: x, tags: S, onAdd: C, onRemove: w, vocabularyId: T, allowCreate: E = !0, syncGraphNotifications: D = !0, maxTags: O = 20, className: k }) {
14
+ let [A, j] = m(!1), [M, N] = m(""), [P, F] = m(null), [I, L] = m(!1), R = p(null), z = e("workspace"), { resolvedVocabId: B, resolveVocabId: V } = c(z, T), H = !x || !b, U = new Set(S.map((e) => e.id)), W = S.length < O, [G, { data: K, loading: q }] = _(s, { client: z }), J = (K?.searchTags ?? []).filter((e) => !U.has(e.id)), [Y, { loading: X }] = v(a, { client: z }), [Z] = v(ee, { client: z }), [Q] = v(o, { client: z }), ne = d((e) => {
15
+ N(e), P && F(null), R.current && clearTimeout(R.current), e.trim() && (R.current = setTimeout(() => {
16
+ G({ variables: {
93
17
  query: e,
94
- vocabularyId: P,
18
+ vocabularyId: B,
95
19
  limit: 10
96
20
  } });
97
21
  }, 250));
98
22
  }, [
23
+ G,
99
24
  B,
100
- P,
101
- M
25
+ P
102
26
  ]);
103
- ae(() => () => {
104
- I.current && clearTimeout(I.current);
27
+ f(() => () => {
28
+ R.current && clearTimeout(R.current);
105
29
  }, []);
106
- let Q = s(async (e) => {
107
- if (!(!z || q)) {
108
- J(!0);
30
+ let $ = d(async (e) => {
31
+ if (!(!W || I)) {
32
+ L(!0);
109
33
  try {
110
- await w({
34
+ await C({
111
35
  ...e,
112
36
  vocabularyKey: e.vocabularyKey ?? e.vocabulary?.key ?? null
113
- }), j(""), k(!1), D && Y({ variables: { input: {
37
+ }), N(""), j(!1), D && Z({ variables: { input: {
114
38
  key: e.key,
115
- entityType: g,
116
- entityId: S,
39
+ entityType: y,
40
+ entityId: b,
117
41
  source: "MANUAL"
118
42
  } } });
119
43
  } finally {
120
- J(!1);
44
+ L(!1);
121
45
  }
122
46
  }
123
47
  }, [
124
- Y,
125
- w,
126
- g,
127
- S,
128
- z,
129
- q,
48
+ Z,
49
+ C,
50
+ y,
51
+ b,
52
+ W,
53
+ I,
130
54
  D
131
- ]), ve = s(async () => {
132
- if (!(!E || !A.trim() || K)) {
133
- N(null);
55
+ ]), re = d(async () => {
56
+ if (!(!E || !M.trim() || X)) {
57
+ F(null);
134
58
  try {
135
- let e = A.trim(), t = e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
59
+ let e = M.trim(), t = e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
136
60
  if (!t) {
137
- N("Must contain at least one letter or number");
61
+ F("Must contain at least one letter or number");
138
62
  return;
139
63
  }
140
- let n = (await G({ variables: { input: {
64
+ let n = (await Y({ variables: { input: {
141
65
  key: t,
142
66
  label: e,
143
- vocabularyId: await Z()
67
+ vocabularyId: await V()
144
68
  } } })).data?.createTag;
145
69
  if (!n) throw Error("No data returned");
146
- await Q(n);
70
+ await $(n);
147
71
  } catch (e) {
148
- N(e instanceof Error ? e.message : "Failed to create tag");
72
+ F(e instanceof Error ? e.message : "Failed to create tag");
149
73
  }
150
74
  }
151
75
  }, [
152
76
  E,
153
- A,
154
- K,
155
- Z,
156
- G,
157
- Q
158
- ]), ye = s(async (e) => {
159
- let t = C.find((t) => t.id === e);
160
- await T(e), t && D && X({ variables: {
77
+ M,
78
+ X,
79
+ V,
80
+ Y,
81
+ $
82
+ ]), ie = d(async (e) => {
83
+ let t = S.find((t) => t.id === e);
84
+ await w(e), t && D && Q({ variables: {
161
85
  key: t.key,
162
- entityType: g,
163
- entityId: S
86
+ entityType: y,
87
+ entityId: b
164
88
  } });
165
89
  }, [
166
- X,
167
- T,
168
- C,
169
- g,
90
+ Q,
91
+ w,
170
92
  S,
93
+ y,
94
+ b,
171
95
  D
172
96
  ]);
173
- if (R) return null;
174
- let $ = E && A.trim() && !V && H.length === 0;
175
- return /* @__PURE__ */ h("div", {
176
- className: t("flex flex-wrap items-center gap-1.5", pe),
177
- children: [C.map((e) => /* @__PURE__ */ m(ie, {
178
- id: e.id,
179
- label: e.label,
180
- color: e.color ?? void 0,
181
- icon: e.icon ?? void 0,
182
- description: e.description ?? void 0,
183
- removable: !0,
184
- onRemove: () => void ye(e.id),
185
- size: "sm"
186
- }, e.id)), z && /* @__PURE__ */ h(te, {
187
- open: me,
188
- onOpenChange: k,
189
- children: [/* @__PURE__ */ m(re, {
97
+ if (H) return null;
98
+ let ae = !!(E && M.trim() && !q && J.length === 0);
99
+ return /* @__PURE__ */ g("div", {
100
+ className: t("flex flex-wrap items-center gap-1.5", k),
101
+ children: [/* @__PURE__ */ h(l, {
102
+ tags: S,
103
+ onRemove: (e) => void ie(e)
104
+ }), W && /* @__PURE__ */ g(n, {
105
+ open: A,
106
+ onOpenChange: j,
107
+ children: [/* @__PURE__ */ h(i, {
190
108
  asChild: !0,
191
- children: /* @__PURE__ */ h("button", {
192
- type: "button",
193
- "aria-label": "Add tag",
194
- className: t("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border border-dashed", "border-border text-muted-foreground text-xs", "hover:border-foreground hover:text-foreground transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),
195
- children: [/* @__PURE__ */ m(f, { className: "h-3 w-3" }), /* @__PURE__ */ m("span", { children: C.length === 0 ? "Add tags" : "Add" })]
196
- })
197
- }), /* @__PURE__ */ m(ne, {
109
+ children: /* @__PURE__ */ h(te, { hasTags: S.length > 0 })
110
+ }), /* @__PURE__ */ h(r, {
198
111
  className: "w-64 p-0",
199
112
  align: "start",
200
113
  side: "bottom",
201
114
  sideOffset: 4,
202
- children: /* @__PURE__ */ h(n, {
203
- shouldFilter: !1,
204
- children: [
205
- /* @__PURE__ */ h("div", {
206
- className: "flex items-center border-b border-border px-3",
207
- children: [
208
- /* @__PURE__ */ m(d, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
209
- /* @__PURE__ */ m(a, {
210
- placeholder: "Search or create a tag...",
211
- value: A,
212
- onValueChange: _e,
213
- className: "h-9 flex-1 border-0 bg-transparent px-2 text-sm outline-none placeholder:text-muted-foreground"
214
- }),
215
- V && /* @__PURE__ */ m(l, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground" })
216
- ]
217
- }),
218
- /* @__PURE__ */ h(ee, {
219
- className: "max-h-48 overflow-y-auto",
220
- children: [
221
- A.trim() === "" && /* @__PURE__ */ m(r, {
222
- className: "py-4 text-center text-xs text-muted-foreground",
223
- children: "Type to search or create a tag"
224
- }),
225
- H.length > 0 && /* @__PURE__ */ m(i, { children: H.map((e) => /* @__PURE__ */ h(o, {
226
- value: e.id,
227
- onSelect: () => void Q(e),
228
- className: "flex items-center gap-2 px-3 py-2 cursor-pointer",
229
- disabled: q,
230
- children: [
231
- e.icon && /* @__PURE__ */ m("span", {
232
- className: "text-sm",
233
- children: e.icon
234
- }),
235
- /* @__PURE__ */ m("span", {
236
- className: "truncate text-sm",
237
- style: e.color ? { color: e.color } : void 0,
238
- children: e.label
239
- }),
240
- q && /* @__PURE__ */ m(l, { className: "ml-auto h-3 w-3 animate-spin" })
241
- ]
242
- }, e.id)) }),
243
- $ && /* @__PURE__ */ m(i, { children: /* @__PURE__ */ h(o, {
244
- value: `__create__${A}`,
245
- onSelect: () => void ve(),
246
- className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-primary",
247
- disabled: K,
248
- children: [K ? /* @__PURE__ */ m(l, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ m(u, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ m("span", {
249
- className: "text-sm truncate",
250
- children: K ? "Creating..." : `Create "${A}"`
251
- })]
252
- }) }),
253
- A.trim() !== "" && !V && H.length === 0 && !$ && /* @__PURE__ */ m(r, {
254
- className: "py-4 text-center text-xs text-muted-foreground",
255
- children: "No tags found"
256
- }),
257
- M && /* @__PURE__ */ m("div", {
258
- className: "px-3 py-2 text-xs text-destructive border-t border-border",
259
- children: M
260
- })
261
- ]
262
- }),
263
- !z && /* @__PURE__ */ h("div", {
264
- className: "border-t border-border px-3 py-2 text-xs text-muted-foreground flex items-center gap-1",
265
- children: [
266
- /* @__PURE__ */ m(p, { className: "h-3 w-3" }),
267
- "Maximum ",
268
- O,
269
- " tags reached"
270
- ]
271
- })
272
- ]
115
+ children: /* @__PURE__ */ h(u, {
116
+ search: M,
117
+ onSearchChange: ne,
118
+ searching: q,
119
+ searchResults: J,
120
+ adding: I,
121
+ creating: X,
122
+ showCreateOption: ae,
123
+ createError: P,
124
+ canAddMore: W,
125
+ maxTags: O,
126
+ onAssign: (e) => void $(e),
127
+ onCreate: () => void re()
273
128
  })
274
129
  })]
275
130
  })]
276
131
  });
277
132
  }
278
133
  //#endregion
279
- export { S as TagsWidget };
134
+ export { y as TagsWidget };
@@ -0,0 +1,14 @@
1
+ import { cn as e } from "../../shared-utils.js";
2
+ import { Tag as t } from "lucide-react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ //#region src/tag/tagsWidget/AddTagTrigger.tsx
5
+ function i({ hasTags: i }) {
6
+ return /* @__PURE__ */ r("button", {
7
+ type: "button",
8
+ "aria-label": "Add tag",
9
+ className: e("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border border-dashed", "border-border text-muted-foreground text-xs", "hover:border-foreground hover:text-foreground transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),
10
+ children: [/* @__PURE__ */ n(t, { className: "size-3" }), /* @__PURE__ */ n("span", { children: i ? "Add" : "Add tags" })]
11
+ });
12
+ }
13
+ //#endregion
14
+ export { i as AddTagTrigger };
@@ -0,0 +1,17 @@
1
+ import { TagBadge as e } from "../TagBadge.js";
2
+ import { Fragment as t, jsx as n } from "react/jsx-runtime";
3
+ //#region src/tag/tagsWidget/TagBadgeList.tsx
4
+ function r({ tags: r, onRemove: i }) {
5
+ return /* @__PURE__ */ n(t, { children: r.map((t) => /* @__PURE__ */ n(e, {
6
+ id: t.id,
7
+ label: t.label,
8
+ color: t.color ?? void 0,
9
+ icon: t.icon ?? void 0,
10
+ description: t.description ?? void 0,
11
+ removable: !0,
12
+ onRemove: () => i(t.id),
13
+ size: "sm"
14
+ }, t.id)) });
15
+ }
16
+ //#endregion
17
+ export { r as TagBadgeList };
@@ -0,0 +1,80 @@
1
+ import { Command as e, CommandEmpty as t, CommandGroup as n, CommandInput as r, CommandItem as i, CommandList as a } from "../../ui/command.js";
2
+ import { Loader2 as o, Plus as s, Search as c, X as l } from "lucide-react";
3
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
4
+ //#region src/tag/tagsWidget/TagSearchPopover.tsx
5
+ function f({ search: f, onSearchChange: p, searching: m, searchResults: h, adding: g, creating: _, showCreateOption: v, createError: y, canAddMore: b, maxTags: x, onAssign: S, onCreate: C }) {
6
+ return /* @__PURE__ */ d(e, {
7
+ shouldFilter: !1,
8
+ children: [
9
+ /* @__PURE__ */ d("div", {
10
+ className: "flex items-center border-b border-border px-3",
11
+ children: [
12
+ /* @__PURE__ */ u(c, { className: "size-4 shrink-0 text-muted-foreground" }),
13
+ /* @__PURE__ */ u(r, {
14
+ placeholder: "Search or create a tag...",
15
+ value: f,
16
+ onValueChange: p,
17
+ className: "h-9 flex-1 border-0 bg-transparent px-2 text-sm outline-none placeholder:text-muted-foreground"
18
+ }),
19
+ m && /* @__PURE__ */ u(o, { className: "size-3.5 shrink-0 animate-spin text-muted-foreground" })
20
+ ]
21
+ }),
22
+ /* @__PURE__ */ d(a, {
23
+ className: "max-h-48 overflow-y-auto",
24
+ children: [
25
+ f.trim() === "" && /* @__PURE__ */ u(t, {
26
+ className: "py-4 text-center text-xs text-muted-foreground",
27
+ children: "Type to search or create a tag"
28
+ }),
29
+ h.length > 0 && /* @__PURE__ */ u(n, { children: h.map((e) => /* @__PURE__ */ d(i, {
30
+ value: e.id,
31
+ onSelect: () => S(e),
32
+ className: "flex items-center gap-2 px-3 py-2 cursor-pointer",
33
+ disabled: g,
34
+ children: [
35
+ e.icon && /* @__PURE__ */ u("span", {
36
+ className: "text-sm",
37
+ children: e.icon
38
+ }),
39
+ /* @__PURE__ */ u("span", {
40
+ className: "truncate text-sm",
41
+ style: e.color ? { color: e.color } : void 0,
42
+ children: e.label
43
+ }),
44
+ g && /* @__PURE__ */ u(o, { className: "ml-auto size-3 animate-spin" })
45
+ ]
46
+ }, e.id)) }),
47
+ v && /* @__PURE__ */ u(n, { children: /* @__PURE__ */ d(i, {
48
+ value: `__create__${f}`,
49
+ onSelect: C,
50
+ className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-primary",
51
+ disabled: _,
52
+ children: [_ ? /* @__PURE__ */ u(o, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ u(s, { className: "size-3.5" }), /* @__PURE__ */ u("span", {
53
+ className: "text-sm truncate",
54
+ children: _ ? "Creating..." : `Create "${f}"`
55
+ })]
56
+ }) }),
57
+ f.trim() !== "" && !m && h.length === 0 && !v && /* @__PURE__ */ u(t, {
58
+ className: "py-4 text-center text-xs text-muted-foreground",
59
+ children: "No tags found"
60
+ }),
61
+ y && /* @__PURE__ */ u("div", {
62
+ className: "px-3 py-2 text-xs text-destructive border-t border-border",
63
+ children: y
64
+ })
65
+ ]
66
+ }),
67
+ !b && /* @__PURE__ */ d("div", {
68
+ className: "border-t border-border px-3 py-2 text-xs text-muted-foreground flex items-center gap-1",
69
+ children: [
70
+ /* @__PURE__ */ u(l, { className: "size-3" }),
71
+ "Maximum ",
72
+ x,
73
+ " tags reached"
74
+ ]
75
+ })
76
+ ]
77
+ });
78
+ }
79
+ //#endregion
80
+ export { f as TagSearchPopover };
@@ -0,0 +1,64 @@
1
+ import { gql as e } from "@apollo/client";
2
+ //#region src/tag/tagsWidget/operations.ts
3
+ var t = e`
4
+ query TagsWidget_SearchTags($query: String!, $vocabularyId: ID, $limit: Int) {
5
+ searchTags(query: $query, vocabularyId: $vocabularyId, limit: $limit) {
6
+ id
7
+ key
8
+ label
9
+ value
10
+ vocabularyId
11
+ parentId
12
+ hierarchyPath
13
+ color
14
+ icon
15
+ description
16
+ vocabulary {
17
+ key
18
+ }
19
+ }
20
+ }
21
+ `, n = e`
22
+ query TagsWidget_GetVocabularyByKey($key: String!) {
23
+ getVocabularyByKey(key: $key) {
24
+ id
25
+ key
26
+ name
27
+ }
28
+ }
29
+ `, r = e`
30
+ mutation TagsWidget_CreateVocabulary($input: CreateVocabularyInput!) {
31
+ createVocabulary(input: $input) {
32
+ id
33
+ key
34
+ name
35
+ }
36
+ }
37
+ `, i = e`
38
+ mutation TagsWidget_CreateTag($input: CreateTagInput!) {
39
+ createTag(input: $input) {
40
+ id
41
+ key
42
+ label
43
+ value
44
+ vocabularyId
45
+ parentId
46
+ hierarchyPath
47
+ color
48
+ icon
49
+ vocabulary {
50
+ key
51
+ }
52
+ }
53
+ }
54
+ `, a = e`
55
+ mutation TagsWidget_NotifyTagAssigned($input: NotifyTagAssignedInput!) {
56
+ notifyTagAssigned(input: $input)
57
+ }
58
+ `, o = e`
59
+ mutation TagsWidget_NotifyTagRemoved($key: String!, $entityType: String!, $entityId: ID!) {
60
+ notifyTagRemoved(key: $key, entityType: $entityType, entityId: $entityId)
61
+ }
62
+ `, s = "general";
63
+ //#endregion
64
+ export { i as CREATE_TAG, r as CREATE_VOCABULARY, s as DEFAULT_VOCAB_KEY, n as GET_VOCABULARY_BY_KEY, a as NOTIFY_TAG_ASSIGNED, o as NOTIFY_TAG_REMOVED, t as SEARCH_TAGS };
@@ -0,0 +1,30 @@
1
+ import { CREATE_VOCABULARY as e, DEFAULT_VOCAB_KEY as t, GET_VOCABULARY_BY_KEY as n } from "./operations.js";
2
+ import { useCallback as r, useState as i } from "react";
3
+ import { useLazyQuery as a, useMutation as o } from "@apollo/client/react";
4
+ //#region src/tag/tagsWidget/useVocabResolver.ts
5
+ function s(s, c) {
6
+ let [l, u] = i(c), [d] = a(n, { client: s }), [f] = o(e, { client: s });
7
+ return {
8
+ resolvedVocabId: l,
9
+ resolveVocabId: r(async () => {
10
+ if (l) return l;
11
+ let e = (await d({ variables: { key: t } })).data?.getVocabularyByKey;
12
+ if (e) return u(e.id), e.id;
13
+ let n = (await f({ variables: { input: {
14
+ key: t,
15
+ name: "General",
16
+ description: "Default vocabulary for general-purpose tags",
17
+ scope: "WORKSPACE",
18
+ allowCustomTags: !0
19
+ } } })).data?.createVocabulary;
20
+ if (!n) throw Error("Failed to create default vocabulary");
21
+ return u(n.id), n.id;
22
+ }, [
23
+ l,
24
+ d,
25
+ f
26
+ ])
27
+ };
28
+ }
29
+ //#endregion
30
+ export { s as useVocabResolver };
package/dist/ui/card.js CHANGED
@@ -1,42 +1,47 @@
1
1
  import { cn as e } from "../shared-utils.js";
2
- import { forwardRef as t } from "react";
3
- import { jsx as n } from "react/jsx-runtime";
2
+ import { jsx as t } from "react/jsx-runtime";
4
3
  //#region src/ui/card.tsx
5
- var r = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
6
- ref: i,
7
- className: e("rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200 ease-out hover:shadow-md hover:border-border-default/80", t),
8
- ...r
9
- }));
10
- r.displayName = "Card";
11
- var i = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
12
- ref: i,
13
- className: e("flex flex-col space-y-1.5 p-6", t),
14
- ...r
15
- }));
16
- i.displayName = "CardHeader";
17
- var a = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("h3", {
18
- ref: i,
19
- className: e("text-2xl font-semibold leading-none tracking-tight", t),
20
- ...r
21
- }));
22
- a.displayName = "CardTitle";
23
- var o = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("p", {
24
- ref: i,
25
- className: e("text-sm text-muted-foreground", t),
26
- ...r
27
- }));
28
- o.displayName = "CardDescription";
29
- var s = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
30
- ref: i,
31
- className: e("p-6 pt-0", t),
32
- ...r
33
- }));
34
- s.displayName = "CardContent";
35
- var c = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
36
- ref: i,
37
- className: e("flex items-center p-6 pt-0", t),
38
- ...r
39
- }));
40
- c.displayName = "CardFooter";
4
+ function n({ ref: n, className: r, ...i }) {
5
+ return /* @__PURE__ */ t("div", {
6
+ ref: n,
7
+ className: e("rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200 ease-out hover:shadow-md hover:border-border-default/80", r),
8
+ ...i
9
+ });
10
+ }
11
+ function r({ ref: n, className: r, ...i }) {
12
+ return /* @__PURE__ */ t("div", {
13
+ ref: n,
14
+ className: e("flex flex-col space-y-1.5 p-6", r),
15
+ ...i
16
+ });
17
+ }
18
+ function i({ ref: n, className: r, ...i }) {
19
+ return /* @__PURE__ */ t("h3", {
20
+ ref: n,
21
+ className: e("text-2xl font-semibold leading-none tracking-tight", r),
22
+ ...i
23
+ });
24
+ }
25
+ function a({ ref: n, className: r, ...i }) {
26
+ return /* @__PURE__ */ t("p", {
27
+ ref: n,
28
+ className: e("text-sm text-muted-foreground", r),
29
+ ...i
30
+ });
31
+ }
32
+ function o({ ref: n, className: r, ...i }) {
33
+ return /* @__PURE__ */ t("div", {
34
+ ref: n,
35
+ className: e("p-6 pt-0", r),
36
+ ...i
37
+ });
38
+ }
39
+ function s({ ref: n, className: r, ...i }) {
40
+ return /* @__PURE__ */ t("div", {
41
+ ref: n,
42
+ className: e("flex items-center p-6 pt-0", r),
43
+ ...i
44
+ });
45
+ }
41
46
  //#endregion
42
- export { r as Card, s as CardContent, o as CardDescription, c as CardFooter, i as CardHeader, a as CardTitle };
47
+ export { n as Card, o as CardContent, a as CardDescription, s as CardFooter, r as CardHeader, i as CardTitle };