@mindlogic-ai/logician-ui 2.0.0-alpha.0 → 2.0.0-alpha.2

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 (70) hide show
  1. package/dist/Markdown-AZTXUJV3.js +16 -0
  2. package/dist/{Markdown-2D5K42BY.js.map → Markdown-AZTXUJV3.js.map} +1 -1
  3. package/dist/Markdown-N4OLOBIR.mjs +3 -0
  4. package/dist/{Markdown-RJJEQN4R.mjs.map → Markdown-N4OLOBIR.mjs.map} +1 -1
  5. package/dist/chunk-C5KQ6T3M.mjs +1772 -0
  6. package/dist/chunk-C5KQ6T3M.mjs.map +1 -0
  7. package/dist/chunk-JUTI2M3P.js +1814 -0
  8. package/dist/chunk-JUTI2M3P.js.map +1 -0
  9. package/dist/index.d.mts +7 -4
  10. package/dist/index.d.ts +7 -4
  11. package/dist/index.js +213 -188
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +34 -9
  14. package/dist/index.mjs.map +1 -1
  15. package/package.json +2 -1
  16. package/src/components/Icon/IconMap.ts +16 -0
  17. package/src/components/Icon/icons/amount-usage.svg +7 -0
  18. package/src/components/Icon/icons/dashboard.svg +3 -0
  19. package/src/components/Icon/icons/faq.svg +4 -0
  20. package/src/components/Icon/icons/filled-amount-usage.svg +3 -0
  21. package/src/components/Icon/icons/filled-faq.svg +3 -0
  22. package/src/components/Icon/icons/filled-members.svg +6 -0
  23. package/src/components/Icon/icons/members.svg +4 -0
  24. package/src/components/Icon/icons/window.svg +4 -0
  25. package/src/components/LineGraph/LineGraph.tsx +8 -5
  26. package/src/components/LineGraph/LineGraph.types.ts +1 -0
  27. package/src/components/{MonthRangePicker → MonthPicker}/MonthButton/MonthButton.tsx +1 -1
  28. package/src/components/{MonthRangePicker → MonthPicker}/MonthButton/MonthButton.types.ts +1 -1
  29. package/src/components/{MonthRangePicker/MonthRangePicker.stories.tsx → MonthPicker/MonthPicker.stories.tsx} +6 -6
  30. package/src/components/{MonthRangePicker/MonthRangePicker.tsx → MonthPicker/MonthPicker.tsx} +30 -5
  31. package/src/components/{MonthRangePicker/MonthRangePicker.types.ts → MonthPicker/MonthPicker.types.ts} +4 -1
  32. package/src/components/{MonthRangePicker → MonthPicker}/_utils/isMonthInRange.ts +1 -1
  33. package/src/components/{MonthRangePicker → MonthPicker}/_utils/isMonthSelected.ts +1 -1
  34. package/src/components/MonthPicker/index.ts +2 -0
  35. package/src/index.ts +1 -1
  36. package/dist/Markdown-2D5K42BY.js +0 -16
  37. package/dist/Markdown-RJJEQN4R.mjs +0 -3
  38. package/dist/analytics-GNSHP7X3.svg +0 -1
  39. package/dist/bulb-24SQINQB.svg +0 -1
  40. package/dist/chat-TLRFEUAS.svg +0 -1
  41. package/dist/chunk-5FHXD7KR.js +0 -1735
  42. package/dist/chunk-5FHXD7KR.js.map +0 -1
  43. package/dist/chunk-WSOHBA2C.mjs +0 -1693
  44. package/dist/chunk-WSOHBA2C.mjs.map +0 -1
  45. package/dist/edit-RWL72JNM.svg +0 -1
  46. package/dist/face-55KPDCH4.svg +0 -1
  47. package/dist/filled-analytics-RBC7KWND.svg +0 -1
  48. package/dist/filled-bulb-RC7E2WSM.svg +0 -1
  49. package/dist/filled-chat-A6J44Q7A.svg +0 -1
  50. package/dist/filled-edit-NKKWFSTW.svg +0 -1
  51. package/dist/filled-face-UML5C3LB.svg +0 -1
  52. package/dist/filled-layout-HBVCSDFO.svg +0 -1
  53. package/dist/language-VBJ24OPV.svg +0 -1
  54. package/dist/layout-NDDSWNNV.svg +0 -1
  55. package/dist/pending-NF7NSBYO.svg +0 -1
  56. package/dist/receipt-MNLQIFCO.svg +0 -1
  57. package/dist/sparkles-EOEGVL6G.svg +0 -1
  58. package/dist/store-3RQPBJWG.svg +0 -1
  59. package/dist/store_active-SAOAGVKC.svg +0 -1
  60. package/dist/studio-LYPUIEFA.svg +0 -1
  61. package/dist/studio_active-BC6O66OI.svg +0 -1
  62. package/dist/vertical-ellipsis-3G4WEOCW.svg +0 -1
  63. package/src/components/MonthRangePicker/index.ts +0 -2
  64. /package/src/components/{MonthRangePicker → MonthPicker}/MonthButton/index.ts +0 -0
  65. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/hasEnabledMonthsInYear.ts +0 -0
  66. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/index.ts +0 -0
  67. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/isMonthDisabled.ts +0 -0
  68. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/isMonthInPreviewRange.ts +0 -0
  69. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/isSelectionStart.ts +0 -0
  70. /package/src/components/{MonthRangePicker → MonthPicker}/constants.ts +0 -0
@@ -1,1693 +0,0 @@
1
- import ReactMarkdown from 'react-markdown';
2
- import { extendTheme, Card as Card$1, useTheme, Heading, useToken, Link as Link$1, Text, chakra, IconButton as IconButton$1, Tooltip as Tooltip$1, TableContainer as TableContainer$1, Tbody as Tbody$1, Th as Th$1, Code as Code$1, Flex, Button, Box, Spinner, Td as Td$1, Tr as Tr$1, Collapse, Table as Table$1, Thead as Thead$1 } from '@chakra-ui/react';
3
- import rehypeKatex from 'rehype-katex';
4
- import rehypeRaw from 'rehype-raw';
5
- import remarkBreaks from 'remark-breaks';
6
- import remarkFlexibleMarkers from 'remark-flexible-markers';
7
- import remarkGfm from 'remark-gfm';
8
- import remarkMath from 'remark-math';
9
- import 'katex/dist/katex.min.css';
10
- import { forwardRef, lazy, createContext, useCallback, useRef, useEffect, useContext, useState, Suspense, Children } from 'react';
11
- import { Prism } from 'react-syntax-highlighter';
12
- import { a11yDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
13
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
14
- import { motion } from 'framer-motion';
15
- import { darken } from 'polished';
16
- import { BiExpandAlt, BiDetail } from 'react-icons/bi';
17
- import { BsTranslate } from 'react-icons/bs';
18
- import { CiFileOn } from 'react-icons/ci';
19
- import { FaUsers, FaUserPlus, FaUserCheck, FaUniversity, FaSortNumericUp, FaSortNumericDown, FaSortAlphaUp, FaSortAlphaDown, FaPlay, FaRegEyeSlash, FaRegEye, FaRegUserCircle, FaRegTrashAlt, FaRegQuestionCircle, FaPrint, FaMoneyBillWave, FaImage, FaGraduationCap, FaChartPie, FaBeer, FaArchive } from 'react-icons/fa';
20
- import { FaUserClock, FaRotateRight, FaRegCopy, FaPersonChalkboard, FaLock, FaCode, FaCheck } from 'react-icons/fa6';
21
- import { GiTwoCoins } from 'react-icons/gi';
22
- import { GoArrowDownRight, GoArrowUpRight } from 'react-icons/go';
23
- import { GrUserAdmin } from 'react-icons/gr';
24
- import { HiX, HiRefresh, HiLightningBolt } from 'react-icons/hi';
25
- import { IoMdSettings, IoIosShareAlt, IoIosMail, IoIosAddCircleOutline, IoIosCheckmarkCircle, IoIosAttach, IoIosArrowBack, IoMdThumbsDown, IoMdThumbsUp, IoMdSave, IoMdLink, IoIosList, IoIosArrowForward } from 'react-icons/io';
26
- import { IoWarning, IoSearch, IoWarningOutline, IoHome, IoFilter, IoEyeOffOutline, IoEyeOutline, IoDocumentTextSharp, IoCloseOutline, IoClose, IoCodeSlash, IoChevronForward, IoChevronDownOutline, IoChatbubbleEllipses, IoCall, IoAddOutline, IoAddCircleOutline } from 'react-icons/io5';
27
- import { LiaNewspaper } from 'react-icons/lia';
28
- import { LuUpload, LuSendHorizontal, LuReceipt, LuMenu, LuInfo, LuGraduationCap, LuBookOpenText, LuDownload, LuExternalLink } from 'react-icons/lu';
29
- import { MdThumbsUpDown, MdSpaceDashboard, MdPreview, MdOutlineSpaceDashboard, MdOutlinePersonPin, MdOutlineCalendarToday, MdLogout, MdFilterList, MdError, MdCardMembership, MdAnnouncement } from 'react-icons/md';
30
- import { PiGlobeX, PiGlobe, PiExam, PiChatSlashBold } from 'react-icons/pi';
31
- import { RxDotsHorizontal } from 'react-icons/rx';
32
- import { SlSettings } from 'react-icons/sl';
33
- import { TbWorldSearch, TbSum, TbMessageChatbotFilled, TbLockCog, TbLayoutNavbar, TbInfinity, TbAppWindowFilled } from 'react-icons/tb';
34
-
35
- var __create = Object.create;
36
- var __defProp = Object.defineProperty;
37
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
38
- var __getOwnPropNames = Object.getOwnPropertyNames;
39
- var __getProtoOf = Object.getPrototypeOf;
40
- var __hasOwnProp = Object.prototype.hasOwnProperty;
41
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
42
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
43
- }) : x)(function(x) {
44
- if (typeof require !== "undefined") return require.apply(this, arguments);
45
- throw Error('Dynamic require of "' + x + '" is not supported');
46
- });
47
- var __commonJS = (cb, mod) => function __require2() {
48
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
49
- };
50
- var __copyProps = (to, from, except, desc) => {
51
- if (from && typeof from === "object" || typeof from === "function") {
52
- for (let key of __getOwnPropNames(from))
53
- if (!__hasOwnProp.call(to, key) && key !== except)
54
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
55
- }
56
- return to;
57
- };
58
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
59
- // If the importer is in node compatibility mode or this is not an ESM
60
- // file that has been converted to a CommonJS file using a Babel-
61
- // compatible transform (i.e. "__esModule" has not been set), then set
62
- // "default" to the CommonJS "module.exports" for node compatibility.
63
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
64
- mod
65
- ));
66
-
67
- // src/utils/formatTextForMarkdown.ts
68
- var formatForMarkdown = (text) => {
69
- return text?.replace(/\\n/g, " \n");
70
- };
71
-
72
- // src/translations/Defaults.translations.json
73
- var Defaults_translations_default = {
74
- get_started: {
75
- ko: "\uC2DC\uC791\uD558\uAE30",
76
- en: "Get Started",
77
- zh: "\u5F00\u59CB",
78
- ja: "\u59CB\u3081\u308B",
79
- es: "Comenzar"
80
- },
81
- next: {
82
- ko: "\uB2E4\uC74C",
83
- en: "Next",
84
- zh: "\u4E0B\u4E00\u4E2A",
85
- ja: "\u6B21",
86
- es: "Siguiente"
87
- },
88
- copy: {
89
- ko: "\uBCF5\uC0AC",
90
- en: "Copy",
91
- zh: "\u590D\u5236",
92
- ja: "\u30B3\u30D4\u30FC",
93
- es: "Copiar"
94
- },
95
- copied: {
96
- ko: "\uBCF5\uC0AC \uC644\uB8CC",
97
- en: "Copy completed",
98
- zh: "\u590D\u5236\u5B8C\u6210",
99
- ja: "\u30B3\u30D4\u30FC\u5B8C\u4E86",
100
- es: "Copia completada"
101
- },
102
- see_more: {
103
- ko: "\uB354\uBCF4\uAE30",
104
- en: "See more",
105
- zh: "\u67E5\u770B\u66F4\u591A",
106
- ja: "\u3082\u3063\u3068\u898B\u308B",
107
- es: "Ver m\xE1s"
108
- },
109
- previous: {
110
- ko: "\uC774\uC804",
111
- en: "Previous",
112
- zh: "\u4EE5\u524D",
113
- ja: "\u524D",
114
- es: "Anterior"
115
- },
116
- go_next_page_button: {
117
- ko: "\uB2E4\uC74C",
118
- en: "Next",
119
- zh: "\u4E0B\u4E00\u4E2A",
120
- ja: "\u6B21",
121
- es: "Siguiente"
122
- },
123
- pagination_range_text: {
124
- ko: "{num_total_items}\uAC1C \uC911 {range_start} - {range_end} \uD45C\uC2DC \uC911",
125
- en: "Displaying {range_start} - {range_end} of {num_total_items}",
126
- zh: "\u663E\u793A\u7B2C {range_start} - {range_end} \u9879\uFF0C\u5171 {num_total_items} \u9879",
127
- ja: "{num_total_items} \u4EF6\u4E2D {range_start} - {range_end} \u3092\u8868\u793A\u4E2D",
128
- es: "Mostrando {range_start} - {range_end} de {num_total_items}"
129
- },
130
- pagination_items_per_page: {
131
- ko: "\uD56D\uBAA9 \uC218",
132
- en: "items per page",
133
- zh: "\u6BCF\u9875\u9879\u76EE\u6570",
134
- ja: "\u30DA\u30FC\u30B8\u3054\u3068\u306E\u9805\u76EE\u6570",
135
- es: "elementos por p\xE1gina"
136
- },
137
- code_markdown_raw: {
138
- ko: "\uC6D0\uBB38",
139
- en: "Raw",
140
- zh: "\u539F\u6587",
141
- ja: "\u539F\u6587",
142
- es: "Crudo"
143
- },
144
- code_markdown_preview: {
145
- ko: "\uBBF8\uB9AC\uBCF4\uAE30",
146
- en: "Preview",
147
- zh: "\u9884\u89C8",
148
- ja: "\u30D7\u30EC\u30D3\u30E5\u30FC",
149
- es: "Vista previa"
150
- },
151
- month_range_placeholder: {
152
- ko: "\uC6D4 \uBC94\uC704 \uC120\uD0DD",
153
- en: "Select month range",
154
- zh: "\u9009\u62E9\u6708\u4EFD\u8303\u56F4",
155
- ja: "\u6708\u7BC4\u56F2\u3092\u9078\u629E",
156
- es: "Seleccionar rango de meses"
157
- },
158
- clear: {
159
- ko: "\uC9C0\uC6B0\uAE30",
160
- en: "Clear",
161
- zh: "\u6E05\u9664",
162
- ja: "\u30AF\u30EA\u30A2",
163
- es: "Borrar"
164
- },
165
- upload_your_file: {
166
- ko: "\uD30C\uC77C \uC5C5\uB85C\uB4DC",
167
- en: "Upload file",
168
- zh: "\u6587\u4EF6\u4E0A\u4F20",
169
- ja: "\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
170
- es: "Subir archivo"
171
- }
172
- };
173
- var replaceVariables = (text, variables) => {
174
- if (!variables) return formatForMarkdown(text);
175
- const regex = /({(.*?)})/gi;
176
- const potentialKeys = text.match(regex) ?? [];
177
- const textParts = [];
178
- let lastIndex = 0;
179
- potentialKeys.forEach((potentialKey) => {
180
- const keyIndex = text.indexOf(potentialKey);
181
- textParts.push(text.slice(lastIndex, keyIndex));
182
- textParts.push(text.slice(keyIndex, keyIndex + potentialKey.length));
183
- lastIndex = keyIndex + potentialKey.length;
184
- });
185
- textParts.push(text.slice(lastIndex));
186
- const parts = textParts.map(
187
- (partText) => (
188
- // Slice to remove { and }
189
- variables[partText.slice(1, partText.length - 1)] ?? formatForMarkdown(partText)
190
- )
191
- );
192
- return parts.every((part) => typeof part === "string") ? parts.join("") : parts;
193
- };
194
- var getLanguage = () => {
195
- return "ko";
196
- };
197
- var useTranslate = (translations = {}) => {
198
- const userLanguage = getLanguage();
199
- return useCallback(
200
- (key, variables) => {
201
- const locale = userLanguage;
202
- const translation = { ...Defaults_translations_default, ...translations }[key]?.[locale] ?? key;
203
- const finalRes = replaceVariables(translation, variables);
204
- return finalRes;
205
- },
206
- [userLanguage, translations]
207
- );
208
- };
209
-
210
- // src/theme/colors.ts
211
- var colors = {
212
- primary: {
213
- lighter: "blue.50",
214
- light: "blue.300",
215
- main: "blue.900",
216
- dark: "blue.1000"
217
- },
218
- secondary: {
219
- lighter: "purple.50",
220
- light: "purple.300",
221
- main: "purple.500",
222
- dark: "purple.700"
223
- },
224
- danger: {
225
- lighter: "red.50",
226
- light: "#FFC9C9",
227
- main: "red.500",
228
- dark: "#961616"
229
- },
230
- success: {
231
- lighter: "#EBFBF1",
232
- light: "#C1F4D4",
233
- main: "#019939",
234
- dark: "#016626"
235
- },
236
- warning: {
237
- lighter: "#FFF6E7",
238
- light: "#FFE9BA",
239
- main: "yellow.400",
240
- dark: "#9D6508"
241
- },
242
- gray: {
243
- 50: "#F4F5F6",
244
- 100: "#EAECEF",
245
- 200: "#E5E7EB",
246
- 300: "#EBF0FB",
247
- 400: "#D1D4DA",
248
- 500: "#C7CAD1",
249
- 600: "#BDC1C9",
250
- 700: "#AEB2BC",
251
- 800: "#9499A5",
252
- 900: "#7F8493",
253
- 1e3: "#6B7180",
254
- 1100: "#595E6A",
255
- 1200: "#474B55",
256
- 1300: "#363840",
257
- 1400: "#24262B",
258
- 1500: "#121315"
259
- },
260
- blue: {
261
- 100: "#FDFDFF",
262
- 200: "#FAFBFE",
263
- 300: "#EFF4FF",
264
- 400: "#D6E0F7",
265
- 500: "#94b0ec",
266
- 600: "#3182ce",
267
- 700: "#6c92e4",
268
- 800: "#4272dd",
269
- 900: "#1751D0",
270
- 1e3: "#113B98"
271
- },
272
- white: "#FFFFFF",
273
- black: "#121212"
274
- };
275
-
276
- // src/theme/font.ts
277
- var inter = {
278
- style: {
279
- fontFamily: '"Inter", sans-serif'
280
- }};
281
- var noto = {
282
- style: {
283
- fontFamily: '"Noto Sans", sans-serif'
284
- }};
285
- var pretendard = {
286
- style: {
287
- fontFamily: '"Pretendard Variable", sans-serif'
288
- }};
289
-
290
- // src/theme/global.ts
291
- var global = {
292
- ":root": {
293
- "--chakra-colors-chakra-body-text": "#121315",
294
- // gray.1500 hex value
295
- "--chakra-colors-chakra-body-bg": "#FFFFFF"
296
- },
297
- html: {
298
- height: "var(--chakra-vh)",
299
- fontSize: 14,
300
- fontFamily: [
301
- pretendard.style.fontFamily,
302
- inter.style.fontFamily,
303
- noto.style.fontFamily
304
- ].join(","),
305
- overflow: "auto"
306
- },
307
- "html, body": {
308
- color: "gray.1500"
309
- // Set the default body color
310
- },
311
- "#__next": {
312
- height: "var(--chakra-vh)"
313
- },
314
- "body[data-lang='es']": {
315
- fontFamily: inter.style.fontFamily
316
- }
317
- };
318
-
319
- // src/theme/index.ts
320
- var theme = extendTheme({
321
- colors,
322
- semanticTokens: {
323
- colors: {
324
- ...colors,
325
- "chakra-body-text": "gray.1500",
326
- "chakra-body-bg": "white",
327
- "chakra-body-text-secondary": "gray.1200"
328
- }
329
- },
330
- styles: {
331
- global
332
- },
333
- fonts: {
334
- body: '"Pretendard Variable", "Inter", "Noto Sans", sans-serif',
335
- heading: '"Pretendard Variable", "Inter", "Noto Sans", sans-serif'
336
- },
337
- // 반응형 폰트 사이즈 - 모바일에서는 더 작은 폰트 크기, 데스크톱에서는 기존 크기 유지
338
- fontSizes: {
339
- // 커스텀 폰트 크기 토큰 (em 단위 사용)
340
- // xs: { base: '0.7em', md: '0.7em' },
341
- subtitle: { base: "0.8em", md: "0.92em" },
342
- subtext: { base: "0.8em", md: "0.92em" },
343
- p: { base: "0.9em", md: "1em" },
344
- h5: { base: "1.1em", md: "1.2em" },
345
- h4: { base: "1.25em", md: "1.44em" },
346
- h3: { base: "1.5em", md: "1.75em" },
347
- h2: { base: "2em", md: "2.5em" },
348
- h1: { base: "2.4em", md: "3em" }
349
- },
350
- radii: {
351
- none: "0",
352
- sm: "6px",
353
- md: "8px",
354
- lg: "12px",
355
- xl: "32px",
356
- full: "9999px"
357
- }
358
- });
359
- var theme_default = theme;
360
-
361
- // src/components/Card/Card.styles.ts
362
- ({
363
- bgColor: theme_default.colors.white,
364
- color: theme_default.colors.black,
365
- borderColor: theme_default.colors.gray[100]
366
- });
367
- var clickableStyles = {
368
- cursor: "pointer",
369
- _hover: {
370
- boxShadow: "lg",
371
- [".card-image"]: {
372
- // TODO: define in theme
373
- transition: "0.3s all",
374
- transform: "scale(1.05)",
375
- backgroundSize: "105%"
376
- }
377
- }
378
- };
379
- var variantStyles = {
380
- default: {},
381
- gradient: {
382
- bg: `linear-gradient(180deg, #F5F8FD 0%, #FFFFFF 100%)`,
383
- border: `1px solid`,
384
- borderColor: "blue.600"
385
- }
386
- };
387
- var Card = forwardRef(
388
- ({ clickable, variant = "default", ...rest }, ref) => {
389
- return /* @__PURE__ */ jsx(
390
- Card$1,
391
- {
392
- ref,
393
- position: "relative",
394
- bgColor: "inherit",
395
- color: "inherit",
396
- boxShadow: "none",
397
- border: "1px solid",
398
- borderColor: "gray.300",
399
- borderRadius: "lg",
400
- transition: "0.3s all",
401
- p: 8,
402
- ...clickable ? clickableStyles : {},
403
- ...variantStyles[variant],
404
- ...rest
405
- }
406
- );
407
- }
408
- );
409
- Card.displayName = "Card";
410
- var InlineCode = ({ children, ...rest }) => {
411
- return /* @__PURE__ */ jsx(
412
- Code$1,
413
- {
414
- bg: "gray.50",
415
- color: "primary.dark",
416
- borderRadius: "sm",
417
- fontSize: "p",
418
- ...rest,
419
- children
420
- }
421
- );
422
- };
423
-
424
- // src/components/SegmentedControl/SegmentedControl.styles.ts
425
- var OptionStyles = {
426
- xs: {
427
- minW: 6,
428
- paddingInlineStart: 2,
429
- paddingInlineEnd: 2,
430
- h: 6
431
- },
432
- sm: {
433
- minW: 10,
434
- paddingInlineStart: 6,
435
- paddingInlineEnd: 6,
436
- h: 8
437
- },
438
- md: {
439
- paddingInlineStart: 6,
440
- paddingInlineEnd: 6,
441
- minW: 10,
442
- h: 10
443
- },
444
- lg: {},
445
- xl: {}
446
- };
447
- var SegmentedControl = ({
448
- options,
449
- value,
450
- onSelect,
451
- borderRadius = "md",
452
- size,
453
- ...rest
454
- }) => {
455
- const [internalValue, setInternalValue] = useState(options[0].value);
456
- const theme2 = useTheme();
457
- const activeValue = value !== void 0 ? value : internalValue;
458
- const activeIndex = options.findIndex(
459
- (option) => option.value === activeValue
460
- );
461
- const getControlPadding = (size2 = "md") => {
462
- const paddings = {
463
- xs: theme2.space[1],
464
- sm: theme2.space[1],
465
- md: theme2.space[1],
466
- lg: {},
467
- xl: {}
468
- };
469
- return paddings[size2];
470
- };
471
- const handleSelect = (selectedValue) => {
472
- if (value === void 0) {
473
- setInternalValue(selectedValue);
474
- }
475
- if (onSelect) onSelect(selectedValue);
476
- };
477
- return /* @__PURE__ */ jsxs(
478
- Flex,
479
- {
480
- position: "relative",
481
- borderRadius,
482
- bg: "gray.50",
483
- ...rest,
484
- children: [
485
- /* @__PURE__ */ jsx(
486
- motion.div,
487
- {
488
- initial: false,
489
- animate: {
490
- x: `calc(${100 * activeIndex}% + ${getControlPadding(size)})`
491
- },
492
- transition: { type: "spring", stiffness: 300, damping: 30 },
493
- style: {
494
- position: "absolute",
495
- // @ts-expect-error - Chakra UI responsive values in Framer Motion styles
496
- top: getControlPadding(size),
497
- // @ts-expect-error - Chakra UI responsive values in Framer Motion styles
498
- bottom: getControlPadding(size),
499
- left: `calc(${activeIndex * 2} * ${getControlPadding(size)})`,
500
- width: `calc(${100 / options.length}% - 2 * ${getControlPadding(size)})`,
501
- borderRadius: theme2.radii[borderRadius],
502
- background: theme2.colors.white,
503
- boxShadow: theme2.shadows.md
504
- }
505
- }
506
- ),
507
- options.map((option) => /* @__PURE__ */ jsx(
508
- Button,
509
- {
510
- flex: 1,
511
- variant: "ghost",
512
- color: activeValue === option.value ? "gray.1200" : "gray.600",
513
- onClick: () => handleSelect(option.value),
514
- _hover: { bg: "transparent" },
515
- fontSize: size,
516
- ...OptionStyles[size ?? "md"],
517
- children: option.label
518
- },
519
- option.value
520
- ))
521
- ]
522
- }
523
- );
524
- };
525
- var H1 = forwardRef((props, ref) => {
526
- const theme2 = useTheme();
527
- return /* @__PURE__ */ jsx(
528
- Heading,
529
- {
530
- ref,
531
- as: "h1",
532
- fontSize: theme2.fontSizes.h1,
533
- fontWeight: "bold",
534
- ...props
535
- }
536
- );
537
- });
538
- H1.displayName = "H1";
539
- var H2 = forwardRef((props, ref) => {
540
- const theme2 = useTheme();
541
- return /* @__PURE__ */ jsx(
542
- Heading,
543
- {
544
- ref,
545
- as: "h2",
546
- fontSize: theme2.fontSizes.h2,
547
- fontWeight: "semibold",
548
- ...props
549
- }
550
- );
551
- });
552
- H2.displayName = "H2";
553
- var H3 = forwardRef((props, ref) => {
554
- const theme2 = useTheme();
555
- return /* @__PURE__ */ jsx(
556
- Heading,
557
- {
558
- ref,
559
- as: "h3",
560
- fontSize: theme2.fontSizes.h3,
561
- fontWeight: "semibold",
562
- ...props
563
- }
564
- );
565
- });
566
- H3.displayName = "H3";
567
- var H4 = forwardRef((props, ref) => {
568
- const theme2 = useTheme();
569
- return /* @__PURE__ */ jsx(
570
- Heading,
571
- {
572
- ref,
573
- as: "h4",
574
- fontSize: theme2.fontSizes.h4,
575
- fontWeight: "semibold",
576
- ...props
577
- }
578
- );
579
- });
580
- H4.displayName = "H4";
581
- var H5 = forwardRef((props, ref) => {
582
- const theme2 = useTheme();
583
- return /* @__PURE__ */ jsx(
584
- Heading,
585
- {
586
- ref,
587
- as: "h5",
588
- fontSize: theme2.fontSizes.h5,
589
- fontWeight: "bold",
590
- ...props
591
- }
592
- );
593
- });
594
- H5.displayName = "H5";
595
- var Link = forwardRef(
596
- ({ color, variant, ...rest }, ref) => {
597
- const theme2 = useTheme();
598
- const defaultColor = theme2.semanticTokens.colors.primary.main;
599
- const errorColor = theme2.semanticTokens.colors.danger.main;
600
- const linkColor = useToken(
601
- "colors",
602
- variant === "error" ? errorColor : color || defaultColor
603
- ) ?? color;
604
- const getHoverColor = () => {
605
- let hoverColor;
606
- try {
607
- hoverColor = darken(0.1, linkColor);
608
- } catch (e) {
609
- hoverColor = "inherit";
610
- }
611
- return hoverColor;
612
- };
613
- return /* @__PURE__ */ jsx(
614
- Link$1,
615
- {
616
- ref,
617
- fontWeight: "semibold",
618
- color: linkColor,
619
- _hover: {
620
- color: getHoverColor()
621
- },
622
- ...rest
623
- }
624
- );
625
- }
626
- );
627
- Link.displayName = "Link";
628
- var Subtext = forwardRef((props, ref) => {
629
- const theme2 = useTheme();
630
- return /* @__PURE__ */ jsx(
631
- Text,
632
- {
633
- ref,
634
- fontSize: theme2.fontSizes.subtext,
635
- fontWeight: "regular",
636
- ...props
637
- }
638
- );
639
- });
640
- Subtext.displayName = "Subtext";
641
- var Subtitle = forwardRef((props, ref) => {
642
- const theme2 = useTheme();
643
- return /* @__PURE__ */ jsx(
644
- Text,
645
- {
646
- ref,
647
- as: "h6",
648
- fontSize: theme2.fontSizes.p,
649
- fontWeight: "medium",
650
- color: "gray.1000",
651
- ...props
652
- }
653
- );
654
- });
655
- Subtitle.displayName = "Subtitle";
656
- var Text3 = forwardRef(
657
- (props, ref) => {
658
- const theme2 = useTheme();
659
- return /* @__PURE__ */ jsx(
660
- Text,
661
- {
662
- ref,
663
- as: "p",
664
- fontSize: theme2.fontSizes.p,
665
- lineHeight: "1.5",
666
- fontWeight: "medium",
667
- color: "gray.1200",
668
- ...props
669
- }
670
- );
671
- }
672
- );
673
- Text3.displayName = "Text";
674
-
675
- // src/components/Icon/Icon.styles.ts
676
- var iconStyles = {
677
- color: theme_default.colors.black
678
- };
679
-
680
- // src/components/Icon/icons/analytics.svg
681
- var analytics_default = "./analytics-GNSHP7X3.svg";
682
-
683
- // src/components/Icon/icons/bulb.svg
684
- var bulb_default = "./bulb-24SQINQB.svg";
685
-
686
- // src/components/Icon/icons/chat.svg
687
- var chat_default = "./chat-TLRFEUAS.svg";
688
-
689
- // src/components/Icon/icons/edit.svg
690
- var edit_default = "./edit-RWL72JNM.svg";
691
-
692
- // src/components/Icon/icons/face.svg
693
- var face_default = "./face-55KPDCH4.svg";
694
-
695
- // src/components/Icon/icons/filled-analytics.svg
696
- var filled_analytics_default = "./filled-analytics-RBC7KWND.svg";
697
-
698
- // src/components/Icon/icons/filled-bulb.svg
699
- var filled_bulb_default = "./filled-bulb-RC7E2WSM.svg";
700
-
701
- // src/components/Icon/icons/filled-chat.svg
702
- var filled_chat_default = "./filled-chat-A6J44Q7A.svg";
703
-
704
- // src/components/Icon/icons/filled-edit.svg
705
- var filled_edit_default = "./filled-edit-NKKWFSTW.svg";
706
-
707
- // src/components/Icon/icons/filled-face.svg
708
- var filled_face_default = "./filled-face-UML5C3LB.svg";
709
-
710
- // src/components/Icon/icons/filled-layout.svg
711
- var filled_layout_default = "./filled-layout-HBVCSDFO.svg";
712
-
713
- // src/components/Icon/icons/language.svg
714
- var language_default = "./language-VBJ24OPV.svg";
715
-
716
- // src/components/Icon/icons/layout.svg
717
- var layout_default = "./layout-NDDSWNNV.svg";
718
-
719
- // src/components/Icon/icons/pending.svg
720
- var pending_default = "./pending-NF7NSBYO.svg";
721
-
722
- // src/components/Icon/icons/receipt.svg
723
- var receipt_default = "./receipt-MNLQIFCO.svg";
724
-
725
- // src/components/Icon/icons/sparkles.svg
726
- var sparkles_default = "./sparkles-EOEGVL6G.svg";
727
-
728
- // src/components/Icon/icons/store.svg
729
- var store_default = "./store-3RQPBJWG.svg";
730
-
731
- // src/components/Icon/icons/store_active.svg
732
- var store_active_default = "./store_active-SAOAGVKC.svg";
733
-
734
- // src/components/Icon/icons/studio.svg
735
- var studio_default = "./studio-LYPUIEFA.svg";
736
-
737
- // src/components/Icon/icons/studio_active.svg
738
- var studio_active_default = "./studio_active-BC6O66OI.svg";
739
-
740
- // src/components/Icon/icons/vertical-ellipsis.svg
741
- var vertical_ellipsis_default = "./vertical-ellipsis-3G4WEOCW.svg";
742
-
743
- // src/components/Icon/IconMap.ts
744
- var REACT_ICONS_MAP = {
745
- BiDetail,
746
- BiExpandAlt,
747
- BsTranslate,
748
- CiFileOn,
749
- FaArchive,
750
- FaBeer,
751
- FaChartPie,
752
- FaCheck,
753
- FaCode,
754
- FaGraduationCap,
755
- FaImage,
756
- FaLock,
757
- FaMoneyBillWave,
758
- FaPersonChalkboard,
759
- FaPrint,
760
- FaRegQuestionCircle,
761
- FaRegCopy,
762
- FaRegTrashAlt,
763
- FaRegUserCircle,
764
- FaRegEye,
765
- FaRegEyeSlash,
766
- FaRotateRight,
767
- FaPlay,
768
- FaSortAlphaDown,
769
- FaSortAlphaUp,
770
- FaSortNumericDown,
771
- FaSortNumericUp,
772
- FaUniversity,
773
- FaUserCheck,
774
- FaUserClock,
775
- FaUserPlus,
776
- FaUsers,
777
- GiTwoCoins,
778
- GoArrowUpRight,
779
- GoArrowDownRight,
780
- IoIosArrowForward,
781
- GrUserAdmin,
782
- HiLightningBolt,
783
- HiRefresh,
784
- IoAddCircleOutline,
785
- IoAddOutline,
786
- IoCall,
787
- IoChatbubbleEllipses,
788
- IoChevronDownOutline,
789
- IoChevronForward,
790
- IoCodeSlash,
791
- IoClose,
792
- IoCloseOutline,
793
- IoDocumentTextSharp,
794
- IoIosList,
795
- IoMdLink,
796
- IoMdSave,
797
- IoMdThumbsUp,
798
- IoMdThumbsDown,
799
- IoEyeOutline,
800
- IoEyeOffOutline,
801
- IoFilter,
802
- IoHome,
803
- IoIosArrowBack,
804
- IoIosAttach,
805
- IoIosCheckmarkCircle,
806
- IoIosAddCircleOutline,
807
- IoIosMail,
808
- IoIosShareAlt,
809
- IoMdSettings,
810
- IoWarningOutline,
811
- IoSearch,
812
- IoWarning,
813
- LuExternalLink,
814
- LuDownload,
815
- LiaNewspaper,
816
- LuBookOpenText,
817
- LuGraduationCap,
818
- LuInfo,
819
- LuMenu,
820
- LuReceipt,
821
- LuSendHorizontal,
822
- LuUpload,
823
- MdAnnouncement,
824
- MdCardMembership,
825
- MdError,
826
- MdFilterList,
827
- MdLogout,
828
- MdOutlineCalendarToday,
829
- MdOutlinePersonPin,
830
- MdOutlineSpaceDashboard,
831
- HiX,
832
- MdPreview,
833
- MdSpaceDashboard,
834
- MdThumbsUpDown,
835
- PiChatSlashBold,
836
- PiExam,
837
- PiGlobe,
838
- PiGlobeX,
839
- RxDotsHorizontal,
840
- SlSettings,
841
- TbAppWindowFilled,
842
- TbInfinity,
843
- TbLayoutNavbar,
844
- TbLockCog,
845
- TbMessageChatbotFilled,
846
- TbSum,
847
- TbWorldSearch
848
- };
849
- var CUSTOM_ICON_MAP = {
850
- Analytics: analytics_default,
851
- Bulb: bulb_default,
852
- Chat: chat_default,
853
- Edit: edit_default,
854
- Face: face_default,
855
- Language: language_default,
856
- Layout: layout_default,
857
- FilledAnalytics: filled_analytics_default,
858
- FilledBulb: filled_bulb_default,
859
- FilledChat: filled_chat_default,
860
- FilledEdit: filled_edit_default,
861
- FilledFace: filled_face_default,
862
- FilledLayout: filled_layout_default,
863
- Pending: pending_default,
864
- Sparkles: sparkles_default,
865
- Studio: studio_default,
866
- StudioActive: studio_active_default,
867
- Store: store_default,
868
- StoreActive: store_active_default,
869
- Receipt: receipt_default,
870
- VerticalEllipsis: vertical_ellipsis_default
871
- };
872
- var IconTypes = Object.keys({
873
- ...CUSTOM_ICON_MAP,
874
- ...REACT_ICONS_MAP
875
- }).reduce(
876
- (prevVal, currVal) => {
877
- prevVal[currVal] = currVal;
878
- return prevVal;
879
- },
880
- {}
881
- );
882
- var Icon = forwardRef(
883
- ({
884
- icon,
885
- color,
886
- boxSize = "md",
887
- // Default to 'md' size
888
- ...rest
889
- }, ref) => {
890
- const sizeMapping = {
891
- xs: "4",
892
- sm: "5",
893
- md: "6",
894
- lg: "8",
895
- xl: "10"
896
- };
897
- const mappedBoxSize = sizeMapping[boxSize] || boxSize;
898
- const [resolvedBoxSize] = useToken("sizes", [
899
- mappedBoxSize
900
- ]);
901
- const [resolvedColor] = useToken("colors", [color || ""]);
902
- if (icon in REACT_ICONS_MAP) {
903
- const IconComponent2 = chakra(REACT_ICONS_MAP[icon]);
904
- return /* @__PURE__ */ jsx(
905
- IconComponent2,
906
- {
907
- size: resolvedBoxSize,
908
- color: resolvedColor || color,
909
- ref,
910
- ...rest
911
- }
912
- );
913
- }
914
- let IconComponent = CUSTOM_ICON_MAP[icon];
915
- if (!IconComponent) {
916
- console.warn(
917
- `No icon component found for ${icon}. Rendering fallback icon.`
918
- );
919
- IconComponent = CUSTOM_ICON_MAP["VerticalEllipsis"];
920
- }
921
- const ChakraIcon = chakra(IconComponent);
922
- return /* @__PURE__ */ jsx(
923
- ChakraIcon,
924
- {
925
- ...iconStyles,
926
- color: resolvedColor,
927
- boxSize: resolvedBoxSize,
928
- ref,
929
- ...rest
930
- }
931
- );
932
- }
933
- );
934
- Icon.displayName = "Icon";
935
-
936
- // src/components/IconButton/IconButton.styles.ts
937
- var variantStyles2 = {
938
- primary: {
939
- borderColor: "primary.main",
940
- bgColor: "primary.main",
941
- color: "white",
942
- _hover: {
943
- borderColor: "blue.800",
944
- bgColor: "blue.800"
945
- }
946
- },
947
- secondary: {
948
- borderColor: "primary.light",
949
- bgColor: "primary.light",
950
- color: "primary.main",
951
- _hover: {
952
- borderColor: "blue.200",
953
- bgColor: "blue.200"
954
- }
955
- },
956
- tertiary: {
957
- borderColor: "gray.400",
958
- bgColor: "white",
959
- color: "gray.1200",
960
- _hover: {
961
- bgColor: "gray.50"
962
- }
963
- },
964
- danger: {
965
- borderColor: "danger.main",
966
- bgColor: "danger.main",
967
- color: "white",
968
- _hover: {
969
- bgColor: "red.600"
970
- }
971
- },
972
- link: {
973
- borderColor: "transparent",
974
- bgColor: "transparent",
975
- borderRadius: "none",
976
- _hover: {
977
- bgColor: "transparent"
978
- }
979
- }
980
- };
981
- var IconButton = forwardRef(
982
- ({ variant = "link", sx, ...rest }, ref) => {
983
- return /* @__PURE__ */ jsx(
984
- IconButton$1,
985
- {
986
- border: "1px solid",
987
- borderRadius: "full",
988
- background: "transparent",
989
- ...variantStyles2[variant],
990
- ...rest,
991
- ref,
992
- sx: {
993
- ...sx,
994
- "& svg": {
995
- pointerEvents: "none",
996
- ...sx?.["& svg"]
997
- },
998
- "& svg *": {
999
- pointerEvents: "none",
1000
- ...sx?.["& svg *"]
1001
- }
1002
- }
1003
- }
1004
- );
1005
- }
1006
- );
1007
- IconButton.displayName = "IconButton";
1008
- var Tooltip = forwardRef(
1009
- ({ ...rest }, ref) => {
1010
- const theme2 = useTheme();
1011
- return /* @__PURE__ */ jsx(
1012
- Tooltip$1,
1013
- {
1014
- bgColor: "gray.1200",
1015
- placement: "top",
1016
- fontSize: theme2.fontSizes.p,
1017
- closeOnScroll: true,
1018
- ...rest,
1019
- ref
1020
- }
1021
- );
1022
- }
1023
- );
1024
- Tooltip.displayName = "Tooltip";
1025
- var CopyButton = ({
1026
- onClick,
1027
- ...rest
1028
- }) => {
1029
- const translate = useTranslate();
1030
- const [labelText, setLabelText] = useState(
1031
- translate("copy")
1032
- );
1033
- const [isTooltipOpen, setIsTooltipOpen] = useState(
1034
- void 0
1035
- );
1036
- const handleClick = (e) => {
1037
- setLabelText(translate("copied"));
1038
- onClick?.(e);
1039
- setIsTooltipOpen(true);
1040
- const t = setTimeout(() => {
1041
- setLabelText(translate("copy"));
1042
- setIsTooltipOpen(void 0);
1043
- clearTimeout(t);
1044
- }, 3e3);
1045
- };
1046
- return /* @__PURE__ */ jsx(Tooltip, { label: labelText, isOpen: isTooltipOpen, placement: "top", children: /* @__PURE__ */ jsx(
1047
- IconButton,
1048
- {
1049
- "aria-label": "Copy code",
1050
- icon: /* @__PURE__ */ jsx(Icon, { icon: "FaRegCopy", boxSize: "sm" }),
1051
- onClick: handleClick,
1052
- p: 0,
1053
- ...rest
1054
- }
1055
- ) });
1056
- };
1057
- var Markdown = lazy(
1058
- () => import('./Markdown-RJJEQN4R.mjs').then((module) => ({ default: module.Markdown }))
1059
- );
1060
- var Code = ({
1061
- children,
1062
- language: languageProp,
1063
- onCopy,
1064
- style = a11yDark,
1065
- customStyle,
1066
- hideHeader = false,
1067
- containerProps,
1068
- ...rest
1069
- }) => {
1070
- const language = languageProp === "js" ? "javascript" : languageProp;
1071
- const translate = useTranslate();
1072
- const [isMarkdownPreviewMode, setIsMarkdownPreviewMode] = useState(false);
1073
- const handleCopyClick = () => {
1074
- onCopy?.(children);
1075
- };
1076
- const handleMarkdownModeChange = (selectedValue) => {
1077
- setIsMarkdownPreviewMode(selectedValue === "preview");
1078
- };
1079
- const handleSyntaxHighlighterClick = (e) => {
1080
- if (e.detail > 1 || window.getSelection()?.toString() !== "") {
1081
- return;
1082
- }
1083
- try {
1084
- const codeElement = e.currentTarget.querySelector("code");
1085
- if (codeElement) {
1086
- const range = document.createRange();
1087
- range.selectNodeContents(codeElement);
1088
- const selection = window.getSelection();
1089
- if (selection) {
1090
- selection.removeAllRanges();
1091
- selection.addRange(range);
1092
- }
1093
- }
1094
- } catch (error) {
1095
- console.error("Error selecting code content:", error);
1096
- }
1097
- };
1098
- return /* @__PURE__ */ jsxs(
1099
- Card,
1100
- {
1101
- p: 0,
1102
- borderRadius: "none",
1103
- ...containerProps,
1104
- className: ["ml-code", containerProps?.className].join(" "),
1105
- children: [
1106
- !hideHeader && language && /* @__PURE__ */ jsxs(
1107
- Flex,
1108
- {
1109
- className: "ml-code-header",
1110
- justify: "space-between",
1111
- align: "center",
1112
- px: 4,
1113
- py: 2,
1114
- bgColor: "white",
1115
- borderBottom: "1px solid",
1116
- borderColor: "primary.light",
1117
- width: "100%",
1118
- zIndex: 2,
1119
- children: [
1120
- /* @__PURE__ */ jsx(Subtext, { fontWeight: "bold", color: "gray.1200", children: /* @__PURE__ */ jsx("pre", { children: language }) }),
1121
- /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "flex-end", gap: 2, children: [
1122
- language === "markdown" && /* @__PURE__ */ jsx(
1123
- SegmentedControl,
1124
- {
1125
- size: "sm",
1126
- options: [
1127
- {
1128
- label: translate("code_markdown_raw"),
1129
- value: "raw"
1130
- },
1131
- {
1132
- label: translate("code_markdown_preview"),
1133
- value: "preview"
1134
- }
1135
- ],
1136
- onSelect: handleMarkdownModeChange
1137
- }
1138
- ),
1139
- onCopy && /* @__PURE__ */ jsx(CopyButton, { onClick: handleCopyClick })
1140
- ] })
1141
- ]
1142
- }
1143
- ),
1144
- /* @__PURE__ */ jsx(Box, { overflow: "hidden", children: /* @__PURE__ */ jsx(Box, { position: "relative", overflowY: "scroll", h: "fit-content", p: 0, children: isMarkdownPreviewMode ? /* @__PURE__ */ jsx(Box, { p: 2, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Spinner, {}), children: /* @__PURE__ */ jsx(
1145
- Markdown,
1146
- {
1147
- components: {
1148
- code: ({ className, ...rest2 }) => {
1149
- if (!className) {
1150
- return /* @__PURE__ */ jsx(InlineCode, { ...rest2 });
1151
- }
1152
- }
1153
- },
1154
- children
1155
- }
1156
- ) }) }) : (
1157
- // @ts-expect-error - SyntaxHighlighter type issues with React 18
1158
- /* @__PURE__ */ jsx(
1159
- Prism,
1160
- {
1161
- language,
1162
- style,
1163
- wrapLines: true,
1164
- wrapLongLines: true,
1165
- ...rest,
1166
- customStyle: {
1167
- maxWidth: "100%",
1168
- margin: 0,
1169
- borderRadius: 0,
1170
- ...customStyle
1171
- },
1172
- onClick: handleSyntaxHighlighterClick,
1173
- children
1174
- }
1175
- )
1176
- ) }) })
1177
- ]
1178
- }
1179
- );
1180
- };
1181
-
1182
- // src/components/Table/Table.styles.ts
1183
- var getStickyStyles = (isSticky, stickyDirection = "left", scrollState, stickyOffset = 0, isLastSticky = false) => {
1184
- if (!isSticky || !scrollState) return {};
1185
- const { isScrollStart, isScrollEnd, isScrolling } = scrollState;
1186
- const isBothSticky = stickyDirection === "left" && isScrollEnd || stickyDirection === "right" && isScrollStart;
1187
- const isSingleSticky = isScrolling;
1188
- const shouldShowShadow = isLastSticky && (isSingleSticky || isBothSticky);
1189
- return {
1190
- position: "sticky",
1191
- overflow: "visible",
1192
- [stickyDirection]: `${stickyOffset}px`,
1193
- zIndex: 2,
1194
- backgroundColor: "white",
1195
- ...shouldShowShadow && {
1196
- _after: {
1197
- content: '""',
1198
- position: "absolute",
1199
- top: 0,
1200
- bottom: "-1px",
1201
- width: "32px",
1202
- insetInlineEnd: stickyDirection === "left" ? 0 : "100%",
1203
- translate: stickyDirection === "left" ? "100%" : "-8",
1204
- boxShadow: stickyDirection === "left" ? "rgba(0, 0, 0, 0.16) 8px 0px 8px -8px inset" : "rgba(0, 0, 0, 0.16) -8px 0px 8px -8px inset"
1205
- }
1206
- }
1207
- };
1208
- };
1209
- var TableContext = createContext(null);
1210
- var useTableContext = () => {
1211
- const context = useContext(TableContext);
1212
- if (!context) {
1213
- console.error("useTableContext must be used within a TableProvider");
1214
- }
1215
- return context;
1216
- };
1217
- var TableProvider = ({ children }) => {
1218
- const containerRef = useRef(null);
1219
- const [scrollState, setScrollState] = useState({
1220
- isScrollStart: true,
1221
- isScrollEnd: false,
1222
- isScrolling: false
1223
- });
1224
- const stickyColumnsRef = useRef({
1225
- leftColumnWidths: /* @__PURE__ */ new Map(),
1226
- rightColumnWidths: /* @__PURE__ */ new Map()
1227
- });
1228
- const updateScrollState = useCallback(() => {
1229
- const container = containerRef.current;
1230
- if (!container) return;
1231
- const { scrollLeft, scrollWidth, clientWidth } = container;
1232
- const isScrollStart = scrollLeft <= 1;
1233
- const isScrollEnd = Math.abs(scrollWidth - clientWidth - scrollLeft) <= 1;
1234
- setScrollState((prevState) => {
1235
- if (prevState.isScrollStart !== isScrollStart || prevState.isScrollEnd !== isScrollEnd || prevState.isScrolling !== (!isScrollStart && !isScrollEnd)) {
1236
- return {
1237
- isScrollStart,
1238
- isScrollEnd,
1239
- isScrolling: !isScrollStart && !isScrollEnd
1240
- };
1241
- }
1242
- return prevState;
1243
- });
1244
- }, []);
1245
- const setContainerRef = useCallback(
1246
- (node) => {
1247
- containerRef.current = node;
1248
- if (node) {
1249
- updateScrollState();
1250
- }
1251
- },
1252
- [updateScrollState]
1253
- );
1254
- const registerStickyColumn = useCallback(
1255
- (direction, index, width) => {
1256
- if (direction === "left") {
1257
- stickyColumnsRef.current.leftColumnWidths.set(index, width);
1258
- } else {
1259
- stickyColumnsRef.current.rightColumnWidths.set(index, width);
1260
- }
1261
- },
1262
- []
1263
- );
1264
- const getStickyOffset = useCallback(
1265
- (direction, index) => {
1266
- if (index === 0) return 0;
1267
- const widthsMap = direction === "left" ? stickyColumnsRef.current.leftColumnWidths : stickyColumnsRef.current.rightColumnWidths;
1268
- let offset = 0;
1269
- for (let i = 0; i < index; i++) {
1270
- offset += widthsMap.get(i) || 0;
1271
- }
1272
- return offset;
1273
- },
1274
- []
1275
- );
1276
- const isLastStickyColumn = useCallback(
1277
- (direction, index) => {
1278
- const widthsMap = direction === "left" ? stickyColumnsRef.current.leftColumnWidths : stickyColumnsRef.current.rightColumnWidths;
1279
- let maxIndex = -1;
1280
- for (const idx of widthsMap.keys()) {
1281
- if (idx > maxIndex) maxIndex = idx;
1282
- }
1283
- return index === maxIndex;
1284
- },
1285
- []
1286
- );
1287
- useEffect(() => {
1288
- const container = containerRef.current;
1289
- if (!container) return;
1290
- const handleScroll = () => updateScrollState();
1291
- const handleResize = () => updateScrollState();
1292
- container.addEventListener("scroll", handleScroll);
1293
- window.addEventListener("resize", handleResize);
1294
- updateScrollState();
1295
- return () => {
1296
- container.removeEventListener("scroll", handleScroll);
1297
- window.removeEventListener("resize", handleResize);
1298
- };
1299
- }, [updateScrollState]);
1300
- return /* @__PURE__ */ jsx(
1301
- TableContext.Provider,
1302
- {
1303
- value: {
1304
- ...scrollState,
1305
- setContainerRef,
1306
- registerStickyColumn,
1307
- getStickyOffset,
1308
- isLastStickyColumn
1309
- },
1310
- children
1311
- }
1312
- );
1313
- };
1314
- var Td = ({
1315
- wrap,
1316
- isSticky = false,
1317
- stickyDirection = "left",
1318
- stickyIndex = 0,
1319
- _first,
1320
- style,
1321
- className,
1322
- children,
1323
- onClick,
1324
- onMouseEnter,
1325
- onMouseLeave,
1326
- ...rest
1327
- }) => {
1328
- const cellRef = useRef(null);
1329
- const tableContext = useTableContext();
1330
- const grayColor = useToken("colors", "gray.300");
1331
- const paddingToken = useToken("space", "3");
1332
- const fontSizeToken = useToken("fontSizes", "p");
1333
- const spacingToken = useToken("space", "4");
1334
- if (!tableContext) {
1335
- const htmlProps = {
1336
- className,
1337
- onClick,
1338
- onMouseEnter,
1339
- onMouseLeave
1340
- // Add other standard HTML props as needed
1341
- };
1342
- return /* @__PURE__ */ jsx(
1343
- "td",
1344
- {
1345
- ref: cellRef,
1346
- style: {
1347
- border: 0,
1348
- borderTop: "1px solid",
1349
- borderTopColor: grayColor,
1350
- color: "inherit",
1351
- fontSize: fontSizeToken,
1352
- paddingTop: paddingToken,
1353
- paddingBottom: paddingToken,
1354
- overflow: "hidden",
1355
- textOverflow: "ellipsis",
1356
- paddingInlineStart: _first ? spacingToken : void 0,
1357
- ...wrap ? {
1358
- whiteSpace: "normal",
1359
- wordWrap: "break-word",
1360
- overflowWrap: "break-word"
1361
- } : {},
1362
- ...style
1363
- },
1364
- ...htmlProps,
1365
- children
1366
- }
1367
- );
1368
- }
1369
- const {
1370
- registerStickyColumn,
1371
- getStickyOffset,
1372
- isLastStickyColumn,
1373
- ...scrollState
1374
- } = tableContext;
1375
- useEffect(() => {
1376
- if (isSticky && cellRef.current) {
1377
- const width = cellRef.current.getBoundingClientRect().width;
1378
- registerStickyColumn(stickyDirection, stickyIndex, width);
1379
- }
1380
- }, [isSticky, registerStickyColumn, stickyDirection, stickyIndex]);
1381
- const stickyOffset = isSticky ? getStickyOffset(stickyDirection, stickyIndex) : 0;
1382
- const isLastSticky = isSticky && isLastStickyColumn(stickyDirection, stickyIndex);
1383
- const stickyStyles = getStickyStyles(
1384
- isSticky,
1385
- stickyDirection,
1386
- scrollState,
1387
- stickyOffset,
1388
- isLastSticky
1389
- );
1390
- return /* @__PURE__ */ jsx(
1391
- Td$1,
1392
- {
1393
- border: 0,
1394
- borderTop: "1px solid",
1395
- borderTopColor: "gray.300",
1396
- color: "inherit",
1397
- fontSize: "p",
1398
- py: 3,
1399
- overflow: "hidden",
1400
- textOverflow: "ellipsis",
1401
- ref: cellRef,
1402
- style,
1403
- _first: {
1404
- "&:not(:last-child)": {
1405
- paddingInlineStart: 4
1406
- },
1407
- ..._first
1408
- },
1409
- ...wrap ? {
1410
- whiteSpace: "normal",
1411
- wordWrap: "break-word",
1412
- overflowWrap: "break-word"
1413
- } : {},
1414
- ...stickyStyles,
1415
- ...rest,
1416
- children
1417
- }
1418
- );
1419
- };
1420
- Td.displayName = "Td";
1421
- var Tr = ({ ...rest }) => {
1422
- return /* @__PURE__ */ jsx(Tr$1, { h: 12, ...rest });
1423
- };
1424
- var ExpandingTr = ({
1425
- children,
1426
- expandedContent,
1427
- isExpanded,
1428
- onExpandChange,
1429
- expandedRowProps,
1430
- ...rest
1431
- }) => {
1432
- const childrenArray = Children.toArray(children);
1433
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1434
- /* @__PURE__ */ jsx(Tr, { ...rest, children }),
1435
- /* @__PURE__ */ jsx(Tr, { h: isExpanded ? void 0 : 0, ...expandedRowProps, children: /* @__PURE__ */ jsx(Td, { colSpan: childrenArray.length, p: 0, children: /* @__PURE__ */ jsx(Collapse, { in: isExpanded, children: expandedContent }) }) })
1436
- ] });
1437
- };
1438
- var Table = ({ ...rest }) => {
1439
- return /* @__PURE__ */ jsx(Table$1, { ...rest });
1440
- };
1441
- var TableContainerInner = forwardRef(
1442
- ({ children, ...rest }, ref) => {
1443
- const { setContainerRef } = useTableContext();
1444
- const handleRef = useCallback(
1445
- (node) => {
1446
- if (typeof ref === "function") {
1447
- ref(node);
1448
- } else if (ref) {
1449
- ref.current = node;
1450
- }
1451
- setContainerRef(node);
1452
- },
1453
- [ref, setContainerRef]
1454
- );
1455
- return /* @__PURE__ */ jsx(
1456
- TableContainer$1,
1457
- {
1458
- border: "1px solid",
1459
- borderRadius: "md",
1460
- borderColor: "gray.300",
1461
- ref: handleRef,
1462
- ...rest,
1463
- children
1464
- }
1465
- );
1466
- }
1467
- );
1468
- TableContainerInner.displayName = "TableContainerInner";
1469
- var TableContainer = forwardRef(
1470
- (props, ref) => {
1471
- return /* @__PURE__ */ jsx(TableProvider, { children: /* @__PURE__ */ jsx(TableContainerInner, { ...props, ref }) });
1472
- }
1473
- );
1474
- TableContainer.displayName = "TableContainer";
1475
- var Tbody = forwardRef(
1476
- (props, ref) => {
1477
- return /* @__PURE__ */ jsx(Tbody$1, { ref, color: "gray.1500", fontWeight: "medium", ...props });
1478
- }
1479
- );
1480
- Tbody.displayName = "Tbody";
1481
- var Th = forwardRef(
1482
- ({
1483
- isSticky = false,
1484
- stickyDirection = "left",
1485
- stickyIndex = 0,
1486
- style,
1487
- className,
1488
- children,
1489
- onClick,
1490
- onMouseEnter,
1491
- onMouseLeave,
1492
- ...rest
1493
- }, forwardedRef) => {
1494
- const tableContext = useTableContext();
1495
- const measureNodeRef = useRef(null);
1496
- const fontSizeToken = useToken("fontSizes", "subtitle");
1497
- const spacingToken = useToken("space", "4");
1498
- if (!tableContext) {
1499
- const htmlProps = {
1500
- className,
1501
- onClick,
1502
- onMouseEnter,
1503
- onMouseLeave
1504
- // Add other standard HTML props as needed
1505
- };
1506
- const setRefsForRegularTh = useCallback(
1507
- (node) => {
1508
- measureNodeRef.current = node;
1509
- if (typeof forwardedRef === "function") {
1510
- forwardedRef(node);
1511
- } else if (forwardedRef) {
1512
- forwardedRef.current = node;
1513
- }
1514
- },
1515
- [forwardedRef]
1516
- );
1517
- return /* @__PURE__ */ jsx(
1518
- "th",
1519
- {
1520
- ref: setRefsForRegularTh,
1521
- style: {
1522
- color: "inherit",
1523
- fontWeight: "inherit",
1524
- fontSize: fontSizeToken,
1525
- overflow: "hidden",
1526
- textOverflow: "ellipsis",
1527
- paddingInlineStart: spacingToken,
1528
- ...style
1529
- },
1530
- ...htmlProps,
1531
- children
1532
- }
1533
- );
1534
- }
1535
- const {
1536
- registerStickyColumn,
1537
- getStickyOffset,
1538
- isLastStickyColumn,
1539
- ...scrollState
1540
- } = tableContext;
1541
- useEffect(() => {
1542
- if (isSticky && measureNodeRef.current) {
1543
- const width = measureNodeRef.current.getBoundingClientRect().width;
1544
- registerStickyColumn(stickyDirection, stickyIndex, width);
1545
- }
1546
- }, [isSticky, registerStickyColumn, stickyDirection, stickyIndex]);
1547
- const setRefs = useCallback(
1548
- (node) => {
1549
- measureNodeRef.current = node;
1550
- if (typeof forwardedRef === "function") {
1551
- forwardedRef(node);
1552
- } else if (forwardedRef) {
1553
- forwardedRef.current = node;
1554
- }
1555
- },
1556
- [forwardedRef]
1557
- );
1558
- const stickyOffset = isSticky ? getStickyOffset(stickyDirection, stickyIndex) : 0;
1559
- const isLastSticky = isSticky && isLastStickyColumn(stickyDirection, stickyIndex);
1560
- const stickyStyles = getStickyStyles(
1561
- isSticky,
1562
- stickyDirection,
1563
- scrollState,
1564
- stickyOffset,
1565
- isLastSticky
1566
- );
1567
- return /* @__PURE__ */ jsx(
1568
- Th$1,
1569
- {
1570
- color: "inherit",
1571
- fontWeight: "inherit",
1572
- fontSize: "subtitle",
1573
- overflow: "hidden",
1574
- textOverflow: "ellipsis",
1575
- ref: setRefs,
1576
- style,
1577
- _first: {
1578
- "&:not(:last-child)": {
1579
- paddingInlineStart: 4
1580
- }
1581
- },
1582
- ...stickyStyles,
1583
- ...rest,
1584
- children
1585
- }
1586
- );
1587
- }
1588
- );
1589
- Th.displayName = "Th";
1590
- var Thead = ({ ...rest }) => {
1591
- return /* @__PURE__ */ jsx(Thead$1, { color: "gray.800", fontWeight: "medium", ...rest });
1592
- };
1593
-
1594
- // src/components/Markdown/Markdown.module.css
1595
- var Markdown_default = {};
1596
- var H1Wrapper = (props) => /* @__PURE__ */ jsx(H1, { ...props });
1597
- var H2Wrapper = (props) => /* @__PURE__ */ jsx(H2, { ...props });
1598
- var H3Wrapper = (props) => /* @__PURE__ */ jsx(H3, { ...props });
1599
- var H4Wrapper = (props) => /* @__PURE__ */ jsx(H4, { ...props });
1600
- var H5Wrapper = (props) => /* @__PURE__ */ jsx(H5, { ...props });
1601
- var SubtitleWrapper = (props) => /* @__PURE__ */ jsx(Subtitle, { ...props });
1602
- var TheadWrapper = (props) => /* @__PURE__ */ jsx(Thead, { ...props });
1603
- var TbodyWrapper = (props) => /* @__PURE__ */ jsx(Tbody, { ...props });
1604
- var TrWrapper = (props) => /* @__PURE__ */ jsx(Tr, { ...props });
1605
- var TdWrapper = (props) => /* @__PURE__ */ jsx(Td, { ...props });
1606
- var ThWrapper = (props) => /* @__PURE__ */ jsx(Th, { ...props });
1607
- var baseMarkdownComponents = {
1608
- h1: H1Wrapper,
1609
- h2: H2Wrapper,
1610
- h3: H3Wrapper,
1611
- h4: H4Wrapper,
1612
- h5: H5Wrapper,
1613
- h6: SubtitleWrapper,
1614
- // The key fix: instead of trying to unwrap pre/code combinations,
1615
- // we customize just the code element to detect if it's a code block
1616
- code: ({ inline, className, children, ...props }) => {
1617
- if (inline || !className) {
1618
- return /* @__PURE__ */ jsx(InlineCode, { ...props, children });
1619
- }
1620
- const language = className.match(/language-(.*)/)?.[1];
1621
- return /* @__PURE__ */ jsx(
1622
- Code,
1623
- {
1624
- language,
1625
- onCopy: (textToCopy) => {
1626
- navigator.clipboard.writeText(textToCopy).then(() => {
1627
- console.log("Text copied to clipboard");
1628
- }).catch((err) => {
1629
- console.error("Could not copy text to clipboard:", err);
1630
- });
1631
- },
1632
- containerProps: { mb: 4, className },
1633
- ...props,
1634
- children
1635
- }
1636
- );
1637
- },
1638
- // Make the pre tag a no-op that just renders children
1639
- pre: ({ children }) => /* @__PURE__ */ jsx(Box, { children }),
1640
- p: (props) => /* @__PURE__ */ jsx(Text3, { color: "inherit", ...props }),
1641
- a: ({ style, ...rest }) => (
1642
- // `children` should be inside ...rest
1643
- /* @__PURE__ */ jsx(Link, { target: "_blank", ...rest })
1644
- ),
1645
- ol: ({ style, ...rest }) => /* @__PURE__ */ jsx(
1646
- "ol",
1647
- {
1648
- style: { paddingInlineStart: "22px", color: "inherit", ...style },
1649
- ...rest
1650
- }
1651
- ),
1652
- ul: ({ style, ...rest }) => /* @__PURE__ */ jsx(
1653
- "ul",
1654
- {
1655
- style: { paddingInlineStart: "22px", color: "inherit", ...style },
1656
- ...rest
1657
- }
1658
- ),
1659
- img: ({ style, ...rest }) => /* @__PURE__ */ jsx("img", { style: { maxWidth: "100%", ...style }, alt: "chat-image", ...rest }),
1660
- table: (props) => /* @__PURE__ */ jsx(TableContainer, { mt: 4, children: /* @__PURE__ */ jsx(Table, { ...props }) }),
1661
- thead: TheadWrapper,
1662
- tbody: TbodyWrapper,
1663
- tr: TrWrapper,
1664
- td: TdWrapper,
1665
- th: ThWrapper
1666
- };
1667
- var Markdown2 = ({
1668
- className,
1669
- components,
1670
- children,
1671
- ...rest
1672
- }) => {
1673
- const allComponents = { ...baseMarkdownComponents, ...components };
1674
- return /* @__PURE__ */ jsx("div", { className: [Markdown_default.markdownStyles, className].join(" "), children: /* @__PURE__ */ jsx(
1675
- ReactMarkdown,
1676
- {
1677
- remarkPlugins: [
1678
- remarkGfm,
1679
- remarkFlexibleMarkers,
1680
- remarkBreaks,
1681
- remarkMath
1682
- ],
1683
- rehypePlugins: [rehypeRaw, rehypeKatex],
1684
- components: allComponents,
1685
- ...rest,
1686
- children: formatForMarkdown(children ?? "")
1687
- }
1688
- ) });
1689
- };
1690
-
1691
- export { Card, Code, ExpandingTr, H1, H2, H3, H4, H5, Icon, IconButton, IconTypes, InlineCode, Markdown2 as Markdown, SegmentedControl, Subtext, Subtitle, Table, TableContainer, Tbody, Td, Text3 as Text, Th, Thead, Tooltip, Tr, __commonJS, __require, __toESM, baseMarkdownComponents, theme_default, useTranslate };
1692
- //# sourceMappingURL=chunk-WSOHBA2C.mjs.map
1693
- //# sourceMappingURL=chunk-WSOHBA2C.mjs.map