@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.
Files changed (169) hide show
  1. package/dist/components/AnimatedBackground/blur/BlurBackground.d.ts +6 -0
  2. package/dist/components/AnimatedBackground/blur/BlurBackground.js +176 -76
  3. package/dist/components/AnimatedBackground/blur/index.d.ts +1 -1
  4. package/dist/components/AnimatedBackground/index.d.ts +1 -1
  5. package/dist/components/ApprovalCard/ApprovalCard.d.ts +13 -0
  6. package/dist/components/ApprovalCard/ApprovalCard.js +249 -0
  7. package/dist/components/ApprovalCard/ApprovalCardActions.d.ts +6 -0
  8. package/dist/components/ApprovalCard/ApprovalCardActions.js +50 -0
  9. package/dist/components/ApprovalCard/ApprovalCardContent.d.ts +6 -0
  10. package/dist/components/ApprovalCard/ApprovalCardContent.js +50 -0
  11. package/dist/components/ApprovalCard/classes.d.ts +10 -0
  12. package/dist/components/ApprovalCard/classes.js +26 -0
  13. package/dist/components/ApprovalCard/index.d.ts +3 -0
  14. package/dist/components/ApprovalCard/index.js +3 -0
  15. package/dist/components/AssistantMessage/AssistantMessage.d.ts +12 -0
  16. package/dist/components/AssistantMessage/AssistantMessage.js +66 -0
  17. package/dist/components/AssistantMessage/AssistantMessageContent.d.ts +10 -0
  18. package/dist/components/AssistantMessage/AssistantMessageContent.js +50 -0
  19. package/dist/components/AssistantMessage/AssistantMessageError.d.ts +13 -0
  20. package/dist/components/AssistantMessage/AssistantMessageError.js +93 -0
  21. package/dist/components/AssistantMessage/AssistantMessageLoader.d.ts +13 -0
  22. package/dist/components/AssistantMessage/AssistantMessageLoader.js +88 -0
  23. package/dist/components/AssistantMessage/AssistantMessageMarkdown.d.ts +71 -0
  24. package/dist/components/AssistantMessage/AssistantMessageMarkdown.js +278 -0
  25. package/dist/components/AssistantMessage/AssistantMessageMarkdownCodeBlock.d.ts +17 -0
  26. package/dist/components/AssistantMessage/AssistantMessageMarkdownCodeBlock.js +94 -0
  27. package/dist/components/AssistantMessage/AssistantMessageMarkdownInlineCode.d.ts +10 -0
  28. package/dist/components/AssistantMessage/AssistantMessageMarkdownInlineCode.js +59 -0
  29. package/dist/components/AssistantMessage/AssistantMessageMarkdownLink.d.ts +14 -0
  30. package/dist/components/AssistantMessage/AssistantMessageMarkdownLink.js +65 -0
  31. package/dist/components/AssistantMessage/AssistantMessageMarkdownTable.d.ts +7 -0
  32. package/dist/components/AssistantMessage/AssistantMessageMarkdownTable.js +70 -0
  33. package/dist/components/AssistantMessage/classes.d.ts +38 -0
  34. package/dist/components/AssistantMessage/classes.js +46 -0
  35. package/dist/components/AssistantMessage/index.d.ts +9 -0
  36. package/dist/components/AssistantMessage/index.js +9 -0
  37. package/dist/components/AssistantMessage/lib/markdown.d.ts +20 -0
  38. package/dist/components/AssistantMessage/lib/markdown.js +51 -0
  39. package/dist/components/ChainOfThought/ChainOfThought.d.ts +10 -0
  40. package/dist/components/ChainOfThought/ChainOfThought.js +66 -0
  41. package/dist/components/ChainOfThought/ChainOfThoughtStep.d.ts +31 -0
  42. package/dist/components/ChainOfThought/ChainOfThoughtStep.js +312 -0
  43. package/dist/components/ChainOfThought/classes.d.ts +20 -0
  44. package/dist/components/ChainOfThought/classes.js +84 -0
  45. package/dist/components/ChainOfThought/index.d.ts +2 -0
  46. package/dist/components/ChainOfThought/index.js +2 -0
  47. package/dist/components/Chat/Chat.d.ts +12 -0
  48. package/dist/components/Chat/Chat.js +90 -0
  49. package/dist/components/Chat/ChatBody.d.ts +12 -0
  50. package/dist/components/Chat/ChatBody.js +52 -0
  51. package/dist/components/Chat/ChatFooter.d.ts +7 -0
  52. package/dist/components/Chat/ChatFooter.js +50 -0
  53. package/dist/components/Chat/ChatGreeting.d.ts +8 -0
  54. package/dist/components/Chat/ChatGreeting.js +94 -0
  55. package/dist/components/Chat/ChatHeader.d.ts +6 -0
  56. package/dist/components/Chat/ChatHeader.js +50 -0
  57. package/dist/components/Chat/ChatHeaderActions.d.ts +7 -0
  58. package/dist/components/Chat/ChatHeaderActions.js +50 -0
  59. package/dist/components/Chat/ChatHeaderTitle.d.ts +12 -0
  60. package/dist/components/Chat/ChatHeaderTitle.js +99 -0
  61. package/dist/components/Chat/ChatSuggestion.d.ts +7 -0
  62. package/dist/components/Chat/ChatSuggestion.js +56 -0
  63. package/dist/components/Chat/ChatSuggestions.d.ts +14 -0
  64. package/dist/components/Chat/ChatSuggestions.js +111 -0
  65. package/dist/components/Chat/ChatSuggestionsContext.d.ts +7 -0
  66. package/dist/components/Chat/ChatSuggestionsContext.js +7 -0
  67. package/dist/components/Chat/ChatTrigger.d.ts +13 -0
  68. package/dist/components/Chat/ChatTrigger.js +101 -0
  69. package/dist/components/Chat/classes.d.ts +17 -0
  70. package/dist/components/Chat/classes.js +44 -0
  71. package/dist/components/Chat/index.d.ts +10 -0
  72. package/dist/components/Chat/index.js +10 -0
  73. package/dist/components/ChatInput/ChatInput.d.ts +30 -0
  74. package/dist/components/ChatInput/ChatInput.js +230 -0
  75. package/dist/components/ChatInput/ChatInputContext.d.ts +11 -0
  76. package/dist/components/ChatInput/ChatInputContext.js +8 -0
  77. package/dist/components/ChatInput/ChatInputSubmit.d.ts +10 -0
  78. package/dist/components/ChatInput/ChatInputSubmit.js +175 -0
  79. package/dist/components/ChatInput/ChatInputTextarea.d.ts +6 -0
  80. package/dist/components/ChatInput/ChatInputTextarea.js +155 -0
  81. package/dist/components/ChatInput/classes.d.ts +9 -0
  82. package/dist/components/ChatInput/classes.js +22 -0
  83. package/dist/components/ChatInput/index.d.ts +3 -0
  84. package/dist/components/ChatInput/index.js +3 -0
  85. package/dist/components/ChatPermissions/ChatPermissions.d.ts +12 -0
  86. package/dist/components/ChatPermissions/ChatPermissions.js +66 -0
  87. package/dist/components/ChatPermissions/ChatPermissionsContent.d.ts +7 -0
  88. package/dist/components/ChatPermissions/ChatPermissionsContent.js +73 -0
  89. package/dist/components/ChatPermissions/ChatPermissionsContext.d.ts +7 -0
  90. package/dist/components/ChatPermissions/ChatPermissionsContext.js +8 -0
  91. package/dist/components/ChatPermissions/ChatPermissionsItem.d.ts +17 -0
  92. package/dist/components/ChatPermissions/ChatPermissionsItem.js +115 -0
  93. package/dist/components/ChatPermissions/ChatPermissionsTrigger.d.ts +6 -0
  94. package/dist/components/ChatPermissions/ChatPermissionsTrigger.js +110 -0
  95. package/dist/components/ChatPermissions/classes.d.ts +3 -0
  96. package/dist/components/ChatPermissions/classes.js +5 -0
  97. package/dist/components/ChatPermissions/index.d.ts +4 -0
  98. package/dist/components/ChatPermissions/index.js +4 -0
  99. package/dist/components/Conversation/Conversation.d.ts +19 -0
  100. package/dist/components/Conversation/Conversation.js +102 -0
  101. package/dist/components/Conversation/ConversationContent.d.ts +11 -0
  102. package/dist/components/Conversation/ConversationContent.js +103 -0
  103. package/dist/components/Conversation/ConversationContext.d.ts +14 -0
  104. package/dist/components/Conversation/ConversationContext.js +8 -0
  105. package/dist/components/Conversation/ConversationEmptyState.d.ts +15 -0
  106. package/dist/components/Conversation/ConversationEmptyState.js +70 -0
  107. package/dist/components/Conversation/ConversationScrollButton.d.ts +13 -0
  108. package/dist/components/Conversation/ConversationScrollButton.js +138 -0
  109. package/dist/components/Conversation/classes.d.ts +13 -0
  110. package/dist/components/Conversation/classes.js +8 -0
  111. package/dist/components/Conversation/index.d.ts +4 -0
  112. package/dist/components/Conversation/index.js +4 -0
  113. package/dist/components/Conversation/useStickToBottom.d.ts +9 -0
  114. package/dist/components/Conversation/useStickToBottom.js +203 -0
  115. package/dist/components/MessageActions/MessageAction.d.ts +18 -0
  116. package/dist/components/MessageActions/MessageAction.js +109 -0
  117. package/dist/components/MessageActions/MessageActions.d.ts +12 -0
  118. package/dist/components/MessageActions/MessageActions.js +74 -0
  119. package/dist/components/MessageActions/MessageTimestamp.d.ts +7 -0
  120. package/dist/components/MessageActions/MessageTimestamp.js +50 -0
  121. package/dist/components/MessageActions/classes.d.ts +5 -0
  122. package/dist/components/MessageActions/classes.js +15 -0
  123. package/dist/components/MessageActions/index.d.ts +3 -0
  124. package/dist/components/MessageActions/index.js +3 -0
  125. package/dist/components/Popover/PopoverContent.d.ts +2 -1
  126. package/dist/components/Popover/PopoverContent.js +42 -39
  127. package/dist/components/UserMessage/UserMessage.d.ts +10 -0
  128. package/dist/components/UserMessage/UserMessage.js +66 -0
  129. package/dist/components/UserMessage/UserMessageBubble.d.ts +16 -0
  130. package/dist/components/UserMessage/UserMessageBubble.js +175 -0
  131. package/dist/components/UserMessage/UserMessageContext.d.ts +9 -0
  132. package/dist/components/UserMessage/UserMessageContext.js +4 -0
  133. package/dist/components/UserMessage/UserMessageShowMore.d.ts +15 -0
  134. package/dist/components/UserMessage/UserMessageShowMore.js +87 -0
  135. package/dist/components/UserMessage/classes.d.ts +11 -0
  136. package/dist/components/UserMessage/classes.js +32 -0
  137. package/dist/components/UserMessage/index.d.ts +3 -0
  138. package/dist/components/UserMessage/index.js +3 -0
  139. package/dist/components/WallyAssistant/WallyAssistant.d.ts +56 -0
  140. package/dist/components/WallyAssistant/WallyAssistant.js +541 -0
  141. package/dist/components/WallyAssistant/index.d.ts +10 -0
  142. package/dist/components/WallyAssistant/index.js +8 -0
  143. package/dist/components/WallyAssistant/model/deriveChatState.d.ts +33 -0
  144. package/dist/components/WallyAssistant/model/deriveChatState.js +54 -0
  145. package/dist/components/WallyAssistant/model/labels.d.ts +43 -0
  146. package/dist/components/WallyAssistant/model/labels.js +33 -0
  147. package/dist/components/WallyAssistant/model/model.d.ts +184 -0
  148. package/dist/components/WallyAssistant/model/model.js +0 -0
  149. package/dist/components/WallyAssistant/views/ApprovalCardView.d.ts +20 -0
  150. package/dist/components/WallyAssistant/views/ApprovalCardView.js +274 -0
  151. package/dist/components/WallyAssistant/views/ChainOfThoughtView.d.ts +18 -0
  152. package/dist/components/WallyAssistant/views/ChainOfThoughtView.js +301 -0
  153. package/dist/components/WallyAssistant/views/ChatMessageView.d.ts +15 -0
  154. package/dist/components/WallyAssistant/views/ChatMessageView.js +372 -0
  155. package/dist/components/WallyAssistant/views/ChatPartView.d.ts +16 -0
  156. package/dist/components/WallyAssistant/views/ChatPartView.js +171 -0
  157. package/dist/components/WallyAssistant/views/ChatViewContext.d.ts +98 -0
  158. package/dist/components/WallyAssistant/views/ChatViewContext.js +44 -0
  159. package/dist/components/WallyAssistant/views/ChatViewProvider.d.ts +18 -0
  160. package/dist/components/WallyAssistant/views/ChatViewProvider.js +96 -0
  161. package/dist/components/WallyAssistant/views/stepIcons.d.ts +8 -0
  162. package/dist/components/WallyAssistant/views/stepIcons.js +47 -0
  163. package/dist/index.d.ts +10 -0
  164. package/dist/index.js +10 -0
  165. package/dist/metadata/components.json +30786 -15960
  166. package/dist/theme/components/animated-background.css +6 -1
  167. package/dist/theme/index.css +1 -0
  168. package/dist/theme/utilities/shimmer-text.css +27 -0
  169. 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(26);
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
- let t1;
103
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
104
- t1 = {
105
- "--lg-blur": BLUR
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 = /*#__PURE__*/ jsx("div", {
112
- className: "lg-mesh",
113
- style: t1,
114
- children: BLOBS.map(_temp)
115
- });
186
+ t2 = {
187
+ "--lg-blur": BLUR
188
+ };
116
189
  $[7] = t2;
117
190
  } else t2 = $[7];
118
- const meshContent = t2;
119
- if (null == children) {
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 ($[10] !== ref || $[11] !== rest || $[12] !== style || $[13] !== t3) {
128
- t4 = /*#__PURE__*/ jsx("div", {
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: t3,
239
+ className: t5,
133
240
  style: style,
134
241
  "aria-hidden": "true",
135
242
  children: meshContent
136
243
  });
137
- $[10] = ref;
138
- $[11] = rest;
139
- $[12] = style;
140
- $[13] = t3;
141
- $[14] = t4;
142
- } else t4 = $[14];
143
- return t4;
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 t3;
146
- if ($[15] !== className) {
147
- t3 = cn("lg-frame relative", className);
148
- $[15] = className;
149
- $[16] = t3;
150
- } else t3 = $[16];
151
- let t4;
152
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
153
- t4 = /*#__PURE__*/ jsx("div", {
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
- $[17] = t4;
159
- } else t4 = $[17];
160
- let t5;
161
- if ($[18] !== children) {
162
- t5 = /*#__PURE__*/ jsx("div", {
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
- $[18] = children;
170
- $[19] = t5;
171
- } else t5 = $[19];
172
- let t6;
173
- if ($[20] !== ref || $[21] !== rest || $[22] !== style || $[23] !== t3 || $[24] !== t5) {
174
- t6 = /*#__PURE__*/ jsxs("div", {
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: t3,
289
+ className: t5,
179
290
  style: style,
180
291
  children: [
181
- t4,
182
- t5
292
+ t6,
293
+ t7
183
294
  ]
184
295
  });
185
- $[20] = ref;
186
- $[21] = rest;
187
- $[22] = style;
188
- $[23] = t3;
189
- $[24] = t5;
190
- $[25] = t6;
191
- } else t6 = $[25];
192
- return t6;
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>;