@ryanhe919/lumen-ui 0.3.0 → 0.3.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.
- package/dist/ErrorMessage-CbE7emgD.cjs +26 -0
- package/dist/ErrorMessage-CbE7emgD.cjs.map +1 -0
- package/dist/ErrorMessage-Dt4cJ-sy.js +27 -0
- package/dist/ErrorMessage-Dt4cJ-sy.js.map +1 -0
- package/dist/{LMButton-B258yfky.cjs → LMButton-ByInEqMk.cjs} +15 -11
- package/dist/LMButton-ByInEqMk.cjs.map +1 -0
- package/dist/{LMButton-S4xQSohi.js → LMButton-DH7s4i80.js} +16 -12
- package/dist/LMButton-DH7s4i80.js.map +1 -0
- package/dist/{LMCard-D_K051f2.cjs → LMCard-lJGrsAzY.cjs} +9 -6
- package/dist/LMCard-lJGrsAzY.cjs.map +1 -0
- package/dist/{LMCard-D7ABNC95.js → LMCard-uuWNjVQL.js} +9 -6
- package/dist/LMCard-uuWNjVQL.js.map +1 -0
- package/dist/{LMCheckbox-C2YvEQ8f.cjs → LMCheckbox-C5gRhXJk.cjs} +11 -34
- package/dist/LMCheckbox-C5gRhXJk.cjs.map +1 -0
- package/dist/{LMCheckbox-DaaJRjKt.js → LMCheckbox-DPg4CldM.js} +11 -34
- package/dist/LMCheckbox-DPg4CldM.js.map +1 -0
- package/dist/{LMDatePicker-DSv28BFH.js → LMDatePicker-C7R0ByJ-.js} +5 -1
- package/dist/LMDatePicker-C7R0ByJ-.js.map +1 -0
- package/dist/{LMDatePicker-BlUwN4On.cjs → LMDatePicker-lH-8-HzG.cjs} +5 -1
- package/dist/LMDatePicker-lH-8-HzG.cjs.map +1 -0
- package/dist/{LMEmpty-BedQxpbi.cjs → LMEmpty-BCf4K8iH.cjs} +7 -6
- package/dist/LMEmpty-BCf4K8iH.cjs.map +1 -0
- package/dist/{LMEmpty-DzHM1fOb.js → LMEmpty-C499qRrR.js} +7 -6
- package/dist/LMEmpty-C499qRrR.js.map +1 -0
- package/dist/{LMField-DhDHj64z.cjs → LMField-BRaviP2p.cjs} +3 -2
- package/dist/LMField-BRaviP2p.cjs.map +1 -0
- package/dist/{LMField-BS-DSEya.js → LMField-DkRk9Q8-.js} +3 -2
- package/dist/LMField-DkRk9Q8-.js.map +1 -0
- package/dist/{LMInput-D9csGyhj.js → LMInput-Be2KkPOW.js} +21 -43
- package/dist/LMInput-Be2KkPOW.js.map +1 -0
- package/dist/{LMInput-CVjawj1F.cjs → LMInput-O55xkiRS.cjs} +20 -42
- package/dist/LMInput-O55xkiRS.cjs.map +1 -0
- package/dist/{LMModal-BCVVPLot.cjs → LMModal-BgxF1xOT.cjs} +2 -2
- package/dist/LMModal-BgxF1xOT.cjs.map +1 -0
- package/dist/{LMModal-DCJPlfA4.js → LMModal-CZF26Ask.js} +2 -2
- package/dist/LMModal-CZF26Ask.js.map +1 -0
- package/dist/{LMNumberInput-B1tU7T_W.cjs → LMNumberInput-DQaLVoud.cjs} +30 -39
- package/dist/LMNumberInput-DQaLVoud.cjs.map +1 -0
- package/dist/{LMNumberInput-BI5_OEx4.js → LMNumberInput-gnRvWRly.js} +31 -40
- package/dist/LMNumberInput-gnRvWRly.js.map +1 -0
- package/dist/{LMRadio-CHn6nFSy.cjs → LMRadio-BVBwm1rk.cjs} +11 -37
- package/dist/LMRadio-BVBwm1rk.cjs.map +1 -0
- package/dist/{LMRadio-UQLNgTMF.js → LMRadio-C0ZL0hVK.js} +11 -37
- package/dist/LMRadio-C0ZL0hVK.js.map +1 -0
- package/dist/{LMSearchInput-nBlAX734.cjs → LMSearchInput-BDJVh4Vs.cjs} +25 -31
- package/dist/LMSearchInput-BDJVh4Vs.cjs.map +1 -0
- package/dist/{LMSearchInput-CIvVkEf2.js → LMSearchInput-DQovqMTN.js} +26 -32
- package/dist/LMSearchInput-DQovqMTN.js.map +1 -0
- package/dist/{LMSelect-B-MWX2JI.js → LMSelect-BPfW-AHI.js} +37 -48
- package/dist/LMSelect-BPfW-AHI.js.map +1 -0
- package/dist/{LMSelect-ByQcUp2S.cjs → LMSelect-xIVolEhx.cjs} +37 -48
- package/dist/LMSelect-xIVolEhx.cjs.map +1 -0
- package/dist/{LMStatCard-D5HV9r6d.js → LMStatCard-CdyIDhrA.js} +11 -6
- package/dist/LMStatCard-CdyIDhrA.js.map +1 -0
- package/dist/{LMStatCard-MXs9Z0qH.cjs → LMStatCard-Do5f2Map.cjs} +11 -6
- package/dist/LMStatCard-Do5f2Map.cjs.map +1 -0
- package/dist/{LMSwitch-CP1_nrfU.js → LMSwitch-BqhucDO0.js} +3 -31
- package/dist/LMSwitch-BqhucDO0.js.map +1 -0
- package/dist/{LMSwitch-DYoSH6wE.cjs → LMSwitch-BxVqTSUH.cjs} +3 -31
- package/dist/LMSwitch-BxVqTSUH.cjs.map +1 -0
- package/dist/{LMTable-j1ZzAzXB.cjs → LMTable-Be9FK8bz.cjs} +7 -4
- package/dist/LMTable-Be9FK8bz.cjs.map +1 -0
- package/dist/{LMTable-Cp8HZqiV.js → LMTable-IGmHFhnV.js} +7 -4
- package/dist/LMTable-IGmHFhnV.js.map +1 -0
- package/dist/{LMTabs-D5n9lB8X.js → LMTabs-Cjp3oiNv.js} +2 -2
- package/dist/{LMTabs-D5n9lB8X.js.map → LMTabs-Cjp3oiNv.js.map} +1 -1
- package/dist/{LMTabs-NPmOzPat.cjs → LMTabs-DEYx2gOH.cjs} +2 -2
- package/dist/{LMTabs-NPmOzPat.cjs.map → LMTabs-DEYx2gOH.cjs.map} +1 -1
- package/dist/{LMTextarea-5dVVPeL2.js → LMTextarea-BNacTCNn.js} +20 -28
- package/dist/LMTextarea-BNacTCNn.js.map +1 -0
- package/dist/{LMTextarea-yG0OBZjA.cjs → LMTextarea-DRi6gaFW.cjs} +20 -28
- package/dist/LMTextarea-DRi6gaFW.cjs.map +1 -0
- package/dist/cn-I2jp-M-K.cjs +6 -0
- package/dist/cn-I2jp-M-K.cjs.map +1 -0
- package/dist/cn-wDEkOmcn.js +7 -0
- package/dist/cn-wDEkOmcn.js.map +1 -0
- package/dist/components/Chat/LMChatBubble/LMChatBubble.d.ts.map +1 -1
- package/dist/components/Chat/LMChatContainer/LMChatContainer.d.ts.map +1 -1
- package/dist/components/Chat/LMChatInput/LMChatInput.d.ts.map +1 -1
- package/dist/components/Chat/LMChatMessage/LMChatMessage.d.ts.map +1 -1
- package/dist/components/Chat/LMMarkdownRenderer/LMMarkdownRenderer.d.ts.map +1 -1
- package/dist/components/Chat/LMTypingIndicator/LMTypingIndicator.d.ts.map +1 -1
- package/dist/components/DataDisplay/LMCard/LMCard.d.ts.map +1 -1
- package/dist/components/DataDisplay/LMEmpty/LMEmpty.d.ts.map +1 -1
- package/dist/components/DataDisplay/LMStatCard/LMStatCard.d.ts.map +1 -1
- package/dist/components/DataDisplay/LMTable/LMTable.d.ts.map +1 -1
- package/dist/components/Feedback/LMModal/LMModal.d.ts +1 -1
- package/dist/components/Feedback/LMModal/LMModal.d.ts.map +1 -1
- package/dist/components/Form/LMCheckbox/LMCheckbox.d.ts.map +1 -1
- package/dist/components/Form/LMDatePicker/LMDatePicker.d.ts.map +1 -1
- package/dist/components/Form/LMField/LMField.d.ts.map +1 -1
- package/dist/components/Form/LMInput/LMInput.d.ts +1 -1
- package/dist/components/Form/LMInput/LMInput.d.ts.map +1 -1
- package/dist/components/Form/LMNumberInput/LMNumberInput.d.ts +1 -1
- package/dist/components/Form/LMNumberInput/LMNumberInput.d.ts.map +1 -1
- package/dist/components/Form/LMRadio/LMRadio.d.ts.map +1 -1
- package/dist/components/Form/LMSearchInput/LMSearchInput.d.ts +1 -1
- package/dist/components/Form/LMSearchInput/LMSearchInput.d.ts.map +1 -1
- package/dist/components/Form/LMSelect/LMSelect.d.ts.map +1 -1
- package/dist/components/Form/LMSwitch/LMSwitch.d.ts.map +1 -1
- package/dist/components/Form/LMTextarea/LMTextarea.d.ts +1 -1
- package/dist/components/Form/LMTextarea/LMTextarea.d.ts.map +1 -1
- package/dist/components/General/LMButton/LMButton.d.ts.map +1 -1
- package/dist/components/_internal/ErrorMessage.d.ts +9 -0
- package/dist/components/_internal/ErrorMessage.d.ts.map +1 -0
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/card/index.cjs +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/empty/index.cjs +1 -1
- package/dist/components/empty/index.js +1 -1
- package/dist/components/field/index.cjs +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/modal/index.cjs +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/number-input/index.cjs +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/radio/index.cjs +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/search-input/index.cjs +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/stat-card/index.cjs +1 -1
- package/dist/components/stat-card/index.js +1 -1
- package/dist/components/switch/index.cjs +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/table/index.cjs +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/tabs/index.cjs +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/textarea/index.cjs +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/dist/index.cjs +122 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +121 -122
- package/dist/index.js.map +1 -1
- package/dist/style.css +6 -0
- package/package.json +2 -1
- package/dist/LMButton-B258yfky.cjs.map +0 -1
- package/dist/LMButton-S4xQSohi.js.map +0 -1
- package/dist/LMCard-D7ABNC95.js.map +0 -1
- package/dist/LMCard-D_K051f2.cjs.map +0 -1
- package/dist/LMCheckbox-C2YvEQ8f.cjs.map +0 -1
- package/dist/LMCheckbox-DaaJRjKt.js.map +0 -1
- package/dist/LMDatePicker-BlUwN4On.cjs.map +0 -1
- package/dist/LMDatePicker-DSv28BFH.js.map +0 -1
- package/dist/LMEmpty-BedQxpbi.cjs.map +0 -1
- package/dist/LMEmpty-DzHM1fOb.js.map +0 -1
- package/dist/LMField-BS-DSEya.js.map +0 -1
- package/dist/LMField-DhDHj64z.cjs.map +0 -1
- package/dist/LMInput-CVjawj1F.cjs.map +0 -1
- package/dist/LMInput-D9csGyhj.js.map +0 -1
- package/dist/LMModal-BCVVPLot.cjs.map +0 -1
- package/dist/LMModal-DCJPlfA4.js.map +0 -1
- package/dist/LMNumberInput-B1tU7T_W.cjs.map +0 -1
- package/dist/LMNumberInput-BI5_OEx4.js.map +0 -1
- package/dist/LMRadio-CHn6nFSy.cjs.map +0 -1
- package/dist/LMRadio-UQLNgTMF.js.map +0 -1
- package/dist/LMSearchInput-CIvVkEf2.js.map +0 -1
- package/dist/LMSearchInput-nBlAX734.cjs.map +0 -1
- package/dist/LMSelect-B-MWX2JI.js.map +0 -1
- package/dist/LMSelect-ByQcUp2S.cjs.map +0 -1
- package/dist/LMStatCard-D5HV9r6d.js.map +0 -1
- package/dist/LMStatCard-MXs9Z0qH.cjs.map +0 -1
- package/dist/LMSwitch-CP1_nrfU.js.map +0 -1
- package/dist/LMSwitch-DYoSH6wE.cjs.map +0 -1
- package/dist/LMTable-Cp8HZqiV.js.map +0 -1
- package/dist/LMTable-j1ZzAzXB.cjs.map +0 -1
- package/dist/LMTextarea-5dVVPeL2.js.map +0 -1
- package/dist/LMTextarea-yG0OBZjA.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { L } from "./LMBadge-BBDOGTps.js";
|
|
2
|
-
import { L as L2 } from "./LMInput-
|
|
3
|
-
import { L as L3 } from "./LMTextarea-
|
|
4
|
-
import { L as L4 } from "./LMNumberInput-
|
|
5
|
-
import { L as L5 } from "./LMSearchInput-
|
|
6
|
-
import { L as L6 } from "./LMSelect-
|
|
7
|
-
import { L as L7 } from "./LMCheckbox-
|
|
8
|
-
import { L as L8 } from "./LMRadio-
|
|
9
|
-
import { L as L9 } from "./LMSwitch-
|
|
10
|
-
import { L as L10 } from "./LMField-
|
|
11
|
-
import { L as L11 } from "./LMDatePicker-
|
|
2
|
+
import { L as L2 } from "./LMInput-Be2KkPOW.js";
|
|
3
|
+
import { L as L3 } from "./LMTextarea-BNacTCNn.js";
|
|
4
|
+
import { L as L4 } from "./LMNumberInput-gnRvWRly.js";
|
|
5
|
+
import { L as L5 } from "./LMSearchInput-DQovqMTN.js";
|
|
6
|
+
import { L as L6 } from "./LMSelect-BPfW-AHI.js";
|
|
7
|
+
import { L as L7 } from "./LMCheckbox-DPg4CldM.js";
|
|
8
|
+
import { L as L8 } from "./LMRadio-C0ZL0hVK.js";
|
|
9
|
+
import { L as L9 } from "./LMSwitch-BqhucDO0.js";
|
|
10
|
+
import { L as L10 } from "./LMField-DkRk9Q8-.js";
|
|
11
|
+
import { L as L11 } from "./LMDatePicker-C7R0ByJ-.js";
|
|
12
12
|
import { L as L12 } from "./LMUpload-BwXoxIfE.js";
|
|
13
|
-
import { L as L13 } from "./LMStatCard-
|
|
13
|
+
import { L as L13 } from "./LMStatCard-CdyIDhrA.js";
|
|
14
14
|
import { L as L14 } from "./LMTooltip-h47oYhl8.js";
|
|
15
|
-
import { L as L15 } from "./LMCard-
|
|
16
|
-
import { L as L16 } from "./LMTabs-
|
|
17
|
-
import { L as L17 } from "./LMEmpty-
|
|
15
|
+
import { L as L15 } from "./LMCard-uuWNjVQL.js";
|
|
16
|
+
import { L as L16 } from "./LMTabs-Cjp3oiNv.js";
|
|
17
|
+
import { L as L17 } from "./LMEmpty-C499qRrR.js";
|
|
18
18
|
import { L as L18 } from "./LMMenu-yXadjQLQ.js";
|
|
19
19
|
import { L as L19 } from "./LMDropdown-wiTMuyhU.js";
|
|
20
20
|
import { L as L20 } from "./LMPagination-BypfLRlF.js";
|
|
21
21
|
import { L as L21, a, u } from "./useMessage-CRsCgzDR.js";
|
|
22
22
|
import { L as L22, u as u2 } from "./useConfirm-BIxTX3mT.js";
|
|
23
23
|
import { L as L23 } from "./LMDrawer-DJ5ugeZR.js";
|
|
24
|
-
import { L as L24 } from "./LMButton-
|
|
25
|
-
import { L as L25 } from "./LMTable-
|
|
26
|
-
import { L as L26 } from "./LMModal-
|
|
24
|
+
import { L as L24 } from "./LMButton-DH7s4i80.js";
|
|
25
|
+
import { L as L25 } from "./LMTable-IGmHFhnV.js";
|
|
26
|
+
import { L as L26 } from "./LMModal-CZF26Ask.js";
|
|
27
27
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
28
28
|
import React, { memo, useRef, useState, useEffect, useCallback, useMemo, forwardRef, useImperativeHandle } from "react";
|
|
29
29
|
import { c as clampComponentSize, b as SIZE_TEXT_CLASSES, C as COMPONENT_SIZE_ORDER, e as SIZE_PADDING_CLASSES } from "./componentSizes-CdWNL526.js";
|
|
30
30
|
import { k, l, f, i, S, a as a2, j, d, g, h } from "./componentSizes-CdWNL526.js";
|
|
31
|
+
import { c as cn } from "./cn-wDEkOmcn.js";
|
|
31
32
|
const chatInputThemeStyles = `
|
|
32
33
|
:root, [data-theme="light"] {
|
|
33
34
|
--lm-chat-input-bg: rgba(255, 255, 255, 0.85);
|
|
@@ -58,12 +59,12 @@ const ToolbarButton = ({
|
|
|
58
59
|
type: "button",
|
|
59
60
|
onClick,
|
|
60
61
|
disabled,
|
|
61
|
-
className:
|
|
62
|
-
flex items-center gap-1 px-2 py-1 rounded-md cursor-pointer
|
|
63
|
-
transition-all duration-150
|
|
64
|
-
disabled:opacity-40 disabled:cursor-not-allowed
|
|
65
|
-
hover:bg-(--lm-bg-hover) active:scale-95
|
|
66
|
-
|
|
62
|
+
className: cn(
|
|
63
|
+
"flex items-center gap-1 px-2 py-1 rounded-md cursor-pointer",
|
|
64
|
+
"transition-all duration-150",
|
|
65
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
66
|
+
"hover:bg-(--lm-bg-hover) active:scale-95"
|
|
67
|
+
),
|
|
67
68
|
style: {
|
|
68
69
|
backgroundColor: active ? "var(--lm-primary-50)" : "transparent",
|
|
69
70
|
color: active ? "var(--lm-primary-600)" : "var(--lm-text-tertiary)"
|
|
@@ -258,11 +259,11 @@ const LMChatInput = ({
|
|
|
258
259
|
/* @__PURE__ */ jsxs(
|
|
259
260
|
"div",
|
|
260
261
|
{
|
|
261
|
-
className:
|
|
262
|
-
relative flex flex-col border rounded-2xl
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
className: cn(
|
|
263
|
+
"relative flex flex-col border rounded-2xl",
|
|
264
|
+
config.padding,
|
|
265
|
+
className
|
|
266
|
+
),
|
|
266
267
|
style: getContainerStyles(),
|
|
267
268
|
children: [
|
|
268
269
|
/* @__PURE__ */ jsxs("div", { className: `flex items-start ${config.gap}`, children: [
|
|
@@ -279,13 +280,13 @@ const LMChatInput = ({
|
|
|
279
280
|
disabled: isDisabled,
|
|
280
281
|
autoFocus,
|
|
281
282
|
rows: 1,
|
|
282
|
-
className:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
283
|
+
className: cn(
|
|
284
|
+
"w-full resize-none bg-transparent leading-relaxed",
|
|
285
|
+
"outline-none focus:outline-none focus:ring-0 border-none",
|
|
286
|
+
SIZE_TEXT_CLASSES[resolvedSize],
|
|
287
|
+
"placeholder:text-(--lm-text-tertiary)",
|
|
288
|
+
"disabled:text-(--lm-text-disabled) disabled:cursor-not-allowed"
|
|
289
|
+
),
|
|
289
290
|
style: {
|
|
290
291
|
color: "var(--lm-text-primary)",
|
|
291
292
|
minHeight: config.minHeight,
|
|
@@ -319,14 +320,14 @@ const LMChatInput = ({
|
|
|
319
320
|
type: "button",
|
|
320
321
|
onClick: showStopButton ? handleStop : handleSend,
|
|
321
322
|
disabled: !showStopButton && !canSend,
|
|
322
|
-
className:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
323
|
+
className: cn(
|
|
324
|
+
config.sendButtonSize,
|
|
325
|
+
"flex items-center justify-center shrink-0",
|
|
326
|
+
"cursor-pointer select-none",
|
|
327
|
+
"focus:outline-none",
|
|
328
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
329
|
+
"hover:scale-105 active:scale-95"
|
|
330
|
+
),
|
|
330
331
|
style: getSendButtonStyles(),
|
|
331
332
|
"aria-label": showStopButton ? "停止生成" : "发送消息",
|
|
332
333
|
children: sending ? /* @__PURE__ */ jsx(LoadingIcon, { className: config.sendIconSize }) : showStopButton ? /* @__PURE__ */ jsx(StopIcon, { className: config.sendIconSize }) : sendButtonText ? /* @__PURE__ */ jsx("span", { className: `${SIZE_TEXT_CLASSES[resolvedSize]} font-medium`, children: sendButtonText }) : /* @__PURE__ */ jsx(SendIcon, { className: config.sendIconSize })
|
|
@@ -371,11 +372,11 @@ const chatBubbleThemeStyles = `
|
|
|
371
372
|
const BUBBLE_CONFIG = {
|
|
372
373
|
user: {
|
|
373
374
|
align: "right",
|
|
374
|
-
borderRadius: "20px
|
|
375
|
+
borderRadius: "20px 4px 20px 20px"
|
|
375
376
|
},
|
|
376
377
|
assistant: {
|
|
377
378
|
align: "left",
|
|
378
|
-
borderRadius: "20px 20px 20px
|
|
379
|
+
borderRadius: "4px 20px 20px 20px"
|
|
379
380
|
},
|
|
380
381
|
system: {
|
|
381
382
|
align: "left",
|
|
@@ -502,12 +503,12 @@ const LMChatBubble = ({
|
|
|
502
503
|
/* @__PURE__ */ jsxs(
|
|
503
504
|
"div",
|
|
504
505
|
{
|
|
505
|
-
className:
|
|
506
|
-
w-full
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
506
|
+
className: cn(
|
|
507
|
+
"w-full",
|
|
508
|
+
SIZE_PADDING_CLASSES[resolvedSize],
|
|
509
|
+
SIZE_TEXT_CLASSES[resolvedSize],
|
|
510
|
+
className
|
|
511
|
+
),
|
|
511
512
|
style: {
|
|
512
513
|
...getBubbleStyles(),
|
|
513
514
|
...style
|
|
@@ -654,11 +655,11 @@ const LMChatMessage = ({
|
|
|
654
655
|
const finalActions = actions || defaultActions;
|
|
655
656
|
const renderAvatar = () => {
|
|
656
657
|
if (hideAvatar) return null;
|
|
657
|
-
const avatarClasses =
|
|
658
|
-
|
|
659
|
-
rounded-full overflow-hidden shrink-0
|
|
660
|
-
flex items-center justify-center
|
|
661
|
-
|
|
658
|
+
const avatarClasses = cn(
|
|
659
|
+
AVATAR_SIZE$1[resolvedSize],
|
|
660
|
+
"rounded-full overflow-hidden shrink-0",
|
|
661
|
+
"flex items-center justify-center"
|
|
662
|
+
);
|
|
662
663
|
if (typeof avatar === "string") {
|
|
663
664
|
return /* @__PURE__ */ jsx(
|
|
664
665
|
"img",
|
|
@@ -684,25 +685,25 @@ const LMChatMessage = ({
|
|
|
684
685
|
return /* @__PURE__ */ jsx(
|
|
685
686
|
"div",
|
|
686
687
|
{
|
|
687
|
-
className:
|
|
688
|
-
flex items-center gap-1 mt-1
|
|
689
|
-
transition-opacity duration-150
|
|
690
|
-
|
|
691
|
-
|
|
688
|
+
className: cn(
|
|
689
|
+
"flex items-center gap-1 mt-1",
|
|
690
|
+
"transition-opacity duration-150",
|
|
691
|
+
isHovered ? "opacity-100" : "opacity-0"
|
|
692
|
+
),
|
|
692
693
|
children: finalActions.map((action) => /* @__PURE__ */ jsx(
|
|
693
694
|
"button",
|
|
694
695
|
{
|
|
695
696
|
onClick: action.onClick,
|
|
696
697
|
disabled: action.disabled,
|
|
697
|
-
className:
|
|
698
|
-
|
|
699
|
-
flex items-center justify-center
|
|
700
|
-
rounded-lg cursor-pointer
|
|
701
|
-
hover:bg-(--lm-bg-hover)
|
|
702
|
-
active:scale-95
|
|
703
|
-
disabled:opacity-50 disabled:cursor-not-allowed
|
|
704
|
-
transition-all duration-150
|
|
705
|
-
|
|
698
|
+
className: cn(
|
|
699
|
+
ACTION_BUTTON_SIZE[resolvedSize],
|
|
700
|
+
"flex items-center justify-center",
|
|
701
|
+
"rounded-lg cursor-pointer",
|
|
702
|
+
"hover:bg-(--lm-bg-hover)",
|
|
703
|
+
"active:scale-95",
|
|
704
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
705
|
+
"transition-all duration-150"
|
|
706
|
+
),
|
|
706
707
|
style: { color: "var(--lm-text-tertiary)" },
|
|
707
708
|
title: action.tooltip,
|
|
708
709
|
"aria-label": action.tooltip,
|
|
@@ -765,11 +766,11 @@ const LMChatMessage = ({
|
|
|
765
766
|
"div",
|
|
766
767
|
{
|
|
767
768
|
id,
|
|
768
|
-
className:
|
|
769
|
-
flex gap-3
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
769
|
+
className: cn(
|
|
770
|
+
"flex gap-3",
|
|
771
|
+
isUser ? "flex-row-reverse" : "flex-row",
|
|
772
|
+
className
|
|
773
|
+
),
|
|
773
774
|
onMouseEnter: () => setIsHovered(true),
|
|
774
775
|
onMouseLeave: () => setIsHovered(false),
|
|
775
776
|
children: [
|
|
@@ -777,10 +778,10 @@ const LMChatMessage = ({
|
|
|
777
778
|
/* @__PURE__ */ jsxs(
|
|
778
779
|
"div",
|
|
779
780
|
{
|
|
780
|
-
className:
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
781
|
+
className: cn(
|
|
782
|
+
"flex flex-col min-w-0",
|
|
783
|
+
isUser ? "items-end" : "items-start"
|
|
784
|
+
),
|
|
784
785
|
style: {
|
|
785
786
|
maxWidth: typeof bubbleMaxWidth === "number" ? `${bubbleMaxWidth}px` : bubbleMaxWidth,
|
|
786
787
|
width: typeof bubbleMaxWidth === "number" ? `${bubbleMaxWidth}px` : bubbleMaxWidth
|
|
@@ -789,10 +790,10 @@ const LMChatMessage = ({
|
|
|
789
790
|
(name || timestamp) && /* @__PURE__ */ jsxs(
|
|
790
791
|
"div",
|
|
791
792
|
{
|
|
792
|
-
className:
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
793
|
+
className: cn(
|
|
794
|
+
"flex items-center gap-2 mb-1",
|
|
795
|
+
isUser ? "flex-row-reverse" : "flex-row"
|
|
796
|
+
),
|
|
796
797
|
children: [
|
|
797
798
|
name && /* @__PURE__ */ jsx(
|
|
798
799
|
"span",
|
|
@@ -1345,11 +1346,11 @@ const LMMarkdownRenderer = ({
|
|
|
1345
1346
|
return /* @__PURE__ */ jsx(
|
|
1346
1347
|
HeadingTag,
|
|
1347
1348
|
{
|
|
1348
|
-
className:
|
|
1349
|
-
|
|
1350
|
-
font-semibold leading-tight tracking-tight
|
|
1351
|
-
mt-6 mb-3 first:mt-0
|
|
1352
|
-
|
|
1349
|
+
className: cn(
|
|
1350
|
+
headingSizeClass,
|
|
1351
|
+
"font-semibold leading-tight tracking-tight",
|
|
1352
|
+
"mt-6 mb-3 first:mt-0"
|
|
1353
|
+
),
|
|
1353
1354
|
style: { color: "var(--lm-text-primary)" },
|
|
1354
1355
|
children: parseInlineStyles(token.content, onLinkClick, openLinksInNewTab)
|
|
1355
1356
|
},
|
|
@@ -1360,10 +1361,10 @@ const LMMarkdownRenderer = ({
|
|
|
1360
1361
|
return /* @__PURE__ */ jsx(
|
|
1361
1362
|
"p",
|
|
1362
1363
|
{
|
|
1363
|
-
className:
|
|
1364
|
-
|
|
1365
|
-
leading-relaxed my-3 first:mt-0 last:mb-0
|
|
1366
|
-
|
|
1364
|
+
className: cn(
|
|
1365
|
+
sizeConfig.base,
|
|
1366
|
+
"leading-relaxed my-3 first:mt-0 last:mb-0"
|
|
1367
|
+
),
|
|
1367
1368
|
style: { color: "var(--lm-text-primary)" },
|
|
1368
1369
|
children: parseInlineStyles(token.content, onLinkClick, openLinksInNewTab)
|
|
1369
1370
|
},
|
|
@@ -1400,11 +1401,11 @@ const LMMarkdownRenderer = ({
|
|
|
1400
1401
|
return /* @__PURE__ */ jsx(
|
|
1401
1402
|
ListTag,
|
|
1402
1403
|
{
|
|
1403
|
-
className:
|
|
1404
|
-
|
|
1405
|
-
my-3 pl-6
|
|
1406
|
-
|
|
1407
|
-
|
|
1404
|
+
className: cn(
|
|
1405
|
+
sizeConfig.base,
|
|
1406
|
+
"my-3 pl-6",
|
|
1407
|
+
token.ordered ? "list-decimal" : "list-disc"
|
|
1408
|
+
),
|
|
1408
1409
|
style: { color: "var(--lm-text-primary)" },
|
|
1409
1410
|
children: (_a = token.items) == null ? void 0 : _a.map((item, i2) => /* @__PURE__ */ jsx("li", { className: "my-1", children: parseInlineStyles(item, onLinkClick, openLinksInNewTab) }, i2))
|
|
1410
1411
|
},
|
|
@@ -1459,7 +1460,7 @@ const LMMarkdownRenderer = ({
|
|
|
1459
1460
|
return null;
|
|
1460
1461
|
}
|
|
1461
1462
|
};
|
|
1462
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
1463
|
+
return /* @__PURE__ */ jsx("div", { className: cn(sizeConfig.base, className), children: tokens.map((token, index) => renderToken(token, index)) });
|
|
1463
1464
|
};
|
|
1464
1465
|
const LMMarkdownRenderer_default = memo(LMMarkdownRenderer);
|
|
1465
1466
|
const typingIndicatorThemeStyles = `
|
|
@@ -1575,20 +1576,21 @@ const LMTypingIndicator = ({
|
|
|
1575
1576
|
/* @__PURE__ */ jsxs(
|
|
1576
1577
|
"div",
|
|
1577
1578
|
{
|
|
1578
|
-
className:
|
|
1579
|
-
flex items-center
|
|
1580
|
-
|
|
1581
|
-
|
|
1579
|
+
className: cn(
|
|
1580
|
+
"flex items-center",
|
|
1581
|
+
config.avatarGap,
|
|
1582
|
+
className
|
|
1583
|
+
),
|
|
1582
1584
|
"data-typing-indicator": true,
|
|
1583
1585
|
children: [
|
|
1584
1586
|
avatar && /* @__PURE__ */ jsx(
|
|
1585
1587
|
"div",
|
|
1586
1588
|
{
|
|
1587
|
-
className:
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1589
|
+
className: cn(
|
|
1590
|
+
AVATAR_SIZE[resolvedSize],
|
|
1591
|
+
"rounded-full overflow-hidden shrink-0",
|
|
1592
|
+
"flex items-center justify-center"
|
|
1593
|
+
),
|
|
1592
1594
|
style: {
|
|
1593
1595
|
background: "var(--lm-typing-avatar-bg)",
|
|
1594
1596
|
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.06)"
|
|
@@ -1599,10 +1601,10 @@ const LMTypingIndicator = ({
|
|
|
1599
1601
|
/* @__PURE__ */ jsxs(
|
|
1600
1602
|
"div",
|
|
1601
1603
|
{
|
|
1602
|
-
className:
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1604
|
+
className: cn(
|
|
1605
|
+
"inline-flex items-center",
|
|
1606
|
+
config.padding
|
|
1607
|
+
),
|
|
1606
1608
|
style: {
|
|
1607
1609
|
backgroundColor: "var(--lm-typing-bg)",
|
|
1608
1610
|
backdropFilter: "blur(20px) saturate(180%)",
|
|
@@ -1615,10 +1617,10 @@ const LMTypingIndicator = ({
|
|
|
1615
1617
|
/* @__PURE__ */ jsx("div", { className: `flex items-center ${config.gap}`, children: [0, 1, 2].map((i2) => /* @__PURE__ */ jsx(
|
|
1616
1618
|
"span",
|
|
1617
1619
|
{
|
|
1618
|
-
className:
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1620
|
+
className: cn(
|
|
1621
|
+
config.dotSize,
|
|
1622
|
+
"rounded-full"
|
|
1623
|
+
),
|
|
1622
1624
|
style: {
|
|
1623
1625
|
backgroundColor: color || "var(--lm-primary-500)",
|
|
1624
1626
|
...getDotAnimation(i2)
|
|
@@ -1945,10 +1947,10 @@ const LMChatContainer = forwardRef(({
|
|
|
1945
1947
|
return /* @__PURE__ */ jsxs(
|
|
1946
1948
|
"div",
|
|
1947
1949
|
{
|
|
1948
|
-
className:
|
|
1949
|
-
flex flex-col border rounded-2xl overflow-hidden
|
|
1950
|
-
|
|
1951
|
-
|
|
1950
|
+
className: cn(
|
|
1951
|
+
"flex flex-col border rounded-2xl overflow-hidden",
|
|
1952
|
+
className
|
|
1953
|
+
),
|
|
1952
1954
|
style: getContainerStyles(),
|
|
1953
1955
|
children: [
|
|
1954
1956
|
header && /* @__PURE__ */ jsx(
|
|
@@ -2026,9 +2028,6 @@ const LMChatContainer = forwardRef(({
|
|
|
2026
2028
|
});
|
|
2027
2029
|
LMChatContainer.displayName = "LMChatContainer";
|
|
2028
2030
|
const LMChatContainer_default = memo(LMChatContainer);
|
|
2029
|
-
function cn(...inputs) {
|
|
2030
|
-
return inputs.flat().filter((x) => typeof x === "string" && x.length > 0).join(" ");
|
|
2031
|
-
}
|
|
2032
2031
|
export {
|
|
2033
2032
|
COMPONENT_SIZE_ORDER,
|
|
2034
2033
|
L as LMBadge,
|