whatsapp-ui-react 0.0.5 → 0.0.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAA;AAEvB,mBAAmB,mBAAmB,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,mBAAmB,sBAAsB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,mBAAmB,uBAAuB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,mBAAmB,sBAAsB,CAAA;AACzC,OAAO,EACL,KAAK,EACL,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,EACJ,GAAG,EACH,KAAK,EACL,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,UAAU,EACV,KAAK,EACL,KAAK,GACN,MAAM,sBAAsB,CAAA;AAE7B,mBAAmB,oBAAoB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,mBAAmB,kBAAkB,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,mBAAmB,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,mBAAmB,sBAAsB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,mBAAmB,uBAAuB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,mBAAmB,sBAAsB,CAAA;AACzC,OAAO,EACL,KAAK,EACL,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,EACJ,GAAG,EACH,KAAK,EACL,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,UAAU,EACV,KAAK,EACL,KAAK,GACN,MAAM,sBAAsB,CAAA;AAE7B,mBAAmB,oBAAoB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,mBAAmB,kBAAkB,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -4158,7 +4158,10 @@ const Chat$1 = React.forwardRef(function Chat2({
4158
4158
  onAttachClick,
4159
4159
  onCameraClick,
4160
4160
  onMicClick,
4161
- theme
4161
+ theme,
4162
+ colorScheme,
4163
+ width,
4164
+ height
4162
4165
  }, ref) {
4163
4166
  const [messages, setMessages] = React.useState(messageHistory ?? []);
4164
4167
  const scrollRef = React.useRef(null);
@@ -4205,12 +4208,21 @@ const Chat$1 = React.forwardRef(function Chat2({
4205
4208
  React.useImperativeHandle(ref, () => ({ addMessage }));
4206
4209
  const isDefaultBg = background === void 0;
4207
4210
  const bgStyle = background === null || background === "none" ? { backgroundColor: "#0a0a0a" } : isDefaultBg ? {} : { backgroundColor: background };
4211
+ const sizeStyle = {
4212
+ ...width !== void 0 ? { width: typeof width === "number" ? `${width}px` : width } : {},
4213
+ ...height !== void 0 ? { height: typeof height === "number" ? `${height}px` : height } : {}
4214
+ };
4208
4215
  return /* @__PURE__ */ jsx(ChatReplyContext.Provider, { value: { messages, sendMessage, addMessage, provided: true }, children: /* @__PURE__ */ jsxs(
4209
4216
  "div",
4210
4217
  {
4211
- className: cn("flex h-full min-h-0 flex-col", isDefaultBg ? "bg-wa-bg" : "", className),
4212
- style: isDefaultBg ? void 0 : bgStyle,
4213
- ...theme ? { "data-wa-theme": theme } : {},
4218
+ className: cn(
4219
+ "flex h-full min-h-0 flex-col",
4220
+ isDefaultBg ? "bg-wa-bg" : "",
4221
+ theme === "dark" ? "dark" : "",
4222
+ className
4223
+ ),
4224
+ style: { ...isDefaultBg ? {} : bgStyle, ...sizeStyle },
4225
+ ...colorScheme ? { "data-wa-color": colorScheme } : {},
4214
4226
  children: [
4215
4227
  /* @__PURE__ */ jsx(
4216
4228
  ChatHeader,
@@ -4228,17 +4240,10 @@ const Chat$1 = React.forwardRef(function Chat2({
4228
4240
  style: { backgroundImage: `url(${backgroundUrl})` }
4229
4241
  }
4230
4242
  ),
4231
- /* @__PURE__ */ jsx(
4232
- "div",
4233
- {
4234
- ref: scrollRef,
4235
- className: "flex-1 overflow-y-auto py-2 px-12 [scrollbar-width:thin] [scrollbar-color:rgba(255,255,255,0.1)_transparent] [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-[rgba(255,255,255,0.18)] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb:hover]:bg-[rgba(255,255,255,0.3)]",
4236
- children: /* @__PURE__ */ jsxs("div", { ref: contentRef, children: [
4237
- children,
4238
- messages.length > 0 && /* @__PURE__ */ jsx(MessageList, { messages })
4239
- ] })
4240
- }
4241
- ),
4243
+ /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "wa-scrollbar flex-1 overflow-y-auto px-12 py-2", children: /* @__PURE__ */ jsxs("div", { ref: contentRef, children: [
4244
+ children,
4245
+ messages.length > 0 && /* @__PURE__ */ jsx(MessageList, { messages })
4246
+ ] }) }),
4242
4247
  showInputfield && /* @__PURE__ */ jsx(
4243
4248
  Inputfield,
4244
4249
  {