@sovereignsquad/gds-core 3.9.0 → 6.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 (122) hide show
  1. package/dist/GdsBadge-DqTdnomt.d.mts +417 -0
  2. package/dist/GdsBadge-DqTdnomt.d.ts +417 -0
  3. package/dist/PartnerDiscovery-As_-JKtb.d.ts +732 -0
  4. package/dist/PartnerDiscovery-Bwxixtka.d.mts +732 -0
  5. package/dist/QuickStartCard-CB7r-85z.d.ts +17500 -0
  6. package/dist/QuickStartCard-xIP1gbCL.d.mts +17500 -0
  7. package/dist/chunk-2AX4NCID.mjs +9 -0
  8. package/dist/chunk-2IUOZG4C.mjs +9 -0
  9. package/dist/chunk-2XZMNT7I.mjs +338 -0
  10. package/dist/chunk-3D7BVS7D.mjs +9 -0
  11. package/dist/chunk-4LG6EED4.mjs +338 -0
  12. package/dist/chunk-6LULEPIE.mjs +9 -0
  13. package/dist/chunk-6PBDLFSF.mjs +338 -0
  14. package/dist/{chunk-TQ7ZYMEA.mjs → chunk-BH2SMTND.mjs} +2258 -4014
  15. package/dist/chunk-BHR4A3C6.mjs +338 -0
  16. package/dist/chunk-CNTTKK3H.mjs +338 -0
  17. package/dist/chunk-GGDCO5HR.mjs +338 -0
  18. package/dist/chunk-GKNSUUUE.mjs +338 -0
  19. package/dist/chunk-GMK5GXWR.mjs +338 -0
  20. package/dist/chunk-H2QNW4D5.mjs +1768 -0
  21. package/dist/chunk-IHPZ7BNV.mjs +338 -0
  22. package/dist/chunk-J66ITCXC.mjs +473 -0
  23. package/dist/chunk-J6MXKFIM.mjs +9 -0
  24. package/dist/chunk-JTMPFTCK.mjs +338 -0
  25. package/dist/{chunk-BUC7QXRO.mjs → chunk-KFEPREUF.mjs} +13 -5
  26. package/dist/chunk-LNVLXOLI.mjs +9 -0
  27. package/dist/chunk-MAIU557K.mjs +9 -0
  28. package/dist/chunk-MPZFCWWS.mjs +210 -0
  29. package/dist/chunk-NWS7KJ2G.mjs +245 -0
  30. package/dist/chunk-OC3M4CZY.mjs +9 -0
  31. package/dist/chunk-QO653DAE.mjs +338 -0
  32. package/dist/chunk-RCLWUNMR.mjs +9 -0
  33. package/dist/chunk-SHQDVHGR.mjs +338 -0
  34. package/dist/{chunk-5AJJNRZF.mjs → chunk-TJ3WMH25.mjs} +1916 -2026
  35. package/dist/chunk-VU2JLVD3.mjs +89 -0
  36. package/dist/chunk-W5O2JSVK.mjs +20 -0
  37. package/dist/chunk-WNOWHB26.mjs +9 -0
  38. package/dist/chunk-XLPTCIXT.mjs +9 -0
  39. package/dist/chunk-ZCQXBKDM.mjs +24 -0
  40. package/dist/chunk-ZFGYQSNR.mjs +33 -0
  41. package/dist/client.d.mts +1296 -37
  42. package/dist/client.d.ts +1296 -37
  43. package/dist/client.js +11039 -6379
  44. package/dist/client.mjs +273 -58
  45. package/dist/en-Dd7uvXnv.d.mts +336 -0
  46. package/dist/en-Dd7uvXnv.d.ts +336 -0
  47. package/dist/index.d.mts +632 -5
  48. package/dist/index.d.ts +632 -5
  49. package/dist/index.js +21618 -14851
  50. package/dist/index.mjs +2138 -59
  51. package/dist/locales/lazy/all.d.mts +2 -0
  52. package/dist/locales/lazy/all.d.ts +2 -0
  53. package/dist/locales/lazy/all.js +1 -0
  54. package/dist/locales/lazy/all.mjs +24 -0
  55. package/dist/locales/lazy/ar.d.mts +2 -0
  56. package/dist/locales/lazy/ar.d.ts +2 -0
  57. package/dist/locales/lazy/ar.js +683 -0
  58. package/dist/locales/lazy/ar.mjs +4 -0
  59. package/dist/locales/lazy/de.d.mts +2 -0
  60. package/dist/locales/lazy/de.d.ts +2 -0
  61. package/dist/locales/lazy/de.js +683 -0
  62. package/dist/locales/lazy/de.mjs +4 -0
  63. package/dist/locales/lazy/es.d.mts +2 -0
  64. package/dist/locales/lazy/es.d.ts +2 -0
  65. package/dist/locales/lazy/es.js +683 -0
  66. package/dist/locales/lazy/es.mjs +4 -0
  67. package/dist/locales/lazy/fr.d.mts +2 -0
  68. package/dist/locales/lazy/fr.d.ts +2 -0
  69. package/dist/locales/lazy/fr.js +683 -0
  70. package/dist/locales/lazy/fr.mjs +4 -0
  71. package/dist/locales/lazy/he.d.mts +2 -0
  72. package/dist/locales/lazy/he.d.ts +2 -0
  73. package/dist/locales/lazy/he.js +683 -0
  74. package/dist/locales/lazy/he.mjs +4 -0
  75. package/dist/locales/lazy/hu.d.mts +2 -0
  76. package/dist/locales/lazy/hu.d.ts +2 -0
  77. package/dist/locales/lazy/hu.js +683 -0
  78. package/dist/locales/lazy/hu.mjs +4 -0
  79. package/dist/locales/lazy/index.d.mts +25 -0
  80. package/dist/locales/lazy/index.d.ts +25 -0
  81. package/dist/locales/lazy/index.js +384 -0
  82. package/dist/locales/lazy/index.mjs +9 -0
  83. package/dist/locales/lazy/it.d.mts +2 -0
  84. package/dist/locales/lazy/it.d.ts +2 -0
  85. package/dist/locales/lazy/it.js +683 -0
  86. package/dist/locales/lazy/it.mjs +4 -0
  87. package/dist/locales/lazy/ja.d.mts +2 -0
  88. package/dist/locales/lazy/ja.d.ts +2 -0
  89. package/dist/locales/lazy/ja.js +683 -0
  90. package/dist/locales/lazy/ja.mjs +4 -0
  91. package/dist/locales/lazy/ko.d.mts +2 -0
  92. package/dist/locales/lazy/ko.d.ts +2 -0
  93. package/dist/locales/lazy/ko.js +683 -0
  94. package/dist/locales/lazy/ko.mjs +4 -0
  95. package/dist/locales/lazy/ru.d.mts +2 -0
  96. package/dist/locales/lazy/ru.d.ts +2 -0
  97. package/dist/locales/lazy/ru.js +683 -0
  98. package/dist/locales/lazy/ru.mjs +4 -0
  99. package/dist/locales/lazy/zh.d.mts +2 -0
  100. package/dist/locales/lazy/zh.d.ts +2 -0
  101. package/dist/locales/lazy/zh.js +683 -0
  102. package/dist/locales/lazy/zh.mjs +4 -0
  103. package/dist/map.css +664 -0
  104. package/dist/map.d.mts +118 -0
  105. package/dist/map.d.ts +118 -0
  106. package/dist/map.js +777 -0
  107. package/dist/map.mjs +395 -0
  108. package/dist/reference-theme-explorer.d.mts +34 -0
  109. package/dist/reference-theme-explorer.d.ts +34 -0
  110. package/dist/reference-theme-explorer.js +8322 -0
  111. package/dist/reference-theme-explorer.mjs +1988 -0
  112. package/dist/rich-text-editor.d.mts +32 -0
  113. package/dist/rich-text-editor.d.ts +32 -0
  114. package/dist/rich-text-editor.js +469 -0
  115. package/dist/rich-text-editor.mjs +115 -0
  116. package/dist/server.d.mts +112 -248
  117. package/dist/server.d.ts +112 -248
  118. package/dist/server.js +6797 -1679
  119. package/dist/server.mjs +588 -55
  120. package/package.json +104 -9
  121. package/dist/AISearchCard-Bbnsd-yl.d.mts +0 -7786
  122. package/dist/AISearchCard-Bbnsd-yl.d.ts +0 -7786
@@ -0,0 +1,32 @@
1
+ import * as react from 'react';
2
+
3
+ /** Props for the `GdsRichTextEditor` component. */
4
+ interface GdsRichTextEditorProps {
5
+ /** Controlled HTML value. */
6
+ value?: string;
7
+ /** Called with the editor's serialized HTML on every content change. */
8
+ onChange?: (html: string) => void;
9
+ label?: string;
10
+ description?: string;
11
+ /** Accessible name for the editable region; defaults to `label`. */
12
+ ariaLabel?: string;
13
+ placeholder?: string;
14
+ readOnly?: boolean;
15
+ minHeight?: number | string;
16
+ }
17
+ /**
18
+ * GDS-owned rich text / content editor, wrapping Tiptap (fully encapsulated —
19
+ * see DEPENDENCY_GOVERNANCE.md's "Content engine" class; consumers never
20
+ * import `@tiptap/*` or touch its `Editor`/extension APIs directly). Fills
21
+ * the gap where "Content Ops Editor" patterns owned the surrounding layout
22
+ * but not the actual text-editing surface inside them (issue 392).
23
+ *
24
+ * Chosen over a hand-rolled contentEditable build per the same
25
+ * lowest-dependency/rock-solid-reliability standard used for KanbanBoard's
26
+ * @dnd-kit choice — hand-rolling selection/undo/paste-sanitization/IME
27
+ * composition reliably is a much larger, more fragile undertaking than
28
+ * reusing ProseMirror's battle-tested editing model.
29
+ */
30
+ declare function GdsRichTextEditor({ value, onChange, label, description, ariaLabel, placeholder, readOnly, minHeight, }: GdsRichTextEditorProps): react.JSX.Element | null;
31
+
32
+ export { GdsRichTextEditor, type GdsRichTextEditorProps };
@@ -0,0 +1,32 @@
1
+ import * as react from 'react';
2
+
3
+ /** Props for the `GdsRichTextEditor` component. */
4
+ interface GdsRichTextEditorProps {
5
+ /** Controlled HTML value. */
6
+ value?: string;
7
+ /** Called with the editor's serialized HTML on every content change. */
8
+ onChange?: (html: string) => void;
9
+ label?: string;
10
+ description?: string;
11
+ /** Accessible name for the editable region; defaults to `label`. */
12
+ ariaLabel?: string;
13
+ placeholder?: string;
14
+ readOnly?: boolean;
15
+ minHeight?: number | string;
16
+ }
17
+ /**
18
+ * GDS-owned rich text / content editor, wrapping Tiptap (fully encapsulated —
19
+ * see DEPENDENCY_GOVERNANCE.md's "Content engine" class; consumers never
20
+ * import `@tiptap/*` or touch its `Editor`/extension APIs directly). Fills
21
+ * the gap where "Content Ops Editor" patterns owned the surrounding layout
22
+ * but not the actual text-editing surface inside them (issue 392).
23
+ *
24
+ * Chosen over a hand-rolled contentEditable build per the same
25
+ * lowest-dependency/rock-solid-reliability standard used for KanbanBoard's
26
+ * @dnd-kit choice — hand-rolling selection/undo/paste-sanitization/IME
27
+ * composition reliably is a much larger, more fragile undertaking than
28
+ * reusing ProseMirror's battle-tested editing model.
29
+ */
30
+ declare function GdsRichTextEditor({ value, onChange, label, description, ariaLabel, placeholder, readOnly, minHeight, }: GdsRichTextEditorProps): react.JSX.Element | null;
31
+
32
+ export { GdsRichTextEditor, type GdsRichTextEditorProps };
@@ -0,0 +1,469 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/rich-text-editor.ts
31
+ var rich_text_editor_exports = {};
32
+ __export(rich_text_editor_exports, {
33
+ GdsRichTextEditor: () => GdsRichTextEditor
34
+ });
35
+ module.exports = __toCommonJS(rich_text_editor_exports);
36
+
37
+ // src/GdsRichTextEditor.client.tsx
38
+ var import_react2 = require("react");
39
+ var import_core = require("@mantine/core");
40
+ var import_react3 = require("@tiptap/react");
41
+ var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
42
+
43
+ // src/icons.ts
44
+ var import_icons_react = require("@tabler/icons-react");
45
+ var import_react = require("react");
46
+ var GdsIcons = {
47
+ // Navigation
48
+ Dashboard: import_icons_react.IconDashboard,
49
+ Settings: import_icons_react.IconSettings,
50
+ Users: import_icons_react.IconUsers,
51
+ Analytics: import_icons_react.IconChartBar,
52
+ Home: import_icons_react.IconHome,
53
+ Inbox: import_icons_react.IconInbox,
54
+ Calendar: import_icons_react.IconCalendar,
55
+ Gallery: import_icons_react.IconPhoto,
56
+ History: import_icons_react.IconHistory,
57
+ Profile: import_icons_react.IconUser,
58
+ // Actions
59
+ Add: import_icons_react.IconPlus,
60
+ Remove: import_icons_react.IconMinus,
61
+ Edit: import_icons_react.IconEdit,
62
+ Delete: import_icons_react.IconTrash,
63
+ Search: import_icons_react.IconSearch,
64
+ Save: import_icons_react.IconDeviceFloppy,
65
+ Play: import_icons_react.IconPlayerPlay,
66
+ Start: import_icons_react.IconRocket,
67
+ Send: import_icons_react.IconSend,
68
+ Reply: import_icons_react.IconArrowBackUp,
69
+ Forward: import_icons_react.IconArrowForwardUp,
70
+ Attach: import_icons_react.IconPaperclip,
71
+ Upload: import_icons_react.IconUpload,
72
+ Download: import_icons_react.IconDownload,
73
+ Print: import_icons_react.IconPrinter,
74
+ Copy: import_icons_react.IconCopy,
75
+ Duplicate: import_icons_react.IconCopyPlus,
76
+ Check: import_icons_react.IconSquareCheck,
77
+ Uncheck: import_icons_react.IconSquareX,
78
+ Complete: import_icons_react.IconChecks,
79
+ Clear: import_icons_react.IconClearAll,
80
+ Cancel: import_icons_react.IconBan,
81
+ Confirm: import_icons_react.IconThumbUp,
82
+ Close: import_icons_react.IconX,
83
+ Compare: import_icons_react.IconArrowsLeftRight,
84
+ // Preferences & System
85
+ Language: import_icons_react.IconLanguage,
86
+ Theme: import_icons_react.IconPalette,
87
+ // Media
88
+ Capture: import_icons_react.IconCamera,
89
+ Record: import_icons_react.IconVideo,
90
+ Flip: import_icons_react.IconCameraRotate,
91
+ Flash: import_icons_react.IconBolt,
92
+ // Domain specific
93
+ Course: import_icons_react.IconBook,
94
+ Lesson: import_icons_react.IconNotebook,
95
+ Certificate: import_icons_react.IconCertificate,
96
+ Student: import_icons_react.IconSchool,
97
+ Class: import_icons_react.IconBooks,
98
+ Grade: import_icons_react.IconAward,
99
+ Child: import_icons_react.IconMoodKid,
100
+ Family: import_icons_react.IconUsersGroup,
101
+ Habit: import_icons_react.IconTarget,
102
+ Goal: import_icons_react.IconFlag,
103
+ Streak: import_icons_react.IconFlame,
104
+ Reward: import_icons_react.IconGift,
105
+ // Feedback
106
+ Success: import_icons_react.IconCheck,
107
+ Warning: import_icons_react.IconAlertTriangle,
108
+ Danger: import_icons_react.IconAlertCircle,
109
+ Info: import_icons_react.IconInfoCircle,
110
+ // Analysis additions
111
+ Trophy: import_icons_react.IconTrophy,
112
+ Crown: import_icons_react.IconCrown,
113
+ Star: import_icons_react.IconStar,
114
+ StarFilled: import_icons_react.IconStarFilled,
115
+ Pause: import_icons_react.IconPlayerPause,
116
+ Message: import_icons_react.IconMessage,
117
+ Mail: import_icons_react.IconMail,
118
+ Refresh: import_icons_react.IconRefresh,
119
+ TrendingUp: import_icons_react.IconTrendingUp,
120
+ TrendingDown: import_icons_react.IconTrendingDown,
121
+ Currency: import_icons_react.IconCurrencyDollar,
122
+ Grid: import_icons_react.IconLayoutGrid,
123
+ List: import_icons_react.IconList,
124
+ Logout: import_icons_react.IconDoorExit,
125
+ Notifications: import_icons_react.IconBell,
126
+ Back: import_icons_react.IconArrowLeft,
127
+ Eye: import_icons_react.IconEye,
128
+ EyeOff: import_icons_react.IconEyeOff,
129
+ Help: import_icons_react.IconHelpCircle,
130
+ Filter: import_icons_react.IconFilter,
131
+ Sort: import_icons_react.IconArrowsSort,
132
+ // New Audit-driven additions
133
+ Export: import_icons_react.IconFileExport,
134
+ Import: import_icons_react.IconFileImport,
135
+ Preview: import_icons_react.IconEye,
136
+ Clone: import_icons_react.IconCopy,
137
+ Restore: import_icons_react.IconTrashOff,
138
+ Toggle: import_icons_react.IconToggleLeft,
139
+ Submit: import_icons_react.IconCheck,
140
+ Reset: import_icons_react.IconRefresh,
141
+ Login: import_icons_react.IconLogin,
142
+ Register: import_icons_react.IconUserPlus,
143
+ Verify: import_icons_react.IconShieldCheck,
144
+ Launch: import_icons_react.IconRocket,
145
+ Draft: import_icons_react.IconFileText,
146
+ Refer: import_icons_react.IconShare,
147
+ Evidence: import_icons_react.IconPaperclip,
148
+ // System
149
+ ChevronDown: import_icons_react.IconChevronDown,
150
+ ChevronUp: import_icons_react.IconChevronUp,
151
+ Menu: import_icons_react.IconMenu2,
152
+ Moon: import_icons_react.IconMoon,
153
+ Sun: import_icons_react.IconSun,
154
+ Move: import_icons_react.IconArrowsMove,
155
+ More: import_icons_react.IconDotsVertical,
156
+ Kanban: import_icons_react.IconLayoutKanban,
157
+ // Rich text editor (issue 392)
158
+ Bold: import_icons_react.IconBold,
159
+ Italic: import_icons_react.IconItalic,
160
+ Underline: import_icons_react.IconUnderline,
161
+ Strikethrough: import_icons_react.IconStrikethrough,
162
+ Quote: import_icons_react.IconBlockquote,
163
+ OrderedList: import_icons_react.IconListNumbers,
164
+ InlineCode: import_icons_react.IconCode,
165
+ Heading1: import_icons_react.IconH1,
166
+ Heading2: import_icons_react.IconH2,
167
+ Undo: import_icons_react.IconArrowBackUp,
168
+ Redo: import_icons_react.IconArrowForwardUp,
169
+ // Broader catalog expansion (issue 397)
170
+ ChevronLeft: import_icons_react.IconChevronLeft,
171
+ ChevronRight: import_icons_react.IconChevronRight,
172
+ ArrowUp: import_icons_react.IconArrowUp,
173
+ ArrowDown: import_icons_react.IconArrowDown,
174
+ ExternalLink: import_icons_react.IconExternalLink,
175
+ Link: import_icons_react.IconLink,
176
+ Cart: import_icons_react.IconShoppingCart,
177
+ Package: import_icons_react.IconPackage,
178
+ Payment: import_icons_react.IconCreditCard,
179
+ Wallet: import_icons_react.IconWallet,
180
+ Discount: import_icons_react.IconPercentage,
181
+ Tag: import_icons_react.IconTag,
182
+ Favorite: import_icons_react.IconHeart,
183
+ Bookmark: import_icons_react.IconBookmark,
184
+ Lock: import_icons_react.IconLock,
185
+ Unlock: import_icons_react.IconLockOpen,
186
+ Key: import_icons_react.IconKey,
187
+ Biometric: import_icons_react.IconFingerprint,
188
+ Time: import_icons_react.IconClock,
189
+ Globe: import_icons_react.IconWorld,
190
+ Location: import_icons_react.IconMapPin,
191
+ Building: import_icons_react.IconBuilding,
192
+ Folder: import_icons_react.IconFolder,
193
+ Archive: import_icons_react.IconArchive,
194
+ Connectivity: import_icons_react.IconWifi,
195
+ QrCode: import_icons_react.IconQrcode,
196
+ Flag: import_icons_react.IconFlag,
197
+ Tool: import_icons_react.IconTool,
198
+ Phone: import_icons_react.IconPhone,
199
+ DragHandle: import_icons_react.IconGripVertical,
200
+ // Trust layer (issue 709)
201
+ Confirmed: import_icons_react.IconCircleCheck,
202
+ Freshness: import_icons_react.IconClockCheck,
203
+ Stale: import_icons_react.IconClockExclamation,
204
+ Price: import_icons_react.IconCoin,
205
+ Schedule: import_icons_react.IconCalendarTime,
206
+ Checklist: import_icons_react.IconChecklist,
207
+ SourceInfo: import_icons_react.IconFileInfo
208
+ };
209
+ var gdsIconNameAliases = {
210
+ add: "Add",
211
+ analytics: "Analytics",
212
+ attach: "Attach",
213
+ back: "Back",
214
+ calendar: "Calendar",
215
+ cancel: "Cancel",
216
+ capture: "Capture",
217
+ check: "Check",
218
+ clear: "Clear",
219
+ clone: "Clone",
220
+ close: "Close",
221
+ compare: "Compare",
222
+ confirm: "Confirm",
223
+ copy: "Copy",
224
+ danger: "Danger",
225
+ dashboard: "Dashboard",
226
+ delete: "Delete",
227
+ download: "Download",
228
+ edit: "Edit",
229
+ error: "Danger",
230
+ evidence: "Evidence",
231
+ export: "Export",
232
+ filter: "Filter",
233
+ gallery: "Gallery",
234
+ help: "Help",
235
+ home: "Home",
236
+ import: "Import",
237
+ info: "Info",
238
+ language: "Language",
239
+ launch: "Launch",
240
+ login: "Login",
241
+ logout: "Logout",
242
+ menu: "Menu",
243
+ notifications: "Notifications",
244
+ preview: "Preview",
245
+ print: "Print",
246
+ refresh: "Refresh",
247
+ remove: "Remove",
248
+ reset: "Reset",
249
+ restore: "Restore",
250
+ save: "Save",
251
+ search: "Search",
252
+ settings: "Settings",
253
+ sort: "Sort",
254
+ submit: "Submit",
255
+ success: "Success",
256
+ theme: "Theme",
257
+ upload: "Upload",
258
+ users: "Users",
259
+ verify: "Verify",
260
+ warning: "Warning"
261
+ };
262
+ var categoryByIcon = {
263
+ action: ["Add", "Remove", "Edit", "Delete", "Search", "Save", "Play", "Start", "Send", "Reply", "Forward", "Attach", "Upload", "Download", "Print", "Copy", "Duplicate", "Check", "Uncheck", "Complete", "Clear", "Cancel", "Confirm", "Close", "Compare", "Export", "Import", "Preview", "Clone", "Restore", "Toggle", "Submit", "Reset", "Login", "Register", "Verify", "Launch", "Draft", "Refer", "Checklist"],
264
+ status: ["Success", "Warning", "Danger", "Info", "Confirmed", "Freshness", "Stale"],
265
+ resource: ["Users", "Gallery", "Profile", "Course", "Lesson", "Certificate", "Student", "Class", "Grade", "Child", "Family", "Habit", "Goal", "Streak", "Reward", "Trophy", "Crown", "Star", "StarFilled", "Currency", "Evidence", "SourceInfo"],
266
+ navigation: ["Dashboard", "Analytics", "Home", "Inbox", "Calendar", "History", "Grid", "List", "Back", "ChevronDown", "ChevronUp", "ChevronLeft", "ChevronRight", "ArrowUp", "ArrowDown", "ExternalLink", "Link", "Menu", "Kanban", "Location", "Schedule"],
267
+ media: ["Capture", "Record", "Flip", "Flash", "Eye", "EyeOff"],
268
+ feedback: ["Message", "Mail", "Refresh", "TrendingUp", "TrendingDown", "Notifications", "Help"],
269
+ system: ["Settings", "Language", "Theme", "Logout", "Moon", "Sun", "Filter", "Sort", "Move", "More", "Connectivity", "Tool"],
270
+ content: ["Bold", "Italic", "Underline", "Strikethrough", "Quote", "OrderedList", "InlineCode", "Heading1", "Heading2", "Undo", "Redo"],
271
+ commerce: ["Cart", "Package", "Payment", "Wallet", "Discount", "Tag", "Price"],
272
+ security: ["Lock", "Unlock", "Key", "Biometric"]
273
+ };
274
+ function startCase(value) {
275
+ return value.replace(/([a-z])([A-Z])/g, "$1 $2");
276
+ }
277
+ function categoryForIcon(name) {
278
+ for (const [category, keys] of Object.entries(categoryByIcon)) {
279
+ if (keys.includes(name)) {
280
+ return category;
281
+ }
282
+ }
283
+ return "system";
284
+ }
285
+ var gdsIconKeyByLowercase = Object.fromEntries(
286
+ Object.keys(GdsIcons).map((key) => [key.toLowerCase(), key])
287
+ );
288
+ function resolveGdsIconKey(value) {
289
+ if (!value) {
290
+ return "Help";
291
+ }
292
+ if (isGdsIconKey(value)) {
293
+ return value;
294
+ }
295
+ const alias = gdsIconNameAliases[value];
296
+ if (alias) {
297
+ return alias;
298
+ }
299
+ return gdsIconKeyByLowercase[value.toLowerCase()] ?? "Help";
300
+ }
301
+ var gdsIconRegistry = Object.fromEntries(
302
+ Object.keys(GdsIcons).map((name) => [
303
+ name,
304
+ {
305
+ name,
306
+ category: categoryForIcon(name),
307
+ defaultLabel: startCase(name),
308
+ a11yMode: "decorative",
309
+ directImportReplacement: `<GdsIcon name="${name}" label="${startCase(name)}" />`
310
+ }
311
+ ])
312
+ );
313
+ function isGdsIconKey(value) {
314
+ return value in GdsIcons;
315
+ }
316
+ function getGdsIconMetadata(name) {
317
+ return gdsIconRegistry[resolveGdsIconKey(name)];
318
+ }
319
+ var gdsIconToneColor = {
320
+ default: void 0,
321
+ primary: "var(--mantine-primary-color-filled)",
322
+ success: "var(--mantine-color-green-7)",
323
+ warning: "var(--mantine-color-yellow-8)",
324
+ danger: "var(--mantine-color-red-7)",
325
+ info: "var(--mantine-color-blue-7)",
326
+ muted: "var(--mantine-color-dimmed)"
327
+ };
328
+ function getGdsIconToneColor(tone = "default") {
329
+ return gdsIconToneColor[tone];
330
+ }
331
+ var iconSizes = {
332
+ xs: "0.875rem",
333
+ sm: "1rem",
334
+ md: "1.125rem",
335
+ lg: "1.35rem"
336
+ };
337
+ function GdsIcon({
338
+ icon,
339
+ name,
340
+ size = "md",
341
+ label,
342
+ decorative = !label,
343
+ stroke = 1.75,
344
+ tone = "default"
345
+ }) {
346
+ const iconKey = resolveGdsIconKey(icon ?? name);
347
+ const metadata = getGdsIconMetadata(iconKey);
348
+ const Icon = GdsIcons[iconKey] ?? GdsIcons.Help;
349
+ const isDecorative = decorative ?? !label;
350
+ return (0, import_react.createElement)(Icon, {
351
+ size: typeof size === "number" ? `${size}px` : iconSizes[size] ?? size,
352
+ stroke,
353
+ color: getGdsIconToneColor(tone),
354
+ "data-gds-icon": iconKey,
355
+ "data-gds-icon-category": metadata.category,
356
+ "aria-hidden": isDecorative || void 0,
357
+ "aria-label": !isDecorative ? label ?? metadata.defaultLabel : void 0,
358
+ role: !isDecorative ? "img" : void 0
359
+ });
360
+ }
361
+
362
+ // src/GdsRichTextEditor.client.tsx
363
+ var import_jsx_runtime = require("react/jsx-runtime");
364
+ function readToolbarActiveState(editor) {
365
+ return {
366
+ bold: editor.isActive("bold"),
367
+ italic: editor.isActive("italic"),
368
+ strike: editor.isActive("strike"),
369
+ h1: editor.isActive("heading", { level: 1 }),
370
+ h2: editor.isActive("heading", { level: 2 }),
371
+ bulletList: editor.isActive("bulletList"),
372
+ orderedList: editor.isActive("orderedList"),
373
+ blockquote: editor.isActive("blockquote"),
374
+ code: editor.isActive("code")
375
+ };
376
+ }
377
+ function getToolbarActions(editor, active) {
378
+ return [
379
+ { key: "bold", icon: "Bold", label: "Bold", isActive: active.bold, run: () => editor.chain().focus().toggleBold().run() },
380
+ { key: "italic", icon: "Italic", label: "Italic", isActive: active.italic, run: () => editor.chain().focus().toggleItalic().run() },
381
+ { key: "strike", icon: "Strikethrough", label: "Strikethrough", isActive: active.strike, run: () => editor.chain().focus().toggleStrike().run() },
382
+ { key: "h1", icon: "Heading1", label: "Heading 1", isActive: active.h1, run: () => editor.chain().focus().toggleHeading({ level: 1 }).run() },
383
+ { key: "h2", icon: "Heading2", label: "Heading 2", isActive: active.h2, run: () => editor.chain().focus().toggleHeading({ level: 2 }).run() },
384
+ { key: "bulletList", icon: "List", label: "Bullet list", isActive: active.bulletList, run: () => editor.chain().focus().toggleBulletList().run() },
385
+ { key: "orderedList", icon: "OrderedList", label: "Numbered list", isActive: active.orderedList, run: () => editor.chain().focus().toggleOrderedList().run() },
386
+ { key: "blockquote", icon: "Quote", label: "Quote", isActive: active.blockquote, run: () => editor.chain().focus().toggleBlockquote().run() },
387
+ { key: "code", icon: "InlineCode", label: "Inline code", isActive: active.code, run: () => editor.chain().focus().toggleCode().run() }
388
+ ];
389
+ }
390
+ function GdsRichTextEditor({
391
+ value = "",
392
+ onChange,
393
+ label,
394
+ description,
395
+ ariaLabel,
396
+ placeholder,
397
+ readOnly = false,
398
+ minHeight = 180
399
+ }) {
400
+ const editor = (0, import_react3.useEditor)({
401
+ extensions: [import_starter_kit.default],
402
+ content: value,
403
+ editable: !readOnly,
404
+ immediatelyRender: false,
405
+ onUpdate: ({ editor: updatedEditor }) => onChange?.(updatedEditor.getHTML()),
406
+ editorProps: {
407
+ attributes: {
408
+ "aria-label": ariaLabel ?? label ?? "Rich text editor",
409
+ role: "textbox",
410
+ "aria-multiline": "true",
411
+ ...placeholder ? { "data-placeholder": placeholder } : {}
412
+ }
413
+ }
414
+ });
415
+ (0, import_react2.useEffect)(() => {
416
+ if (!editor || editor.isDestroyed) return;
417
+ if (value !== editor.getHTML()) {
418
+ editor.commands.setContent(value, { emitUpdate: false });
419
+ }
420
+ }, [value, editor]);
421
+ (0, import_react2.useEffect)(() => {
422
+ if (!editor || editor.isDestroyed) return;
423
+ editor.setEditable(!readOnly);
424
+ }, [readOnly, editor]);
425
+ const activeState = (0, import_react3.useEditorState)({
426
+ editor,
427
+ selector: ({ editor: currentEditor }) => currentEditor ? readToolbarActiveState(currentEditor) : null
428
+ });
429
+ if (!editor) {
430
+ return null;
431
+ }
432
+ const actions = getToolbarActions(editor, activeState ?? readToolbarActiveState(editor));
433
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Box, { children: [
434
+ label ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Text, { component: "label", size: "sm", fw: 500, mb: 4, display: "block", children: label }) : null,
435
+ description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Text, { size: "xs", c: "dimmed", mb: "xs", children: description }) : null,
436
+ !readOnly ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Group, { role: "toolbar", "aria-label": "Text formatting", gap: 4, mb: "xs", wrap: "wrap", children: actions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react2.Fragment, { children: [
437
+ (index === 3 || index === 5 || index === 8) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Divider, { orientation: "vertical" }),
438
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
439
+ import_core.ActionIcon,
440
+ {
441
+ "aria-label": action.label,
442
+ "aria-pressed": action.isActive,
443
+ variant: action.isActive ? "filled" : "default",
444
+ size: "sm",
445
+ "data-gds-target-exception": "dense-toolbar",
446
+ onClick: action.run,
447
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GdsIcon, { name: action.icon, size: "xs", decorative: true })
448
+ }
449
+ )
450
+ ] }, action.key)) }) : null,
451
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
452
+ import_core.Box,
453
+ {
454
+ style: {
455
+ minHeight,
456
+ border: "1px solid var(--mantine-color-default-border)",
457
+ borderRadius: "var(--mantine-radius-sm)",
458
+ padding: "var(--mantine-spacing-sm)",
459
+ fontSize: "max(1rem, var(--mantine-font-size-sm))"
460
+ },
461
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react3.EditorContent, { editor })
462
+ }
463
+ )
464
+ ] });
465
+ }
466
+ // Annotate the CommonJS export names for ESM import in node:
467
+ 0 && (module.exports = {
468
+ GdsRichTextEditor
469
+ });
@@ -0,0 +1,115 @@
1
+ import {
2
+ GdsIcon
3
+ } from "./chunk-J66ITCXC.mjs";
4
+
5
+ // src/GdsRichTextEditor.client.tsx
6
+ import { Fragment, useEffect } from "react";
7
+ import { ActionIcon, Box, Divider, Group, Text } from "@mantine/core";
8
+ import { EditorContent, useEditor, useEditorState } from "@tiptap/react";
9
+ import StarterKit from "@tiptap/starter-kit";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ function readToolbarActiveState(editor) {
12
+ return {
13
+ bold: editor.isActive("bold"),
14
+ italic: editor.isActive("italic"),
15
+ strike: editor.isActive("strike"),
16
+ h1: editor.isActive("heading", { level: 1 }),
17
+ h2: editor.isActive("heading", { level: 2 }),
18
+ bulletList: editor.isActive("bulletList"),
19
+ orderedList: editor.isActive("orderedList"),
20
+ blockquote: editor.isActive("blockquote"),
21
+ code: editor.isActive("code")
22
+ };
23
+ }
24
+ function getToolbarActions(editor, active) {
25
+ return [
26
+ { key: "bold", icon: "Bold", label: "Bold", isActive: active.bold, run: () => editor.chain().focus().toggleBold().run() },
27
+ { key: "italic", icon: "Italic", label: "Italic", isActive: active.italic, run: () => editor.chain().focus().toggleItalic().run() },
28
+ { key: "strike", icon: "Strikethrough", label: "Strikethrough", isActive: active.strike, run: () => editor.chain().focus().toggleStrike().run() },
29
+ { key: "h1", icon: "Heading1", label: "Heading 1", isActive: active.h1, run: () => editor.chain().focus().toggleHeading({ level: 1 }).run() },
30
+ { key: "h2", icon: "Heading2", label: "Heading 2", isActive: active.h2, run: () => editor.chain().focus().toggleHeading({ level: 2 }).run() },
31
+ { key: "bulletList", icon: "List", label: "Bullet list", isActive: active.bulletList, run: () => editor.chain().focus().toggleBulletList().run() },
32
+ { key: "orderedList", icon: "OrderedList", label: "Numbered list", isActive: active.orderedList, run: () => editor.chain().focus().toggleOrderedList().run() },
33
+ { key: "blockquote", icon: "Quote", label: "Quote", isActive: active.blockquote, run: () => editor.chain().focus().toggleBlockquote().run() },
34
+ { key: "code", icon: "InlineCode", label: "Inline code", isActive: active.code, run: () => editor.chain().focus().toggleCode().run() }
35
+ ];
36
+ }
37
+ function GdsRichTextEditor({
38
+ value = "",
39
+ onChange,
40
+ label,
41
+ description,
42
+ ariaLabel,
43
+ placeholder,
44
+ readOnly = false,
45
+ minHeight = 180
46
+ }) {
47
+ const editor = useEditor({
48
+ extensions: [StarterKit],
49
+ content: value,
50
+ editable: !readOnly,
51
+ immediatelyRender: false,
52
+ onUpdate: ({ editor: updatedEditor }) => onChange?.(updatedEditor.getHTML()),
53
+ editorProps: {
54
+ attributes: {
55
+ "aria-label": ariaLabel ?? label ?? "Rich text editor",
56
+ role: "textbox",
57
+ "aria-multiline": "true",
58
+ ...placeholder ? { "data-placeholder": placeholder } : {}
59
+ }
60
+ }
61
+ });
62
+ useEffect(() => {
63
+ if (!editor || editor.isDestroyed) return;
64
+ if (value !== editor.getHTML()) {
65
+ editor.commands.setContent(value, { emitUpdate: false });
66
+ }
67
+ }, [value, editor]);
68
+ useEffect(() => {
69
+ if (!editor || editor.isDestroyed) return;
70
+ editor.setEditable(!readOnly);
71
+ }, [readOnly, editor]);
72
+ const activeState = useEditorState({
73
+ editor,
74
+ selector: ({ editor: currentEditor }) => currentEditor ? readToolbarActiveState(currentEditor) : null
75
+ });
76
+ if (!editor) {
77
+ return null;
78
+ }
79
+ const actions = getToolbarActions(editor, activeState ?? readToolbarActiveState(editor));
80
+ return /* @__PURE__ */ jsxs(Box, { children: [
81
+ label ? /* @__PURE__ */ jsx(Text, { component: "label", size: "sm", fw: 500, mb: 4, display: "block", children: label }) : null,
82
+ description ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", mb: "xs", children: description }) : null,
83
+ !readOnly ? /* @__PURE__ */ jsx(Group, { role: "toolbar", "aria-label": "Text formatting", gap: 4, mb: "xs", wrap: "wrap", children: actions.map((action, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
84
+ (index === 3 || index === 5 || index === 8) && /* @__PURE__ */ jsx(Divider, { orientation: "vertical" }),
85
+ /* @__PURE__ */ jsx(
86
+ ActionIcon,
87
+ {
88
+ "aria-label": action.label,
89
+ "aria-pressed": action.isActive,
90
+ variant: action.isActive ? "filled" : "default",
91
+ size: "sm",
92
+ "data-gds-target-exception": "dense-toolbar",
93
+ onClick: action.run,
94
+ children: /* @__PURE__ */ jsx(GdsIcon, { name: action.icon, size: "xs", decorative: true })
95
+ }
96
+ )
97
+ ] }, action.key)) }) : null,
98
+ /* @__PURE__ */ jsx(
99
+ Box,
100
+ {
101
+ style: {
102
+ minHeight,
103
+ border: "1px solid var(--mantine-color-default-border)",
104
+ borderRadius: "var(--mantine-radius-sm)",
105
+ padding: "var(--mantine-spacing-sm)",
106
+ fontSize: "max(1rem, var(--mantine-font-size-sm))"
107
+ },
108
+ children: /* @__PURE__ */ jsx(EditorContent, { editor })
109
+ }
110
+ )
111
+ ] });
112
+ }
113
+ export {
114
+ GdsRichTextEditor
115
+ };