@wallarm-org/design-system 3.2.0 → 3.3.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.
- package/dist/components/AnimatedBackground/blur/BlurBackground.d.ts +6 -0
- package/dist/components/AnimatedBackground/blur/BlurBackground.js +176 -76
- package/dist/components/AnimatedBackground/blur/index.d.ts +1 -1
- package/dist/components/AnimatedBackground/index.d.ts +1 -1
- package/dist/components/ApprovalCard/ApprovalCard.d.ts +13 -0
- package/dist/components/ApprovalCard/ApprovalCard.js +249 -0
- package/dist/components/ApprovalCard/ApprovalCardActions.d.ts +6 -0
- package/dist/components/ApprovalCard/ApprovalCardActions.js +50 -0
- package/dist/components/ApprovalCard/ApprovalCardContent.d.ts +6 -0
- package/dist/components/ApprovalCard/ApprovalCardContent.js +50 -0
- package/dist/components/ApprovalCard/classes.d.ts +10 -0
- package/dist/components/ApprovalCard/classes.js +26 -0
- package/dist/components/ApprovalCard/index.d.ts +3 -0
- package/dist/components/ApprovalCard/index.js +3 -0
- package/dist/components/AssistantMessage/AssistantMessage.d.ts +12 -0
- package/dist/components/AssistantMessage/AssistantMessage.js +66 -0
- package/dist/components/AssistantMessage/AssistantMessageContent.d.ts +10 -0
- package/dist/components/AssistantMessage/AssistantMessageContent.js +50 -0
- package/dist/components/AssistantMessage/AssistantMessageError.d.ts +13 -0
- package/dist/components/AssistantMessage/AssistantMessageError.js +93 -0
- package/dist/components/AssistantMessage/AssistantMessageLoader.d.ts +13 -0
- package/dist/components/AssistantMessage/AssistantMessageLoader.js +88 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdown.d.ts +71 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdown.js +278 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownCodeBlock.d.ts +17 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownCodeBlock.js +94 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownInlineCode.d.ts +10 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownInlineCode.js +59 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownLink.d.ts +14 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownLink.js +65 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownTable.d.ts +7 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownTable.js +70 -0
- package/dist/components/AssistantMessage/classes.d.ts +38 -0
- package/dist/components/AssistantMessage/classes.js +46 -0
- package/dist/components/AssistantMessage/index.d.ts +9 -0
- package/dist/components/AssistantMessage/index.js +9 -0
- package/dist/components/AssistantMessage/lib/markdown.d.ts +20 -0
- package/dist/components/AssistantMessage/lib/markdown.js +51 -0
- package/dist/components/ChainOfThought/ChainOfThought.d.ts +10 -0
- package/dist/components/ChainOfThought/ChainOfThought.js +66 -0
- package/dist/components/ChainOfThought/ChainOfThoughtStep.d.ts +31 -0
- package/dist/components/ChainOfThought/ChainOfThoughtStep.js +312 -0
- package/dist/components/ChainOfThought/classes.d.ts +20 -0
- package/dist/components/ChainOfThought/classes.js +84 -0
- package/dist/components/ChainOfThought/index.d.ts +2 -0
- package/dist/components/ChainOfThought/index.js +2 -0
- package/dist/components/Chat/Chat.d.ts +12 -0
- package/dist/components/Chat/Chat.js +90 -0
- package/dist/components/Chat/ChatBody.d.ts +12 -0
- package/dist/components/Chat/ChatBody.js +52 -0
- package/dist/components/Chat/ChatFooter.d.ts +7 -0
- package/dist/components/Chat/ChatFooter.js +50 -0
- package/dist/components/Chat/ChatGreeting.d.ts +8 -0
- package/dist/components/Chat/ChatGreeting.js +94 -0
- package/dist/components/Chat/ChatHeader.d.ts +6 -0
- package/dist/components/Chat/ChatHeader.js +50 -0
- package/dist/components/Chat/ChatHeaderActions.d.ts +7 -0
- package/dist/components/Chat/ChatHeaderActions.js +50 -0
- package/dist/components/Chat/ChatHeaderTitle.d.ts +12 -0
- package/dist/components/Chat/ChatHeaderTitle.js +99 -0
- package/dist/components/Chat/ChatSuggestion.d.ts +7 -0
- package/dist/components/Chat/ChatSuggestion.js +56 -0
- package/dist/components/Chat/ChatSuggestions.d.ts +14 -0
- package/dist/components/Chat/ChatSuggestions.js +111 -0
- package/dist/components/Chat/ChatSuggestionsContext.d.ts +7 -0
- package/dist/components/Chat/ChatSuggestionsContext.js +7 -0
- package/dist/components/Chat/ChatTrigger.d.ts +13 -0
- package/dist/components/Chat/ChatTrigger.js +101 -0
- package/dist/components/Chat/classes.d.ts +17 -0
- package/dist/components/Chat/classes.js +44 -0
- package/dist/components/Chat/index.d.ts +10 -0
- package/dist/components/Chat/index.js +10 -0
- package/dist/components/ChatInput/ChatInput.d.ts +30 -0
- package/dist/components/ChatInput/ChatInput.js +230 -0
- package/dist/components/ChatInput/ChatInputContext.d.ts +11 -0
- package/dist/components/ChatInput/ChatInputContext.js +8 -0
- package/dist/components/ChatInput/ChatInputSubmit.d.ts +10 -0
- package/dist/components/ChatInput/ChatInputSubmit.js +175 -0
- package/dist/components/ChatInput/ChatInputTextarea.d.ts +6 -0
- package/dist/components/ChatInput/ChatInputTextarea.js +155 -0
- package/dist/components/ChatInput/classes.d.ts +9 -0
- package/dist/components/ChatInput/classes.js +22 -0
- package/dist/components/ChatInput/index.d.ts +3 -0
- package/dist/components/ChatInput/index.js +3 -0
- package/dist/components/ChatPermissions/ChatPermissions.d.ts +12 -0
- package/dist/components/ChatPermissions/ChatPermissions.js +66 -0
- package/dist/components/ChatPermissions/ChatPermissionsContent.d.ts +7 -0
- package/dist/components/ChatPermissions/ChatPermissionsContent.js +73 -0
- package/dist/components/ChatPermissions/ChatPermissionsContext.d.ts +7 -0
- package/dist/components/ChatPermissions/ChatPermissionsContext.js +8 -0
- package/dist/components/ChatPermissions/ChatPermissionsItem.d.ts +17 -0
- package/dist/components/ChatPermissions/ChatPermissionsItem.js +115 -0
- package/dist/components/ChatPermissions/ChatPermissionsTrigger.d.ts +6 -0
- package/dist/components/ChatPermissions/ChatPermissionsTrigger.js +110 -0
- package/dist/components/ChatPermissions/classes.d.ts +3 -0
- package/dist/components/ChatPermissions/classes.js +5 -0
- package/dist/components/ChatPermissions/index.d.ts +4 -0
- package/dist/components/ChatPermissions/index.js +4 -0
- package/dist/components/Conversation/Conversation.d.ts +19 -0
- package/dist/components/Conversation/Conversation.js +102 -0
- package/dist/components/Conversation/ConversationContent.d.ts +11 -0
- package/dist/components/Conversation/ConversationContent.js +103 -0
- package/dist/components/Conversation/ConversationContext.d.ts +14 -0
- package/dist/components/Conversation/ConversationContext.js +8 -0
- package/dist/components/Conversation/ConversationEmptyState.d.ts +15 -0
- package/dist/components/Conversation/ConversationEmptyState.js +70 -0
- package/dist/components/Conversation/ConversationScrollButton.d.ts +13 -0
- package/dist/components/Conversation/ConversationScrollButton.js +138 -0
- package/dist/components/Conversation/classes.d.ts +13 -0
- package/dist/components/Conversation/classes.js +8 -0
- package/dist/components/Conversation/index.d.ts +4 -0
- package/dist/components/Conversation/index.js +4 -0
- package/dist/components/Conversation/useStickToBottom.d.ts +9 -0
- package/dist/components/Conversation/useStickToBottom.js +203 -0
- package/dist/components/MessageActions/MessageAction.d.ts +18 -0
- package/dist/components/MessageActions/MessageAction.js +109 -0
- package/dist/components/MessageActions/MessageActions.d.ts +12 -0
- package/dist/components/MessageActions/MessageActions.js +74 -0
- package/dist/components/MessageActions/MessageTimestamp.d.ts +7 -0
- package/dist/components/MessageActions/MessageTimestamp.js +50 -0
- package/dist/components/MessageActions/classes.d.ts +5 -0
- package/dist/components/MessageActions/classes.js +15 -0
- package/dist/components/MessageActions/index.d.ts +3 -0
- package/dist/components/MessageActions/index.js +3 -0
- package/dist/components/Popover/PopoverContent.d.ts +2 -1
- package/dist/components/Popover/PopoverContent.js +42 -39
- package/dist/components/UserMessage/UserMessage.d.ts +10 -0
- package/dist/components/UserMessage/UserMessage.js +66 -0
- package/dist/components/UserMessage/UserMessageBubble.d.ts +16 -0
- package/dist/components/UserMessage/UserMessageBubble.js +175 -0
- package/dist/components/UserMessage/UserMessageContext.d.ts +9 -0
- package/dist/components/UserMessage/UserMessageContext.js +4 -0
- package/dist/components/UserMessage/UserMessageShowMore.d.ts +15 -0
- package/dist/components/UserMessage/UserMessageShowMore.js +87 -0
- package/dist/components/UserMessage/classes.d.ts +11 -0
- package/dist/components/UserMessage/classes.js +32 -0
- package/dist/components/UserMessage/index.d.ts +3 -0
- package/dist/components/UserMessage/index.js +3 -0
- package/dist/components/WallyAssistant/WallyAssistant.d.ts +56 -0
- package/dist/components/WallyAssistant/WallyAssistant.js +541 -0
- package/dist/components/WallyAssistant/index.d.ts +10 -0
- package/dist/components/WallyAssistant/index.js +8 -0
- package/dist/components/WallyAssistant/model/deriveChatState.d.ts +33 -0
- package/dist/components/WallyAssistant/model/deriveChatState.js +54 -0
- package/dist/components/WallyAssistant/model/labels.d.ts +43 -0
- package/dist/components/WallyAssistant/model/labels.js +33 -0
- package/dist/components/WallyAssistant/model/model.d.ts +184 -0
- package/dist/components/WallyAssistant/model/model.js +0 -0
- package/dist/components/WallyAssistant/views/ApprovalCardView.d.ts +20 -0
- package/dist/components/WallyAssistant/views/ApprovalCardView.js +274 -0
- package/dist/components/WallyAssistant/views/ChainOfThoughtView.d.ts +18 -0
- package/dist/components/WallyAssistant/views/ChainOfThoughtView.js +301 -0
- package/dist/components/WallyAssistant/views/ChatMessageView.d.ts +15 -0
- package/dist/components/WallyAssistant/views/ChatMessageView.js +372 -0
- package/dist/components/WallyAssistant/views/ChatPartView.d.ts +16 -0
- package/dist/components/WallyAssistant/views/ChatPartView.js +171 -0
- package/dist/components/WallyAssistant/views/ChatViewContext.d.ts +98 -0
- package/dist/components/WallyAssistant/views/ChatViewContext.js +44 -0
- package/dist/components/WallyAssistant/views/ChatViewProvider.d.ts +18 -0
- package/dist/components/WallyAssistant/views/ChatViewProvider.js +96 -0
- package/dist/components/WallyAssistant/views/stepIcons.d.ts +8 -0
- package/dist/components/WallyAssistant/views/stepIcons.js +47 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/metadata/components.json +30786 -15960
- package/dist/theme/components/animated-background.css +6 -1
- package/dist/theme/index.css +1 -0
- package/dist/theme/utilities/shimmer-text.css +27 -0
- package/package.json +3 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
export type BlurBackgroundPalette = 'default' | 'chat';
|
|
2
3
|
export interface BlurBackgroundProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
ref?: Ref<HTMLDivElement>;
|
|
4
5
|
children?: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Blob colours and layout. `'chat'` is the Wally chat panel mesh (Figma chat-bg 67:1254),
|
|
8
|
+
* tuned for a ~480px-wide panel and meant to be dimmed by the host (5–12% opacity).
|
|
9
|
+
*/
|
|
10
|
+
palette?: BlurBackgroundPalette;
|
|
5
11
|
}
|
|
6
12
|
export declare const BlurBackground: FC<BlurBackgroundProps>;
|
|
@@ -75,134 +75,234 @@ const BLOBS = [
|
|
|
75
75
|
base: 43
|
|
76
76
|
}
|
|
77
77
|
];
|
|
78
|
+
const CHAT_BLOBS = [
|
|
79
|
+
{
|
|
80
|
+
name: "b1-lavender-top",
|
|
81
|
+
style: {
|
|
82
|
+
width: "70%",
|
|
83
|
+
height: "45%",
|
|
84
|
+
left: "15%",
|
|
85
|
+
top: "-15%"
|
|
86
|
+
},
|
|
87
|
+
background: "#d4d2dc",
|
|
88
|
+
anim: "lg-f1",
|
|
89
|
+
base: 37
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "b2-cream-right",
|
|
93
|
+
style: {
|
|
94
|
+
width: "55%",
|
|
95
|
+
height: "65%",
|
|
96
|
+
left: "55%",
|
|
97
|
+
top: "25%"
|
|
98
|
+
},
|
|
99
|
+
background: "#f5d8a0",
|
|
100
|
+
anim: "lg-f2",
|
|
101
|
+
base: 29
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "b3-peach-mid",
|
|
105
|
+
style: {
|
|
106
|
+
width: "75%",
|
|
107
|
+
height: "40%",
|
|
108
|
+
left: "-5%",
|
|
109
|
+
top: "35%"
|
|
110
|
+
},
|
|
111
|
+
background: "#f0cdb8",
|
|
112
|
+
anim: "lg-f6",
|
|
113
|
+
base: 43
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "b4-orange-outer",
|
|
117
|
+
style: {
|
|
118
|
+
width: "55%",
|
|
119
|
+
height: "40%",
|
|
120
|
+
left: "15%",
|
|
121
|
+
top: "55%"
|
|
122
|
+
},
|
|
123
|
+
background: "#ff8a3a",
|
|
124
|
+
anim: "lg-f4",
|
|
125
|
+
base: 31
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "b6-cream-br",
|
|
129
|
+
style: {
|
|
130
|
+
width: "50%",
|
|
131
|
+
height: "35%",
|
|
132
|
+
left: "55%",
|
|
133
|
+
top: "65%"
|
|
134
|
+
},
|
|
135
|
+
background: "#f8e0b0",
|
|
136
|
+
anim: "lg-f5",
|
|
137
|
+
base: 41
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "b5-orange-core",
|
|
141
|
+
style: {
|
|
142
|
+
width: "35%",
|
|
143
|
+
height: "22%",
|
|
144
|
+
left: "28%",
|
|
145
|
+
top: "73%"
|
|
146
|
+
},
|
|
147
|
+
background: "#ff5a08",
|
|
148
|
+
anim: "lg-f3",
|
|
149
|
+
base: 23
|
|
150
|
+
}
|
|
151
|
+
];
|
|
78
152
|
const BLUR = 90;
|
|
79
153
|
const SPEED = 2;
|
|
154
|
+
const CHAT_SPEED = 21.5;
|
|
80
155
|
const BlurBackground = (t0)=>{
|
|
81
|
-
const $ = c(
|
|
156
|
+
const $ = c(38);
|
|
82
157
|
let children;
|
|
83
158
|
let className;
|
|
84
159
|
let ref;
|
|
85
160
|
let rest;
|
|
86
161
|
let style;
|
|
162
|
+
let t1;
|
|
87
163
|
if ($[0] !== t0) {
|
|
88
|
-
({ ref, className, style, children, ...rest } = t0);
|
|
164
|
+
({ ref, className, style, children, palette: t1, ...rest } = t0);
|
|
89
165
|
$[0] = t0;
|
|
90
166
|
$[1] = children;
|
|
91
167
|
$[2] = className;
|
|
92
168
|
$[3] = ref;
|
|
93
169
|
$[4] = rest;
|
|
94
170
|
$[5] = style;
|
|
171
|
+
$[6] = t1;
|
|
95
172
|
} else {
|
|
96
173
|
children = $[1];
|
|
97
174
|
className = $[2];
|
|
98
175
|
ref = $[3];
|
|
99
176
|
rest = $[4];
|
|
100
177
|
style = $[5];
|
|
178
|
+
t1 = $[6];
|
|
101
179
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
};
|
|
107
|
-
$[6] = t1;
|
|
108
|
-
} else t1 = $[6];
|
|
180
|
+
const palette = void 0 === t1 ? "default" : t1;
|
|
181
|
+
const blobs = "chat" === palette ? CHAT_BLOBS : BLOBS;
|
|
182
|
+
const speed = "chat" === palette ? CHAT_SPEED : SPEED;
|
|
183
|
+
const paletteAttr = "default" === palette ? void 0 : palette;
|
|
109
184
|
let t2;
|
|
110
185
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
-
t2 =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
children: BLOBS.map(_temp)
|
|
115
|
-
});
|
|
186
|
+
t2 = {
|
|
187
|
+
"--lg-blur": BLUR
|
|
188
|
+
};
|
|
116
189
|
$[7] = t2;
|
|
117
190
|
} else t2 = $[7];
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
let t3;
|
|
121
|
-
if ($[8] !== className) {
|
|
122
|
-
t3 = cn("lg-frame", className);
|
|
123
|
-
$[8] = className;
|
|
124
|
-
$[9] = t3;
|
|
125
|
-
} else t3 = $[9];
|
|
191
|
+
let t3;
|
|
192
|
+
if ($[8] !== blobs || $[9] !== speed) {
|
|
126
193
|
let t4;
|
|
127
|
-
if ($[
|
|
128
|
-
t4 =
|
|
194
|
+
if ($[11] !== speed) {
|
|
195
|
+
t4 = (b)=>/*#__PURE__*/ jsx("div", {
|
|
196
|
+
className: "lg-blob",
|
|
197
|
+
style: {
|
|
198
|
+
...b.style,
|
|
199
|
+
background: b.background,
|
|
200
|
+
animationName: b.anim,
|
|
201
|
+
animationDuration: `${b.base / speed}s`,
|
|
202
|
+
animationTimingFunction: "ease-in-out",
|
|
203
|
+
animationIterationCount: "infinite"
|
|
204
|
+
}
|
|
205
|
+
}, b.name);
|
|
206
|
+
$[11] = speed;
|
|
207
|
+
$[12] = t4;
|
|
208
|
+
} else t4 = $[12];
|
|
209
|
+
t3 = blobs.map(t4);
|
|
210
|
+
$[8] = blobs;
|
|
211
|
+
$[9] = speed;
|
|
212
|
+
$[10] = t3;
|
|
213
|
+
} else t3 = $[10];
|
|
214
|
+
let t4;
|
|
215
|
+
if ($[13] !== t3) {
|
|
216
|
+
t4 = /*#__PURE__*/ jsx("div", {
|
|
217
|
+
className: "lg-mesh",
|
|
218
|
+
style: t2,
|
|
219
|
+
children: t3
|
|
220
|
+
});
|
|
221
|
+
$[13] = t3;
|
|
222
|
+
$[14] = t4;
|
|
223
|
+
} else t4 = $[14];
|
|
224
|
+
const meshContent = t4;
|
|
225
|
+
if (null == children) {
|
|
226
|
+
let t5;
|
|
227
|
+
if ($[15] !== className) {
|
|
228
|
+
t5 = cn("lg-frame", className);
|
|
229
|
+
$[15] = className;
|
|
230
|
+
$[16] = t5;
|
|
231
|
+
} else t5 = $[16];
|
|
232
|
+
let t6;
|
|
233
|
+
if ($[17] !== meshContent || $[18] !== paletteAttr || $[19] !== ref || $[20] !== rest || $[21] !== style || $[22] !== t5) {
|
|
234
|
+
t6 = /*#__PURE__*/ jsx("div", {
|
|
129
235
|
"data-slot": "blur-background",
|
|
236
|
+
"data-palette": paletteAttr,
|
|
130
237
|
...rest,
|
|
131
238
|
ref: ref,
|
|
132
|
-
className:
|
|
239
|
+
className: t5,
|
|
133
240
|
style: style,
|
|
134
241
|
"aria-hidden": "true",
|
|
135
242
|
children: meshContent
|
|
136
243
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
|
|
143
|
-
|
|
244
|
+
$[17] = meshContent;
|
|
245
|
+
$[18] = paletteAttr;
|
|
246
|
+
$[19] = ref;
|
|
247
|
+
$[20] = rest;
|
|
248
|
+
$[21] = style;
|
|
249
|
+
$[22] = t5;
|
|
250
|
+
$[23] = t6;
|
|
251
|
+
} else t6 = $[23];
|
|
252
|
+
return t6;
|
|
144
253
|
}
|
|
145
|
-
let
|
|
146
|
-
if ($[
|
|
147
|
-
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
} else
|
|
151
|
-
let
|
|
152
|
-
if ($[
|
|
153
|
-
|
|
254
|
+
let t5;
|
|
255
|
+
if ($[24] !== className) {
|
|
256
|
+
t5 = cn("lg-frame relative", className);
|
|
257
|
+
$[24] = className;
|
|
258
|
+
$[25] = t5;
|
|
259
|
+
} else t5 = $[25];
|
|
260
|
+
let t6;
|
|
261
|
+
if ($[26] !== meshContent) {
|
|
262
|
+
t6 = /*#__PURE__*/ jsx("div", {
|
|
154
263
|
"aria-hidden": "true",
|
|
155
264
|
className: "absolute inset-0 pointer-events-none",
|
|
156
265
|
children: meshContent
|
|
157
266
|
});
|
|
158
|
-
$[
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
267
|
+
$[26] = meshContent;
|
|
268
|
+
$[27] = t6;
|
|
269
|
+
} else t6 = $[27];
|
|
270
|
+
let t7;
|
|
271
|
+
if ($[28] !== children) {
|
|
272
|
+
t7 = /*#__PURE__*/ jsx("div", {
|
|
163
273
|
className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
|
|
164
274
|
children: /*#__PURE__*/ jsx("div", {
|
|
165
275
|
className: "pointer-events-auto",
|
|
166
276
|
children: children
|
|
167
277
|
})
|
|
168
278
|
});
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
} else
|
|
172
|
-
let
|
|
173
|
-
if ($[
|
|
174
|
-
|
|
279
|
+
$[28] = children;
|
|
280
|
+
$[29] = t7;
|
|
281
|
+
} else t7 = $[29];
|
|
282
|
+
let t8;
|
|
283
|
+
if ($[30] !== paletteAttr || $[31] !== ref || $[32] !== rest || $[33] !== style || $[34] !== t5 || $[35] !== t6 || $[36] !== t7) {
|
|
284
|
+
t8 = /*#__PURE__*/ jsxs("div", {
|
|
175
285
|
"data-slot": "blur-background",
|
|
286
|
+
"data-palette": paletteAttr,
|
|
176
287
|
...rest,
|
|
177
288
|
ref: ref,
|
|
178
|
-
className:
|
|
289
|
+
className: t5,
|
|
179
290
|
style: style,
|
|
180
291
|
children: [
|
|
181
|
-
|
|
182
|
-
|
|
292
|
+
t6,
|
|
293
|
+
t7
|
|
183
294
|
]
|
|
184
295
|
});
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
|
|
192
|
-
|
|
296
|
+
$[30] = paletteAttr;
|
|
297
|
+
$[31] = ref;
|
|
298
|
+
$[32] = rest;
|
|
299
|
+
$[33] = style;
|
|
300
|
+
$[34] = t5;
|
|
301
|
+
$[35] = t6;
|
|
302
|
+
$[36] = t7;
|
|
303
|
+
$[37] = t8;
|
|
304
|
+
} else t8 = $[37];
|
|
305
|
+
return t8;
|
|
193
306
|
};
|
|
194
307
|
BlurBackground.displayName = "BlurBackground";
|
|
195
|
-
function _temp(b) {
|
|
196
|
-
return /*#__PURE__*/ jsx("div", {
|
|
197
|
-
className: "lg-blob",
|
|
198
|
-
style: {
|
|
199
|
-
...b.style,
|
|
200
|
-
background: b.background,
|
|
201
|
-
animationName: b.anim,
|
|
202
|
-
animationDuration: `${b.base / SPEED}s`,
|
|
203
|
-
animationTimingFunction: "ease-in-out",
|
|
204
|
-
animationIterationCount: "infinite"
|
|
205
|
-
}
|
|
206
|
-
}, b.name);
|
|
207
|
-
}
|
|
208
308
|
export { BlurBackground };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BlurBackground, type BlurBackgroundProps } from './BlurBackground.js';
|
|
1
|
+
export { BlurBackground, type BlurBackgroundPalette, type BlurBackgroundProps, } from './BlurBackground.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { AnimatedBackground, type AnimatedBackgroundProps } from './AnimatedBackground.js';
|
|
2
|
-
export { BlurBackground, type BlurBackgroundProps } from './blur/BlurBackground.js';
|
|
2
|
+
export { BlurBackground, type BlurBackgroundPalette, type BlurBackgroundProps, } from './blur/BlurBackground.js';
|
|
3
3
|
export { PixelBackground, type PixelBackgroundProps } from './pixel/PixelBackground.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FC, type HTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
export type ApprovalCardStatus = 'pending' | 'approved' | 'rejected';
|
|
4
|
+
export interface ApprovalCardProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
5
|
+
ref?: Ref<HTMLDivElement>;
|
|
6
|
+
/** Pending shows `children` (content + actions); resolved states replace them with a status row. */
|
|
7
|
+
status?: ApprovalCardStatus;
|
|
8
|
+
/** Shown above the card in every state. Pass `null` to hide it. */
|
|
9
|
+
caption?: ReactNode;
|
|
10
|
+
approvedLabel?: ReactNode;
|
|
11
|
+
rejectedLabel?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const ApprovalCard: FC<ApprovalCardProps>;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useId, useRef } from "react";
|
|
4
|
+
import { Check, X } from "../../icons/index.js";
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
import { mergeRefs } from "../../utils/mergeRefs.js";
|
|
7
|
+
import { TestIdProvider, useTestId } from "../../utils/testId.js";
|
|
8
|
+
import { approvalCardCaptionVariants, approvalCardStatusIconVariants, approvalCardSurfaceVariants, approvalCardVariants } from "./classes.js";
|
|
9
|
+
const Part = (t0)=>{
|
|
10
|
+
const $ = c(6);
|
|
11
|
+
let props;
|
|
12
|
+
let slot;
|
|
13
|
+
if ($[0] !== t0) {
|
|
14
|
+
({ slot, ...props } = t0);
|
|
15
|
+
$[0] = t0;
|
|
16
|
+
$[1] = props;
|
|
17
|
+
$[2] = slot;
|
|
18
|
+
} else {
|
|
19
|
+
props = $[1];
|
|
20
|
+
slot = $[2];
|
|
21
|
+
}
|
|
22
|
+
const t1 = useTestId(slot);
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[3] !== props || $[4] !== t1) {
|
|
25
|
+
t2 = /*#__PURE__*/ jsx("div", {
|
|
26
|
+
...props,
|
|
27
|
+
"data-testid": t1
|
|
28
|
+
});
|
|
29
|
+
$[3] = props;
|
|
30
|
+
$[4] = t1;
|
|
31
|
+
$[5] = t2;
|
|
32
|
+
} else t2 = $[5];
|
|
33
|
+
return t2;
|
|
34
|
+
};
|
|
35
|
+
const ApprovalCard = (t0)=>{
|
|
36
|
+
const $ = c(52);
|
|
37
|
+
let children;
|
|
38
|
+
let className;
|
|
39
|
+
let onBlur;
|
|
40
|
+
let onFocus;
|
|
41
|
+
let props;
|
|
42
|
+
let ref;
|
|
43
|
+
let t1;
|
|
44
|
+
let t2;
|
|
45
|
+
let t3;
|
|
46
|
+
let t4;
|
|
47
|
+
let testIdProp;
|
|
48
|
+
if ($[0] !== t0) {
|
|
49
|
+
({ ref, status: t1, caption: t2, approvedLabel: t3, rejectedLabel: t4, className, children, "data-testid": testIdProp, onFocus, onBlur, ...props } = t0);
|
|
50
|
+
$[0] = t0;
|
|
51
|
+
$[1] = children;
|
|
52
|
+
$[2] = className;
|
|
53
|
+
$[3] = onBlur;
|
|
54
|
+
$[4] = onFocus;
|
|
55
|
+
$[5] = props;
|
|
56
|
+
$[6] = ref;
|
|
57
|
+
$[7] = t1;
|
|
58
|
+
$[8] = t2;
|
|
59
|
+
$[9] = t3;
|
|
60
|
+
$[10] = t4;
|
|
61
|
+
$[11] = testIdProp;
|
|
62
|
+
} else {
|
|
63
|
+
children = $[1];
|
|
64
|
+
className = $[2];
|
|
65
|
+
onBlur = $[3];
|
|
66
|
+
onFocus = $[4];
|
|
67
|
+
props = $[5];
|
|
68
|
+
ref = $[6];
|
|
69
|
+
t1 = $[7];
|
|
70
|
+
t2 = $[8];
|
|
71
|
+
t3 = $[9];
|
|
72
|
+
t4 = $[10];
|
|
73
|
+
testIdProp = $[11];
|
|
74
|
+
}
|
|
75
|
+
const status = void 0 === t1 ? "pending" : t1;
|
|
76
|
+
const caption = void 0 === t2 ? "Requires your approval" : t2;
|
|
77
|
+
const approvedLabel = void 0 === t3 ? "Approved" : t3;
|
|
78
|
+
const rejectedLabel = void 0 === t4 ? "Rejected" : t4;
|
|
79
|
+
const testId = useTestId("approval-card", testIdProp);
|
|
80
|
+
const captionId = useId();
|
|
81
|
+
const rootRef = useRef(null);
|
|
82
|
+
const statusRef = useRef(null);
|
|
83
|
+
const prevStatus = useRef(status);
|
|
84
|
+
const focusWithin = useRef(false);
|
|
85
|
+
const StatusIcon = "approved" === status ? Check : X;
|
|
86
|
+
const hasCaption = null != caption && false !== caption && "" !== caption;
|
|
87
|
+
const labelledBy = !hasCaption || props["aria-label"] || props["aria-labelledby"] ? void 0 : captionId;
|
|
88
|
+
let t5;
|
|
89
|
+
let t6;
|
|
90
|
+
if ($[12] !== status) {
|
|
91
|
+
t5 = ()=>{
|
|
92
|
+
const wasPending = "pending" === prevStatus.current;
|
|
93
|
+
prevStatus.current = status;
|
|
94
|
+
if (!wasPending || "pending" === status || !focusWithin.current) return;
|
|
95
|
+
const active = document.activeElement;
|
|
96
|
+
if (!active || active === document.body || rootRef.current?.contains(active)) statusRef.current?.focus({
|
|
97
|
+
preventScroll: true
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
t6 = [
|
|
101
|
+
status
|
|
102
|
+
];
|
|
103
|
+
$[12] = status;
|
|
104
|
+
$[13] = t5;
|
|
105
|
+
$[14] = t6;
|
|
106
|
+
} else {
|
|
107
|
+
t5 = $[13];
|
|
108
|
+
t6 = $[14];
|
|
109
|
+
}
|
|
110
|
+
useEffect(t5, t6);
|
|
111
|
+
let t7;
|
|
112
|
+
if ($[15] !== ref) {
|
|
113
|
+
t7 = mergeRefs(ref, rootRef);
|
|
114
|
+
$[15] = ref;
|
|
115
|
+
$[16] = t7;
|
|
116
|
+
} else t7 = $[16];
|
|
117
|
+
let t8;
|
|
118
|
+
if ($[17] !== onFocus) {
|
|
119
|
+
t8 = (e)=>{
|
|
120
|
+
focusWithin.current = true;
|
|
121
|
+
onFocus?.(e);
|
|
122
|
+
};
|
|
123
|
+
$[17] = onFocus;
|
|
124
|
+
$[18] = t8;
|
|
125
|
+
} else t8 = $[18];
|
|
126
|
+
let t9;
|
|
127
|
+
if ($[19] !== onBlur) {
|
|
128
|
+
t9 = (e_0)=>{
|
|
129
|
+
focusWithin.current = e_0.currentTarget.contains(e_0.relatedTarget);
|
|
130
|
+
onBlur?.(e_0);
|
|
131
|
+
};
|
|
132
|
+
$[19] = onBlur;
|
|
133
|
+
$[20] = t9;
|
|
134
|
+
} else t9 = $[20];
|
|
135
|
+
let t10;
|
|
136
|
+
if ($[21] !== className) {
|
|
137
|
+
t10 = cn(approvalCardVariants(), className);
|
|
138
|
+
$[21] = className;
|
|
139
|
+
$[22] = t10;
|
|
140
|
+
} else t10 = $[22];
|
|
141
|
+
let t11;
|
|
142
|
+
if ($[23] !== caption || $[24] !== captionId || $[25] !== hasCaption) {
|
|
143
|
+
t11 = hasCaption && /*#__PURE__*/ jsx(Part, {
|
|
144
|
+
slot: "caption",
|
|
145
|
+
id: captionId,
|
|
146
|
+
"data-slot": "approval-card-caption",
|
|
147
|
+
className: approvalCardCaptionVariants(),
|
|
148
|
+
children: caption
|
|
149
|
+
});
|
|
150
|
+
$[23] = caption;
|
|
151
|
+
$[24] = captionId;
|
|
152
|
+
$[25] = hasCaption;
|
|
153
|
+
$[26] = t11;
|
|
154
|
+
} else t11 = $[26];
|
|
155
|
+
let t12;
|
|
156
|
+
if ($[27] !== children || $[28] !== status) {
|
|
157
|
+
t12 = "pending" === status && /*#__PURE__*/ jsx(Part, {
|
|
158
|
+
slot: "surface",
|
|
159
|
+
"data-slot": "approval-card-surface",
|
|
160
|
+
className: approvalCardSurfaceVariants({
|
|
161
|
+
status
|
|
162
|
+
}),
|
|
163
|
+
children: children
|
|
164
|
+
});
|
|
165
|
+
$[27] = children;
|
|
166
|
+
$[28] = status;
|
|
167
|
+
$[29] = t12;
|
|
168
|
+
} else t12 = $[29];
|
|
169
|
+
let t13;
|
|
170
|
+
if ($[30] !== StatusIcon || $[31] !== approvedLabel || $[32] !== rejectedLabel || $[33] !== status) {
|
|
171
|
+
t13 = "pending" !== status && /*#__PURE__*/ jsxs(Part, {
|
|
172
|
+
slot: "status",
|
|
173
|
+
ref: statusRef,
|
|
174
|
+
tabIndex: -1,
|
|
175
|
+
"data-slot": "approval-card-status",
|
|
176
|
+
className: cn(approvalCardSurfaceVariants({
|
|
177
|
+
status
|
|
178
|
+
}), "outline-none"),
|
|
179
|
+
children: [
|
|
180
|
+
/*#__PURE__*/ jsx(StatusIcon, {
|
|
181
|
+
size: "md",
|
|
182
|
+
className: approvalCardStatusIconVariants({
|
|
183
|
+
status
|
|
184
|
+
})
|
|
185
|
+
}),
|
|
186
|
+
"approved" === status ? approvedLabel : rejectedLabel
|
|
187
|
+
]
|
|
188
|
+
});
|
|
189
|
+
$[30] = StatusIcon;
|
|
190
|
+
$[31] = approvedLabel;
|
|
191
|
+
$[32] = rejectedLabel;
|
|
192
|
+
$[33] = status;
|
|
193
|
+
$[34] = t13;
|
|
194
|
+
} else t13 = $[34];
|
|
195
|
+
let t14;
|
|
196
|
+
if ($[35] !== t13) {
|
|
197
|
+
t14 = /*#__PURE__*/ jsx("div", {
|
|
198
|
+
role: "status",
|
|
199
|
+
children: t13
|
|
200
|
+
});
|
|
201
|
+
$[35] = t13;
|
|
202
|
+
$[36] = t14;
|
|
203
|
+
} else t14 = $[36];
|
|
204
|
+
let t15;
|
|
205
|
+
if ($[37] !== t11 || $[38] !== t12 || $[39] !== t14 || $[40] !== testId) {
|
|
206
|
+
t15 = /*#__PURE__*/ jsxs(TestIdProvider, {
|
|
207
|
+
value: testId,
|
|
208
|
+
children: [
|
|
209
|
+
t11,
|
|
210
|
+
t12,
|
|
211
|
+
t14
|
|
212
|
+
]
|
|
213
|
+
});
|
|
214
|
+
$[37] = t11;
|
|
215
|
+
$[38] = t12;
|
|
216
|
+
$[39] = t14;
|
|
217
|
+
$[40] = testId;
|
|
218
|
+
$[41] = t15;
|
|
219
|
+
} else t15 = $[41];
|
|
220
|
+
let t16;
|
|
221
|
+
if ($[42] !== labelledBy || $[43] !== props || $[44] !== status || $[45] !== t10 || $[46] !== t15 || $[47] !== t7 || $[48] !== t8 || $[49] !== t9 || $[50] !== testId) {
|
|
222
|
+
t16 = /*#__PURE__*/ jsx("div", {
|
|
223
|
+
role: "group",
|
|
224
|
+
"aria-labelledby": labelledBy,
|
|
225
|
+
...props,
|
|
226
|
+
ref: t7,
|
|
227
|
+
onFocus: t8,
|
|
228
|
+
onBlur: t9,
|
|
229
|
+
"data-slot": "approval-card",
|
|
230
|
+
"data-status": status,
|
|
231
|
+
"data-testid": testId,
|
|
232
|
+
className: t10,
|
|
233
|
+
children: t15
|
|
234
|
+
});
|
|
235
|
+
$[42] = labelledBy;
|
|
236
|
+
$[43] = props;
|
|
237
|
+
$[44] = status;
|
|
238
|
+
$[45] = t10;
|
|
239
|
+
$[46] = t15;
|
|
240
|
+
$[47] = t7;
|
|
241
|
+
$[48] = t8;
|
|
242
|
+
$[49] = t9;
|
|
243
|
+
$[50] = testId;
|
|
244
|
+
$[51] = t16;
|
|
245
|
+
} else t16 = $[51];
|
|
246
|
+
return t16;
|
|
247
|
+
};
|
|
248
|
+
ApprovalCard.displayName = "ApprovalCard";
|
|
249
|
+
export { ApprovalCard };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
export interface ApprovalCardActionsProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const ApprovalCardActions: FC<ApprovalCardActionsProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { approvalCardActionsVariants } from "./classes.js";
|
|
6
|
+
const ApprovalCardActions = (t0)=>{
|
|
7
|
+
const $ = c(12);
|
|
8
|
+
let className;
|
|
9
|
+
let props;
|
|
10
|
+
let ref;
|
|
11
|
+
let testIdProp;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({ ref, className, "data-testid": testIdProp, ...props } = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = className;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
$[3] = ref;
|
|
18
|
+
$[4] = testIdProp;
|
|
19
|
+
} else {
|
|
20
|
+
className = $[1];
|
|
21
|
+
props = $[2];
|
|
22
|
+
ref = $[3];
|
|
23
|
+
testIdProp = $[4];
|
|
24
|
+
}
|
|
25
|
+
const testId = useTestId("actions", testIdProp);
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[5] !== className) {
|
|
28
|
+
t1 = cn(approvalCardActionsVariants(), className);
|
|
29
|
+
$[5] = className;
|
|
30
|
+
$[6] = t1;
|
|
31
|
+
} else t1 = $[6];
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[7] !== props || $[8] !== ref || $[9] !== t1 || $[10] !== testId) {
|
|
34
|
+
t2 = /*#__PURE__*/ jsx("div", {
|
|
35
|
+
...props,
|
|
36
|
+
ref: ref,
|
|
37
|
+
"data-slot": "approval-card-actions",
|
|
38
|
+
"data-testid": testId,
|
|
39
|
+
className: t1
|
|
40
|
+
});
|
|
41
|
+
$[7] = props;
|
|
42
|
+
$[8] = ref;
|
|
43
|
+
$[9] = t1;
|
|
44
|
+
$[10] = testId;
|
|
45
|
+
$[11] = t2;
|
|
46
|
+
} else t2 = $[11];
|
|
47
|
+
return t2;
|
|
48
|
+
};
|
|
49
|
+
ApprovalCardActions.displayName = "ApprovalCardActions";
|
|
50
|
+
export { ApprovalCardActions };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
export interface ApprovalCardContentProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const ApprovalCardContent: FC<ApprovalCardContentProps>;
|